Skip to content

Commit

Permalink
kvm: selftests: vcpu_setup: set cr4.osfxsr
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Jones authored and Paolo Bonzini committed Oct 16, 2018
1 parent 3b8a5df commit 6c93026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/lib/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6c93026

Please sign in to comment.