[06/11] KVM: nVMX: remove a misleading comment regarding vmcs02 fields
diff mbox series

Message ID 20180723193250.13555-7-sean.j.christopherson@intel.com
State New
Headers show
Series
  • KVM: vmx: optimize VMWRITEs to host FS/GS fields
Related show

Commit Message

Sean Christopherson July 23, 2018, 7:32 p.m. UTC
prepare_vmcs02() has an odd comment that says certain fields are
"not in vmcs02".  AFAICT the intent of the comment is to document
that various VMCS fields are not handled by prepare_vmcs02(),
e.g. HOST_{FS,GS}_{BASE,SELECTOR}.  While technically true, the
comment is misleading, e.g. it can lead the reader to think that
KVM never writes those fields to vmcs02.

Remove the comment altogether as the handling of FS and GS is
not specific to nested VMX, and GUEST_PML_INDEX has been written
by prepare_vmcs02() since commit "4e59516a12a6 (kvm: vmx: ensure
VMCS is current while enabling PML)"

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kvm/vmx.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Peter Shier July 24, 2018, 10:39 p.m. UTC | #1
On Mon, Jul 23, 2018 at 12:33 PM Sean Christopherson
<sean.j.christopherson@intel.com> wrote:
>
> prepare_vmcs02() has an odd comment that says certain fields are
> "not in vmcs02".  AFAICT the intent of the comment is to document
> that various VMCS fields are not handled by prepare_vmcs02(),
> e.g. HOST_{FS,GS}_{BASE,SELECTOR}.  While technically true, the
> comment is misleading, e.g. it can lead the reader to think that
> KVM never writes those fields to vmcs02.
>
> Remove the comment altogether as the handling of FS and GS is
> not specific to nested VMX, and GUEST_PML_INDEX has been written
> by prepare_vmcs02() since commit "4e59516a12a6 (kvm: vmx: ensure
> VMCS is current while enabling PML)"
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

Reviewed-by: Peter Shier <pshier@google.com>
Tested-by: Peter Shier <pshier@google.com>

Patch
diff mbox series

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 91e50e649fac..5e884ad3ec51 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -11340,11 +11340,6 @@  static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
 	vmcs_writel(GUEST_ES_BASE, vmcs12->guest_es_base);
 	vmcs_writel(GUEST_CS_BASE, vmcs12->guest_cs_base);
 
-	/*
-	 * Not in vmcs02: GUEST_PML_INDEX, HOST_FS_SELECTOR, HOST_GS_SELECTOR,
-	 * HOST_FS_BASE, HOST_GS_BASE.
-	 */
-
 	if (vmx->nested.nested_run_pending &&
 	    (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) {
 		kvm_set_dr(vcpu, 7, vmcs12->guest_dr7);