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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c2bee816a4a44d55951ca839fea0a6dd@AcuMS.aculab.com>
Date: Sat, 9 Nov 2024 09:49:03 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Haris Okanovic' <harisokn@...zon.com>, "ankur.a.arora@...cle.com"
	<ankur.a.arora@...cle.com>, "catalin.marinas@....com"
	<catalin.marinas@....com>
CC: "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "will@...nel.org" <will@...nel.org>,
	"tglx@...utronix.de" <tglx@...utronix.de>, "mingo@...hat.com"
	<mingo@...hat.com>, "bp@...en8.de" <bp@...en8.de>,
	"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>, "x86@...nel.org"
	<x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>, "pbonzini@...hat.com"
	<pbonzini@...hat.com>, "wanpengli@...cent.com" <wanpengli@...cent.com>,
	"vkuznets@...hat.com" <vkuznets@...hat.com>, "rafael@...nel.org"
	<rafael@...nel.org>, "daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
	"peterz@...radead.org" <peterz@...radead.org>, "arnd@...db.de"
	<arnd@...db.de>, "lenb@...nel.org" <lenb@...nel.org>, "mark.rutland@....com"
	<mark.rutland@....com>, "mtosatti@...hat.com" <mtosatti@...hat.com>,
	"sudeep.holla@....com" <sudeep.holla@....com>, "cl@...two.org"
	<cl@...two.org>, "misono.tomohiro@...itsu.com" <misono.tomohiro@...itsu.com>,
	"maobibo@...ngson.cn" <maobibo@...ngson.cn>, "joao.m.martins@...cle.com"
	<joao.m.martins@...cle.com>, "boris.ostrovsky@...cle.com"
	<boris.ostrovsky@...cle.com>, "konrad.wilk@...cle.com"
	<konrad.wilk@...cle.com>
Subject: RE: [PATCH 2/5] arm64: add __READ_ONCE_EX()

From: Haris Okanovic
> Sent: 05 November 2024 18:31
> 
> Perform an exclusive load, which atomically loads a word and arms the
> exclusive monitor to enable wfet()/wfe() accelerated polling.
> 
...
> +	atomic ? (typeof(*__x))__u.__val : (*(volatile typeof(__x))__x);\

That doesn't do what you want it to do.
(It is wrong in READ_ONCE() as well.)

?: is treated like an arithmetic operator and the result will get
promoted to 'int'.
Moving the first cast outside the ?: probably works:
	(typeof(*__x))(atomic ? __u.__val : (*(volatile typeof(__x))__x));

   David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ