From: cdall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [kvmarm:master 1/3] arch/arm/kvm/mmu.c:302:14: error: 'S2_PUD_SIZE' undeclared
Date: Tue, 4 Apr 2017 12:36:31 +0200 [thread overview]
Message-ID: <20170404103631.GG11752@cbox> (raw)
In-Reply-To: <2eb71228-7199-4f92-f9f7-3bb7c62bf485@arm.com>
On Tue, Apr 04, 2017 at 11:28:09AM +0100, Marc Zyngier wrote:
> On 04/04/17 11:14, Suzuki K Poulose wrote:
> > On 03/04/17 22:15, kbuild test robot wrote:
> >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git master
> >> head: 1f1c45c6f66a586ca420ca02cbd93a35690394f9
> >> commit: f9d9eb7f7a2c7e388861fe1cdb253f63e63555fe [1/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd
> >> config: arm-axm55xx_defconfig (attached as .config)
> >> compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
> >> reproduce:
> >> wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >> chmod +x ~/bin/make.cross
> >> git checkout f9d9eb7f7a2c7e388861fe1cdb253f63e63555fe
> >> # save the attached .config to linux build tree
> >> make.cross ARCH=arm
> >>
> >> All errors (new ones prefixed by >>):
> >>
> >> arch/arm/kvm/mmu.c: In function 'unmap_stage2_range':
> >>>> arch/arm/kvm/mmu.c:302:14: error: 'S2_PUD_SIZE' undeclared (first use in this function)
> >> if (size > S2_PUD_SIZE)
> >> ^~~~~~~~~~~
> >
> > Thanks kbuild for catching this one !
> >
> >> arch/arm/kvm/mmu.c:302:14: note: each undeclared identifier is reported only once for each function it appears in
> >>
> >> vim +/S2_PUD_SIZE +302 arch/arm/kvm/mmu.c
> >>
> >> 296 pgd = kvm->arch.pgd + stage2_pgd_index(addr);
> >> 297 do {
> >> 298 /*
> >> 299 * If the range is too large, release the kvm->mmu_lock
> >> 300 * to prevent starvation and lockup detector warnings.
> >> 301 */
> >> > 302 if (size > S2_PUD_SIZE)
> >> 303 cond_resched_lock(&kvm->mmu_lock);
> >> 304 next = stage2_pgd_addr_end(addr, end);
> >> 305 if (!stage2_pgd_none(*pgd))
> >>
> >
> >
> > Marc, Christoffer,
> >
> > Ah! I didn't test this on arm32. We have two options :
> >
> > 1) Define S2_P{U,M}_SIZE for arm32 in asm/stage2_pgtable.h
> >
> > or,
> >
> > 2) use the following hunk on top of the patch, which changes the lock
> > release after we process one PGDIR entry. As for the first time we enter
> > the loop we haven't done much with the lock held, hence it may make
> > sense to do it after the first round and we have more work to do.
> >
> > Let me know what you think
> >
> >
> > diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> > index db94f3a..582a972 100644
> > --- a/arch/arm/kvm/mmu.c
> > +++ b/arch/arm/kvm/mmu.c
> > @@ -295,15 +295,15 @@ static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
> > assert_spin_locked(&kvm->mmu_lock);
> > pgd = kvm->arch.pgd + stage2_pgd_index(addr);
> > do {
> > + next = stage2_pgd_addr_end(addr, end);
> > + if (!stage2_pgd_none(*pgd))
> > + unmap_stage2_puds(kvm, pgd, addr, next);
> > /*
> > * If the range is too large, release the kvm->mmu_lock
> > * to prevent starvation and lockup detector warnings.
> > */
> > - if (size > S2_PUD_SIZE)
> > + if (next != end)
> > cond_resched_lock(&kvm->mmu_lock);
> > - next = stage2_pgd_addr_end(addr, end);
> > - if (!stage2_pgd_none(*pgd))
> > - unmap_stage2_puds(kvm, pgd, addr, next);
> > } while (pgd++, addr = next, addr != end);
> > }
>
> Yup, I quite like this last option, as it doesn't rely on a particular
> size (or just implicitly that of the PGD). Can you respin this?
>
Agreed, I prefer this over my suggestion (sent as a reply to the
original patch).
Thanks,
-Christoffer
prev parent reply other threads:[~2017-04-04 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 21:15 [kvmarm:master 1/3] arch/arm/kvm/mmu.c:302:14: error: 'S2_PUD_SIZE' undeclared kbuild test robot
2017-04-04 10:14 ` Suzuki K Poulose
2017-04-04 10:28 ` Marc Zyngier
2017-04-04 10:36 ` Christoffer Dall [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170404103631.GG11752@cbox \
--to=cdall@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).