diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-12-07 17:15:05 +0100 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-12-08 17:28:37 +0200 |
commit | 24d1b15f72abe3465e871d11cfc9dc34d1aab8b2 (patch) | |
tree | 41cec3e52d2bfad89426244159dab97e1c240f66 /arch/x86/kvm/svm.c | |
parent | 3ea3aa8cf67d3bbe00a19b6a4013d19efa7d0f41 (diff) | |
download | linux-stable-24d1b15f72abe3465e871d11cfc9dc34d1aab8b2.tar.gz linux-stable-24d1b15f72abe3465e871d11cfc9dc34d1aab8b2.tar.bz2 linux-stable-24d1b15f72abe3465e871d11cfc9dc34d1aab8b2.zip |
KVM: SVM: Do not report xsave in supported cpuid
To support xsave properly for the guest the SVM module need
software support for it. As long as this is not present do
not report the xsave as supported feature in cpuid.
As a side-effect this patch moves the bit() helper function
into the x86.h file so that it can be used in svm.c too.
KVM-Stable-Tag.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1ca12298ffc7..b81a9b7c2ca4 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -3494,6 +3494,10 @@ static void svm_cpuid_update(struct kvm_vcpu *vcpu) static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry) { switch (func) { + case 0x00000001: + /* Mask out xsave bit as long as it is not supported by SVM */ + entry->ecx &= ~(bit(X86_FEATURE_XSAVE)); + break; case 0x80000001: if (nested) entry->ecx |= (1 << 2); /* Set SVM bit */ |