lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 21 Feb 2020 14:54:42 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/10] KVM: VMX: Clean up vmx_flush_tlb_gva()

Sean Christopherson <sean.j.christopherson@...el.com> writes:

> 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.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> ---
>  arch/x86/kvm/vmx/vmx.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 5372a93e1727..906e9d9aa09e 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -2824,15 +2824,11 @@ static void exit_lmode(struct kvm_vcpu *vcpu)
>  
>  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.
> -	 * But we don't really need a TLB flush in that case anyway, because
> -	 * each VM entry/exit includes an implicit flush when VPID is 0.
> +	 * vpid_sync_vcpu_addr() is a nop if vmx->vpid==0, see the comment in
> +	 * vmx_flush_tlb_guest() for an explanation of why this is ok.

"OK" :-)

>  	 */
> +	vpid_sync_vcpu_addr(to_vmx(vcpu)->vpid, addr);
>  }
>  
>  static void vmx_flush_tlb_guest(struct kvm_vcpu *vcpu)

Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>

-- 
Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ