KVM: PPC: Book3S HV: XIVE: Activate XIVE exploitation mode
authorCédric Le Goater <clg@kaod.org>
Thu, 18 Apr 2019 10:39:40 +0000 (12:39 +0200)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 30 Apr 2019 09:35:16 +0000 (19:35 +1000)
Full support for the XIVE native exploitation mode is now available,
advertise the capability KVM_CAP_PPC_IRQ_XIVE for guests running on
PowerNV KVM Hypervisors only. Support for nested guests (pseries KVM
Hypervisor) is not yet available. XIVE should also have been activated
which is default setting on POWER9 systems running a recent Linux
kernel.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/powerpc.c

index b0858ee6146046ed4a51a71d4835d4509c064981..f54926c78320a35f82f8120ca3f5d9768bad6fdb 100644 (file)
@@ -573,10 +573,11 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 #ifdef CONFIG_KVM_XIVE
        case KVM_CAP_PPC_IRQ_XIVE:
                /*
-                * Return false until all the XIVE infrastructure is
-                * in place including support for migration.
+                * We need XIVE to be enabled on the platform (implies
+                * a POWER9 processor) and the PowerNV platform, as
+                * nested is not yet supported.
                 */
-               r = 0;
+               r = xive_enabled() && !!cpu_has_feature(CPU_FTR_HVMODE);
                break;
 #endif