[kvm-unit-tests PATCH 2/8] x86: nVMX: Load actual GS.base for both guest and host

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

 



Load KUT's actual GS.base on VM-Entry and VM-Exit so that the VMX tests
can access per-cpu data.  A future commit will track xAPIC vs. x2APIC ops
on a per-cpu basis.

Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
 x86/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x86/vmx.c b/x86/vmx.c
index f4fbb94d..756deb38 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -1209,7 +1209,7 @@ static void init_vmcs_host(void)
 	vmcs_write(HOST_BASE_GDTR, gdt_descr.base);
 	vmcs_write(HOST_BASE_IDTR, idt_descr.base);
 	vmcs_write(HOST_BASE_FS, 0);
-	vmcs_write(HOST_BASE_GS, 0);
+	vmcs_write(HOST_BASE_GS, rdmsr(MSR_GS_BASE));
 
 	/* Set other vmcs area */
 	vmcs_write(PF_ERROR_MASK, 0);
@@ -1261,7 +1261,7 @@ static void init_vmcs_guest(void)
 	vmcs_write(GUEST_BASE_SS, 0);
 	vmcs_write(GUEST_BASE_DS, 0);
 	vmcs_write(GUEST_BASE_FS, 0);
-	vmcs_write(GUEST_BASE_GS, 0);
+	vmcs_write(GUEST_BASE_GS, rdmsr(MSR_GS_BASE));
 	vmcs_write(GUEST_BASE_TR, get_gdt_entry_base(tss_descr));
 	vmcs_write(GUEST_BASE_LDTR, 0);
 
-- 
2.35.0.rc0.227.g00780c9af4-goog




[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