[PATCH kvm-unit-tests] x86: load 64-bit segments into the segment registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kvm-unit-tests was keeping DS/ES/FS/GS loaded with the segment descriptors
provided by the multiboot boot loader (which are 32-bit), and instead loading
SS with 0.  The vmx.flat test failed because KVM did not like doing writes
into such an SS.

Load again the segment registers after entering 64-bit mode, for both
the BSP and the APs.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 x86/cstart64.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/x86/cstart64.S b/x86/cstart64.S
index 8d0d95d..8d5ee2d 100644
--- a/x86/cstart64.S
+++ b/x86/cstart64.S
@@ -213,7 +213,11 @@ idt_descr:
 
 load_tss:
 	lidtq idt_descr
-	mov $0, %eax
+	mov $0x10, %eax
+	mov %ax, %ds
+	mov %ax, %es
+	mov %ax, %fs
+	mov %ax, %gs
 	mov %ax, %ss
 	mov $(APIC_DEFAULT_PHYS_BASE + APIC_ID), %eax
 	mov (%rax), %eax
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux