Commit ad104b5e authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: VMX: Clean up vmx_flush_tlb_gva()

Refactor vmx_flush_tlb_gva() to remove a superfluous local variable and
clean up its comment, which is oddly located below the code it is
commenting.

No functional change intended.
Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200320212833.3507-16-sean.j.christopherson@intel.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0baedd79
...@@ -2840,15 +2840,11 @@ static void exit_lmode(struct kvm_vcpu *vcpu) ...@@ -2840,15 +2840,11 @@ static void exit_lmode(struct kvm_vcpu *vcpu)
static void vmx_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t addr) static void vmx_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t addr)
{ {
int vpid = to_vmx(vcpu)->vpid;
vpid_sync_vcpu_addr(vpid, addr);
/* /*
* If VPIDs are not supported or enabled, then the above is a no-op. * vpid_sync_vcpu_addr() is a nop if vmx->vpid==0, see the comment in
* But we don't really need a TLB flush in that case anyway, because * vmx_flush_tlb_guest() for an explanation of why this is ok.
* each VM entry/exit includes an implicit flush when VPID is 0.
*/ */
vpid_sync_vcpu_addr(to_vmx(vcpu)->vpid, addr);
} }
static void vmx_flush_tlb_guest(struct kvm_vcpu *vcpu) static void vmx_flush_tlb_guest(struct kvm_vcpu *vcpu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment