aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2016-11-23 00:14:07 -0500
committerPaul Mackerras <paulus@ozlabs.org>2016-11-23 22:23:05 -0500
commita8acaece5d88db234d0b82b8692dea15d602f622 (patch)
treedc2dfc2d18e24f94d3567d2254afca82e245eab4
parenta91d5df2b44a0c9b171ac47a48e02e762c8224e9 (diff)
KVM: PPC: Correctly report KVM_CAP_PPC_ALLOC_HTAB
At present KVM on powerpc always reports KVM_CAP_PPC_ALLOC_HTAB as enabled. However, the ioctl() it advertises (KVM_PPC_ALLOCATE_HTAB) only actually works on KVM HV. On KVM PR it will fail with ENOTTY. QEMU already has a workaround for this, so it's not breaking things in practice, but it would be better to advertise this correctly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-rw-r--r--arch/powerpc/kvm/powerpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index b5e470571470..efd1183a6b16 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -536,7 +536,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
536#ifdef CONFIG_PPC_BOOK3S_64 536#ifdef CONFIG_PPC_BOOK3S_64
537 case KVM_CAP_SPAPR_TCE: 537 case KVM_CAP_SPAPR_TCE:
538 case KVM_CAP_SPAPR_TCE_64: 538 case KVM_CAP_SPAPR_TCE_64:
539 case KVM_CAP_PPC_ALLOC_HTAB:
540 case KVM_CAP_PPC_RTAS: 539 case KVM_CAP_PPC_RTAS:
541 case KVM_CAP_PPC_FIXUP_HCALL: 540 case KVM_CAP_PPC_FIXUP_HCALL:
542 case KVM_CAP_PPC_ENABLE_HCALL: 541 case KVM_CAP_PPC_ENABLE_HCALL:
@@ -545,6 +544,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
545#endif 544#endif
546 r = 1; 545 r = 1;
547 break; 546 break;
547
548 case KVM_CAP_PPC_ALLOC_HTAB:
549 r = hv_enabled;
550 break;
548#endif /* CONFIG_PPC_BOOK3S_64 */ 551#endif /* CONFIG_PPC_BOOK3S_64 */
549#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE 552#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
550 case KVM_CAP_PPC_SMT: 553 case KVM_CAP_PPC_SMT: