ARM: KVM: get rid of S2_PGD_SIZE
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 14 May 2013 11:11:39 +0000 (12:11 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:10:37 +0000 (17:10 +0200)
S2_PGD_SIZE defines the number of pages used by a stage-2 PGD
and is unused, except for a VM_BUG_ON check that missuses the
define.

As the check is very unlikely to ever triggered except in
circumstances where KVM is the least of our worries, just kill
both the define and the VM_BUG_ON check.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
(cherry picked from commit 4db845c3d8e2f8a219e8ac48834dd4fe085e5d63)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/include/asm/kvm_arm.h
arch/arm/kvm/mmu.c

index 124623e5ef14ab2bde6b6ab954901fa4d4b8c3a7..64e96960de297c850c480f1df3be1dc331ee891a 100644 (file)
 #define KVM_PHYS_MASK  (KVM_PHYS_SIZE - 1ULL)
 #define PTRS_PER_S2_PGD        (1ULL << (KVM_PHYS_SHIFT - 30))
 #define S2_PGD_ORDER   get_order(PTRS_PER_S2_PGD * sizeof(pgd_t))
-#define S2_PGD_SIZE    (1 << S2_PGD_ORDER)
 
 /* Virtualization Translation Control Register (VTCR) bits */
 #define VTCR_SH0       (3 << 12)
index 84ba67b982c0d32546dae5092ec84ac1d620756b..ca6bea4859b48c35e9c34d970fb02580840e23b4 100644 (file)
@@ -382,9 +382,6 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
        if (!pgd)
                return -ENOMEM;
 
-       /* stage-2 pgd must be aligned to its size */
-       VM_BUG_ON((unsigned long)pgd & (S2_PGD_SIZE - 1));
-
        memset(pgd, 0, PTRS_PER_S2_PGD * sizeof(pgd_t));
        kvm_clean_pgd(pgd);
        kvm->arch.pgd = pgd;