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: <60e77689-7fed-432d-ab8d-621690e6a323@suse.com>
Date: Thu, 22 Jan 2026 15:21:53 +0100
From: Jan Beulich <jbeulich@...e.com>
To: Uros Bizjak <ubizjak@...il.com>
Cc: Juergen Gross <jgross@...e.com>,
 Stefano Stabellini <sstabellini@...nel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
 xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xen/mcelog: simplify MCE_GETCLEAR_FLAGS using xchg()

On 22.01.2026 15:17, Uros Bizjak wrote:
> The MCE_GETCLEAR_FLAGS ioctl retrieves xen_mcelog.flags while
> atomically clearing it. This was previously implemented using a
> cmpxchg() loop.
> 
> Replace the cmpxchg() loop with a single xchg(), which provides the
> same atomic get-and-clear semantics, avoids retry spinning under
> contention, and simplifies the code.
> 
> The code on x86_64 improves from:
> 
>     186:	8b 15 00 00 00 00    	mov    0x0(%rip),%edx
>     18c:	89 d0                	mov    %edx,%eax
>     18e:	f0 0f b1 0d 00 00 00 	lock cmpxchg %ecx,0x0(%rip)
>     195:	00
>     196:	39 c2                	cmp    %eax,%edx
>     198:	75 ec                	jne    186 <...>
> 
> to just:
> 
>     186:	87 05 00 00 00 00    	xchg   %eax,0x0(%rip)
> 
> No functional change intended.
> 
> Signed-off-by: Uros Bizjak <ubizjak@...il.com>

Reviewed-by: Jan Beulich <jbeulich@...e.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ