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]
Message-ID: <2ab49b6e-59d1-1b1f-b533-85e5bc49dd85@redhat.com>
Date:   Mon, 1 Oct 2018 17:25:54 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Tianyu Lan <Tianyu.Lan@...rosoft.com>
Cc:     KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "hpa@...or.com" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>,
        "rkrcmar@...hat.com" <rkrcmar@...hat.com>,
        "devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>,
        vkuznets <vkuznets@...hat.com>,
        Jork Loeser <Jork.Loeser@...rosoft.com>
Subject: Re: [PATCH V3 2/13] KVM/MMU: Add tlb flush with range helper function

On 27/09/2018 05:48, Tianyu Lan wrote:
> +
> +	if (range && kvm_x86_ops->tlb_remote_flush_with_range) {
> +		/*
> +		 * Read tlbs_dirty before flushing tlbs in order
> +		 * to track dirty tlbs during flushing.
> +		 */
> +		long dirty_count = smp_load_acquire(&kvm->tlbs_dirty);
> +
> +		ret = kvm_x86_ops->tlb_remote_flush_with_range(kvm, range);
> +		cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);

This is wrong, because it's not the entire TLB that is flushed.  So you
cannot do the cmpxchg here.

Paolo

> +
> +	if (ret)
> +		kvm_flush_remote_tlbs(kvm);
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ