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: <56E1B5A2.8050002@linux.intel.com>
Date:	Fri, 11 Mar 2016 01:57:54 +0800
From:	Xiao Guangrong <guangrong.xiao@...ux.intel.com>
To:	Paolo Bonzini <pbonzini@...hat.com>,
	Lan Tianyu <tianyu.lan@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>
Cc:	gleb@...nel.org, mingo@...hat.com, hpa@...or.com, x86@...nel.org,
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: Remove redundant smp_mb() in the
 kvm_mmu_commit_zap_page()



On 03/11/2016 12:04 AM, Paolo Bonzini wrote:
>
>
> On 10/03/2016 16:45, Xiao Guangrong wrote:
>>>
>>>> Compared to smp_load_acquire(), smp_mb() adds an ordering between stores
>>>> and loads.
>>>
>>> Here, the ordering is load-store, hence...
>>
>> Yes, this is why i put smp_mb() in the code. :)
>
> Here is a table of barriers:
>
>
>      '. after|                   |
> before '.   |    load           |    store
> __________'.|___________________|________________________
>              |                   |
>              |  smp_rmb          | smp_load_acquire
> load        |  smp_load_acquire | smp_store_release    XX
>              |  smp_mb           | smp_mb
> ____________|___________________|________________________
>              |                   |
>              |                   | smp_wmb
> store       |  smp_mb           | smp_store_release
>              |                   | smp_mb
>              |                   |
>
> Your case is the one marked with XX, so a smp_load_acquire() is
> enough---and it's preferrable, because it's cheaper than smp_mb() and
> more self-documenting.

Yes, you are right and thank you for pointing it out.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ