aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_64_mmu_hv.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2022-01-23 22:00:42 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2022-05-13 21:33:34 +1000
commit03a2e65f54b3acae37f0992133d2f4d1d35f4200 (patch)
tree4e848485de0827fb0ce6293835d98990ea99eb43 /arch/powerpc/kvm/book3s_64_mmu_hv.c
parentKVM: PPC: Book3S HV Nested: Change nested guest lookup to use idr (diff)
downloadlinux-dev-03a2e65f54b3acae37f0992133d2f4d1d35f4200.tar.xz
linux-dev-03a2e65f54b3acae37f0992133d2f4d1d35f4200.zip
KVM: PPC: Book3S Nested: Use explicit 4096 LPID maximum
Rather than tie this to KVMPPC_NR_LPIDS which is becoming more dynamic, fix it to 4096 (12-bits) explicitly for now. kvmhv_get_nested() does not have to check against KVM_MAX_NESTED_GUESTS because the L1 partition table registration hcall already did that, and it checks against the partition table size. This patch also puts all the partition table size calculations into the same form, using 12 for the architected size field shift and 4 for the shift corresponding to the partition table entry size. Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com> Signed-of-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220123120043.3586018-6-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_mmu_hv.c')
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index b19347fa2076..a2254390e74b 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -266,7 +266,7 @@ int kvmppc_mmu_hv_init(void)
return -EINVAL;
nr_lpids = 1UL << mmu_lpid_bits;
} else {
- nr_lpids = KVM_MAX_NESTED_GUESTS;
+ nr_lpids = 1UL << KVM_MAX_NESTED_GUESTS_SHIFT;
}
if (nr_lpids > KVMPPC_NR_LPIDS)