aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/svm.c3
-rw-r--r--arch/x86/kvm/x86.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index db5021b2b5a8..1c4a018bf4bb 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -417,6 +417,9 @@ static __init int svm_hardware_setup(void)
417 if (boot_cpu_has(X86_FEATURE_NX)) 417 if (boot_cpu_has(X86_FEATURE_NX))
418 kvm_enable_efer_bits(EFER_NX); 418 kvm_enable_efer_bits(EFER_NX);
419 419
420 if (boot_cpu_has(X86_FEATURE_FXSR_OPT))
421 kvm_enable_efer_bits(EFER_FFXSR);
422
420 if (nested) { 423 if (nested) {
421 printk(KERN_INFO "kvm: Nested Virtualization enabled\n"); 424 printk(KERN_INFO "kvm: Nested Virtualization enabled\n");
422 kvm_enable_efer_bits(EFER_SVME); 425 kvm_enable_efer_bits(EFER_SVME);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 32e3a7ec6ad2..8f83590b47dd 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -490,6 +490,17 @@ static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
490 return; 490 return;
491 } 491 }
492 492
493 if (efer & EFER_FFXSR) {
494 struct kvm_cpuid_entry2 *feat;
495
496 feat = kvm_find_cpuid_entry(vcpu, 0x80000001, 0);
497 if (!feat || !(feat->edx & bit(X86_FEATURE_FXSR_OPT))) {
498 printk(KERN_DEBUG "set_efer: #GP, enable FFXSR w/o CPUID capability\n");
499 kvm_inject_gp(vcpu, 0);
500 return;
501 }
502 }
503
493 if (efer & EFER_SVME) { 504 if (efer & EFER_SVME) {
494 struct kvm_cpuid_entry2 *feat; 505 struct kvm_cpuid_entry2 *feat;
495 506
@@ -1240,6 +1251,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1240#ifdef CONFIG_X86_64 1251#ifdef CONFIG_X86_64
1241 bit(X86_FEATURE_LM) | 1252 bit(X86_FEATURE_LM) |
1242#endif 1253#endif
1254 bit(X86_FEATURE_FXSR_OPT) |
1243 bit(X86_FEATURE_MMXEXT) | 1255 bit(X86_FEATURE_MMXEXT) |
1244 bit(X86_FEATURE_3DNOWEXT) | 1256 bit(X86_FEATURE_3DNOWEXT) |
1245 bit(X86_FEATURE_3DNOW); 1257 bit(X86_FEATURE_3DNOW);