linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ARM: KVM: fix use of S2_PGD_SIZE
Date: Tue, 30 Apr 2013 15:17:26 +0100	[thread overview]
Message-ID: <1367331446-28030-5-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1367331446-28030-1-git-send-email-marc.zyngier@arm.com>

S2_PGD_SIZE describe the number of pages a used by a stage-2 PGD,
not the size of the PGD.

Fix the VM_BUG_ON() call that doesn't check much when S2_PGD_SIZE
is equal to 1.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index b978ebe..09ece5c 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -377,7 +377,7 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
 		return -ENOMEM;
 
 	/* stage-2 pgd must be aligned to its size */
-	VM_BUG_ON((unsigned long)pgd & (S2_PGD_SIZE - 1));
+	VM_BUG_ON((unsigned long)pgd & (PAGE_SIZE * S2_PGD_SIZE - 1));
 
 	memset(pgd, 0, PTRS_PER_S2_PGD * sizeof(pgd_t));
 	kvm_clean_pgd(pgd);
-- 
1.8.2.1

  parent reply	other threads:[~2013-04-30 14:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 14:17 [PATCH 0/4] ARM: KVM: random mmu related fixes for 3.10 Marc Zyngier
2013-04-30 14:17 ` [PATCH 1/4] ARM: KVM: be more thorough when invalidating TLBs Marc Zyngier
2013-04-30 17:17   ` Christoffer Dall
2013-04-30 18:02     ` Marc Zyngier
2013-04-30 14:17 ` [PATCH 2/4] ARM: KVM: remove dead prototype for __kvm_tlb_flush_vmid Marc Zyngier
2013-04-30 14:17 ` [PATCH 3/4] ARM: KVM: relax cache maintainance when building page pables Marc Zyngier
2013-04-30 14:30   ` Will Deacon
2013-04-30 14:17 ` Marc Zyngier [this message]
2013-04-30 17:40   ` [PATCH 4/4] ARM: KVM: fix use of S2_PGD_SIZE Christoffer Dall
2013-04-30 17:52     ` Marc Zyngier
2013-04-30 17:56       ` Christoffer Dall
2013-04-30 17:59         ` Marc Zyngier

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=1367331446-28030-5-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --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).