kvm: x86: Add kvm_x86_ops hook that enables XSAVES for guest
authorWanpeng Li <wanpeng.li@linux.intel.com>
Tue, 2 Dec 2014 11:21:30 +0000 (19:21 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Dec 2014 12:57:16 +0000 (13:57 +0100)
Expose the XSAVES feature to the guest if the kvm_x86_ops say it is
available.

Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/include/asm/vmx.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c

index 2896dbc..0271f6b 100644 (file)
@@ -771,6 +771,7 @@ struct kvm_x86_ops {
                               enum x86_intercept_stage stage);
        void (*handle_external_intr)(struct kvm_vcpu *vcpu);
        bool (*mpx_supported)(void);
+       bool (*xsaves_supported)(void);
 
        int (*check_nested_events)(struct kvm_vcpu *vcpu, bool external_intr);
 
index bcbfade..08dc770 100644 (file)
@@ -69,6 +69,7 @@
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING      0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID          0x00001000
 #define SECONDARY_EXEC_SHADOW_VMCS              0x00004000
+#define SECONDARY_EXEC_XSAVES                  0x00100000
 
 
 #define PIN_BASED_EXT_INTR_MASK                 0x00000001
Simple merge
Simple merge
Simple merge