KVM: PPC: Book3S Nested: Use explicit 4096 LPID maximum
authorNicholas Piggin <npiggin@gmail.com>
Sun, 23 Jan 2022 12:00:42 +0000 (22:00 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 13 May 2022 11:33:34 +0000 (21:33 +1000)
commit03a2e65f54b3acae37f0992133d2f4d1d35f4200
tree4e848485de0827fb0ce6293835d98990ea99eb43
parentc0f00a18e2a8c350a9d263aaf9a2c8bc86caa1b0
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
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_64_mmu_hv.c
arch/powerpc/kvm/book3s_hv_nested.c