diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2018-10-08 14:24:30 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2018-10-09 16:14:54 +1100 |
commit | 901f8c3f6feb0225c14b3bc6237850fb921d2f2d (patch) | |
tree | d9f4edd5ed3899d8270b329990292ba5b52079d4 /arch/powerpc/kvm | |
parent | aa069a996951f3e2e38437ef0316685a5893fc7e (diff) | |
download | linux-901f8c3f6feb0225c14b3bc6237850fb921d2f2d.tar.gz linux-901f8c3f6feb0225c14b3bc6237850fb921d2f2d.tar.bz2 linux-901f8c3f6feb0225c14b3bc6237850fb921d2f2d.zip |
KVM: PPC: Book3S HV: Add NO_HASH flag to GET_SMMU_INFO ioctl result
This adds a KVM_PPC_NO_HASH flag to the flags field of the
kvm_ppc_smmu_info struct, and arranges for it to be set when
running as a nested hypervisor, as an unambiguous indication
to userspace that HPT guests are not supported. Reporting the
KVM_CAP_PPC_MMU_HASH_V3 capability as false could be taken as
indicating only that the new HPT features in ISA V3.0 are not
supported, leaving it ambiguous whether pre-V3.0 HPT features
are supported.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 89bcf923d542..788bc61bd08c 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -4257,6 +4257,10 @@ static int kvm_vm_ioctl_get_smmu_info_hv(struct kvm *kvm, kvmppc_add_seg_page_size(&sps, 16, SLB_VSID_L | SLB_VSID_LP_01); kvmppc_add_seg_page_size(&sps, 24, SLB_VSID_L); + /* If running as a nested hypervisor, we don't support HPT guests */ + if (kvmhv_on_pseries()) + info->flags |= KVM_PPC_NO_HASH; + return 0; } |