Home
last modified time | relevance | path

Searched hist:"891 f1ebf" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/arch/powerpc/kvm/
H A Dbook3s_64_mmu_hv.c891f1ebf Wed Sep 13 01:29:22 CDT 2017 Paul Mackerras <paulus@ozlabs.org> KVM: PPC: Book3S HV: Explicitly disable HPT operations on radix guests

This adds code to make sure that we don't try to access the
non-existent HPT for a radix guest using the htab file for the VM
in debugfs, a file descriptor obtained using the KVM_PPC_GET_HTAB_FD
ioctl, or via the KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} ioctls.

At present nothing bad happens if userspace does access these
interfaces on a radix guest, mostly because kvmppc_hpt_npte()
gives 0 for a radix guest, which in turn is because 1 << -4
comes out as 0 on POWER processors. However, that relies on
undefined behaviour, so it is better to be explicit about not
accessing the HPT for a radix guest.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
891f1ebf Wed Sep 13 01:29:22 CDT 2017 Paul Mackerras <paulus@ozlabs.org> KVM: PPC: Book3S HV: Explicitly disable HPT operations on radix guests

This adds code to make sure that we don't try to access the
non-existent HPT for a radix guest using the htab file for the VM
in debugfs, a file descriptor obtained using the KVM_PPC_GET_HTAB_FD
ioctl, or via the KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} ioctls.

At present nothing bad happens if userspace does access these
interfaces on a radix guest, mostly because kvmppc_hpt_npte()
gives 0 for a radix guest, which in turn is because 1 << -4
comes out as 0 on POWER processors. However, that relies on
undefined behaviour, so it is better to be explicit about not
accessing the HPT for a radix guest.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>