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] [day] [month] [year] [list]
Message-ID: <540E3D60.2020906@hp.com>
Date:	Mon, 08 Sep 2014 19:36:00 -0400
From:	Waiman Long <waiman.long@...com>
To:	Pranith Kumar <bobby.prani@...il.com>
CC:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Question reg. asm/qrwlock.h

On 09/05/2014 07:45 PM, Pranith Kumar wrote:
> Hi Waiman,
>
> I see that in arch/x86/include/asm/qrwlock.h, there is this snippet within
>
> #ifndef CONFIG_X86_PPRO_FENCE
> #define queue_write_unlock queue_write_unlock
> static inline void queue_write_unlock(struct qrwlock *lock)
> {
>          barrier();
>          ACCESS_ONCE(*(u8 *)&lock->cnts) = 0;
> }
> #endif
>
>
> I've been trying to understand why this special case is necessary for
> PPRO. Could you please explain?
>
> Thanks!

This is related to the memory ordering of the x86 architecture. Modern 
x86 processor has pretty strong memory ordering semantics where only 
stores can be reordered after load. So a barrier() call is a good enough 
memory barrier except for some older x86 processors (Pentium Pro) that 
should have CONFIG_X86_PPRO_FENCE set. In that case, atomic instruction 
like cmpxchg() will be needed to ensure proper memory ordering.

-Longman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ