Skip to content

Commit 6c93026

Browse files
Andrew Jonesbonzini
authored andcommitted
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>
1 parent 3b8a5df commit 6c93026

File tree

1 file changed

+1
-1
lines changed
  • tools/testing/selftests/kvm/lib

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/lib/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ void vcpu_setup(struct kvm_vm *vm, int vcpuid, int pgd_memslot, int gdt_memslot)
626626
switch (vm->mode) {
627627
case VM_MODE_FLAT48PG:
628628
sregs.cr0 = X86_CR0_PE | X86_CR0_NE | X86_CR0_PG;
629-
sregs.cr4 |= X86_CR4_PAE;
629+
sregs.cr4 |= X86_CR4_PAE | X86_CR4_OSFXSR;
630630
sregs.efer |= (EFER_LME | EFER_LMA | EFER_NX);
631631

632632
kvm_seg_set_unusable(&sregs.ldt);

0 commit comments

Comments
 (0)