KVM: arm64: Add a capability to advertise SVE support
authorDave Martin <Dave.Martin@arm.com>
Tue, 15 Jan 2019 12:21:22 +0000 (12:21 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 29 Mar 2019 14:41:54 +0000 (14:41 +0000)
To provide a uniform way to check for KVM SVE support amongst other
features, this patch adds a suitable capability KVM_CAP_ARM_SVE,
and reports it as present when SVE is available.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Tested-by: zhang.lei <zhang.lei@jp.fujitsu.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/reset.c
include/uapi/linux/kvm.h

index 32c5ac0a3872caa2539387576ac05f17bbf4010d..f13378d0a0ad71b4aa3fb4f29eafb67b18df9347 100644 (file)
@@ -98,6 +98,9 @@ int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext)
        case KVM_CAP_ARM_VM_IPA_SIZE:
                r = kvm_ipa_limit;
                break;
+       case KVM_CAP_ARM_SVE:
+               r = system_supports_sve();
+               break;
        default:
                r = 0;
        }
index c3b8e7a31315fb56a0a282eedc46bb4549ccc7ca..1d564445b51560e0967b3c171970dddf405c0c12 100644 (file)
@@ -988,6 +988,7 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_ARM_VM_IPA_SIZE 165
 #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166
 #define KVM_CAP_HYPERV_CPUID 167
+#define KVM_CAP_ARM_SVE 168
 
 #ifdef KVM_CAP_IRQ_ROUTING