diff options
Diffstat (limited to 'arch/x86/kvm/cpuid.h')
-rw-r--r-- | arch/x86/kvm/cpuid.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index a10e46016851..58fc51488828 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h | |||
@@ -24,6 +24,9 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu) | |||
24 | { | 24 | { |
25 | struct kvm_cpuid_entry2 *best; | 25 | struct kvm_cpuid_entry2 *best; |
26 | 26 | ||
27 | if (!static_cpu_has(X86_FEATURE_XSAVE)) | ||
28 | return 0; | ||
29 | |||
27 | best = kvm_find_cpuid_entry(vcpu, 1, 0); | 30 | best = kvm_find_cpuid_entry(vcpu, 1, 0); |
28 | return best && (best->ecx & bit(X86_FEATURE_XSAVE)); | 31 | return best && (best->ecx & bit(X86_FEATURE_XSAVE)); |
29 | } | 32 | } |