diff options
author | Wanpeng Li <wanpeng.li@linux.intel.com> | 2014-12-02 19:21:30 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-12-05 13:57:16 +0100 |
commit | 55412b2eda2b783ef37316eb06ba91fa63ae049d (patch) | |
tree | 8eff0de0c34eacb8f9dbb989c4d64e8a5c3cf2c5 /arch/x86/kvm/vmx.c | |
parent | 5c404cabd1b5c125653ac573cb9284bdf42b658a (diff) | |
download | lwn-55412b2eda2b783ef37316eb06ba91fa63ae049d.tar.gz lwn-55412b2eda2b783ef37316eb06ba91fa63ae049d.zip |
kvm: x86: Add kvm_x86_ops hook that enables XSAVES for guest
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>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6a951d823c82..dd4fa461454a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -7553,6 +7553,12 @@ static bool vmx_mpx_supported(void) (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_BNDCFGS); } +static bool vmx_xsaves_supported(void) +{ + return vmcs_config.cpu_based_2nd_exec_ctrl & + SECONDARY_EXEC_XSAVES; +} + static void vmx_recover_nmi_blocking(struct vcpu_vmx *vmx) { u32 exit_intr_info; @@ -9329,6 +9335,7 @@ static struct kvm_x86_ops vmx_x86_ops = { .check_intercept = vmx_check_intercept, .handle_external_intr = vmx_handle_external_intr, .mpx_supported = vmx_mpx_supported, + .xsaves_supported = vmx_xsaves_supported, .check_nested_events = vmx_check_nested_events, |