Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: PPC: Book3S HV: Use RADIX_PTE_INDEX_SIZE in Radix MMU code

In kvmppc_unmap_free_pte() in book3s_64_mmu_radix.c, we use the
non-constant value PTE_INDEX_SIZE to clear a PTE page.

We can instead use the constant RADIX_PTE_INDEX_SIZE, because we know
this code will only be running when the Radix MMU is active.

Note that we already use RADIX_PTE_INDEX_SIZE for the allocation of
kvm_pte_cache.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Leonardo Bras <leonardo@linux.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

authored by

Michael Ellerman and committed by
Paul Mackerras
afd31356 cd758a9b

+1 -1
+1 -1
arch/powerpc/kvm/book3s_64_mmu_radix.c
··· 425 425 unsigned int lpid) 426 426 { 427 427 if (full) { 428 - memset(pte, 0, sizeof(long) << PTE_INDEX_SIZE); 428 + memset(pte, 0, sizeof(long) << RADIX_PTE_INDEX_SIZE); 429 429 } else { 430 430 pte_t *p = pte; 431 431 unsigned long it;