Skip to content

Commit ab05402

Browse files
murzinvAlex Shi
authored andcommitted
arm/arm64: KVM: Remove unreferenced S2_PGD_ORDER
Since commit a987370 ("arm64: KVM: Fix stage-2 PGD allocation to have per-page refcounting") there is no reference to S2_PGD_ORDER, so kill it for the good. Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> (cherry picked from commit 9d4dc688342a3cbda43a1789cd2c6c888658c60d) Signed-off-by: Alex Shi <alex.shi@linaro.org>
1 parent 3893b12 commit ab05402

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

arch/arm/include/asm/kvm_arm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
#define KVM_PHYS_SIZE (1ULL << KVM_PHYS_SHIFT)
136136
#define KVM_PHYS_MASK (KVM_PHYS_SIZE - 1ULL)
137137
#define PTRS_PER_S2_PGD (1ULL << (KVM_PHYS_SHIFT - 30))
138-
#define S2_PGD_ORDER get_order(PTRS_PER_S2_PGD * sizeof(pgd_t))
139138

140139
/* Virtualization Translation Control Register (VTCR) bits */
141140
#define VTCR_SH0 (3 << 12)

arch/arm/kvm/mmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,9 @@ static void *kvm_alloc_hwpgd(void)
656656
* kvm_alloc_stage2_pgd - allocate level-1 table for stage-2 translation.
657657
* @kvm: The KVM struct pointer for the VM.
658658
*
659-
* Allocates the 1st level table only of size defined by S2_PGD_ORDER (can
660-
* support either full 40-bit input addresses or limited to 32-bit input
661-
* addresses). Clears the allocated pages.
659+
* Allocates only the stage-2 HW PGD level table(s) (can support either full
660+
* 40-bit input addresses or limited to 32-bit input addresses). Clears the
661+
* allocated pages.
662662
*
663663
* Note we don't need locking here as this is only called when the VM is
664664
* created, which can only be done once.

arch/arm64/include/asm/kvm_mmu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
158158
#define PTRS_PER_S2_PGD_SHIFT (KVM_PHYS_SHIFT - PGDIR_SHIFT)
159159
#endif
160160
#define PTRS_PER_S2_PGD (1 << PTRS_PER_S2_PGD_SHIFT)
161-
#define S2_PGD_ORDER get_order(PTRS_PER_S2_PGD * sizeof(pgd_t))
162161

163162
#define kvm_pgd_index(addr) (((addr) >> PGDIR_SHIFT) & (PTRS_PER_S2_PGD - 1))
164163

0 commit comments

Comments
 (0)