All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Sean Christopherson <seanjc@google.com>
Subject: [kvm-unit-tests PATCH 2/8] x86: nVMX: Load actual GS.base for both guest and host
Date: Fri, 21 Jan 2022 23:18:46 +0000	[thread overview]
Message-ID: <20220121231852.1439917-3-seanjc@google.com> (raw)
In-Reply-To: <20220121231852.1439917-1-seanjc@google.com>

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@google.com>
---
 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


  parent reply	other threads:[~2022-01-21 23:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 23:18 [kvm-unit-tests PATCH 0/8] x86: APIC bug fix and cleanup Sean Christopherson
2022-01-21 23:18 ` [kvm-unit-tests PATCH 1/8] x86: Always use legacy xAPIC to get APIC ID during TSS setup Sean Christopherson
2022-01-22  1:18   ` David Matlack
2022-01-21 23:18 ` Sean Christopherson [this message]
2022-01-21 23:18 ` [kvm-unit-tests PATCH 3/8] x86: smp: Replace spaces with tabs Sean Christopherson
2022-01-21 23:18 ` [kvm-unit-tests PATCH 4/8] x86: desc: " Sean Christopherson
2022-01-21 23:18 ` [kvm-unit-tests PATCH 5/8] x86: Add proper helpers for per-cpu reads/writes Sean Christopherson
2022-01-21 23:18 ` [kvm-unit-tests PATCH 6/8] x86: apic: Replace spaces with tabs Sean Christopherson
2022-01-21 23:18 ` [kvm-unit-tests PATCH 7/8] x86: apic: Track APIC ops on a per-cpu basis Sean Christopherson
2022-01-21 23:18 ` [kvm-unit-tests PATCH 8/8] x86: apic: Make xAPIC and I/O APIC pointers static Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220121231852.1439917-3-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.