aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2018-09-18 19:54:24 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-10-17 00:26:02 +0200
commit6c930268bcc4cef62194daf151097d2b94f67718 (patch)
tree22049c548e5af74ca3432bbe333da3e37cc05986 /tools/testing/selftests/kvm
parentKVM: LAPIC: Tune lapic_timer_advance_ns automatically (diff)
downloadlinux-dev-6c930268bcc4cef62194daf151097d2b94f67718.tar.xz
linux-dev-6c930268bcc4cef62194daf151097d2b94f67718.zip
kvm: selftests: vcpu_setup: set cr4.osfxsr
Guest code may want to call functions that have variable arguments. To do so, we either need to compile with -mno-sse or enable SSE in the VCPUs. As it should be pretty safe to turn on the feature, and -mno-sse would make linking test code with standard libraries difficult, we choose the feature enabling. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm')
-rw-r--r--tools/testing/selftests/kvm/lib/x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/lib/x86.c b/tools/testing/selftests/kvm/lib/x86.c
index a3122f1949a8..bb6c65ebfa77 100644
--- a/tools/testing/selftests/kvm/lib/x86.c
+++ b/tools/testing/selftests/kvm/lib/x86.c
@@ -626,7 +626,7 @@ void vcpu_setup(struct kvm_vm *vm, int vcpuid, int pgd_memslot, int gdt_memslot)
switch (vm->mode) {
case VM_MODE_FLAT48PG:
sregs.cr0 = X86_CR0_PE | X86_CR0_NE | X86_CR0_PG;
- sregs.cr4 |= X86_CR4_PAE;
+ sregs.cr4 |= X86_CR4_PAE | X86_CR4_OSFXSR;
sregs.efer |= (EFER_LME | EFER_LMA | EFER_NX);
kvm_seg_set_unusable(&sregs.ldt);