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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250309094613.50e930de@pumpkin>
Date: Sun, 9 Mar 2025 09:46:13 +0000
From: David Laight <david.laight.linux@...il.com>
To: Uros Bizjak <ubizjak@...il.com>
Cc: "H. Peter Anvin" <hpa@...or.com>, Dave Hansen <dave.hansen@...el.com>,
 x86@...nel.org, linux-kernel@...r.kernel.org, Peter Zijlstra
 <peterz@...radead.org>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar
 <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>, Dave Hansen
 <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic
 locking insns

On Sun, 9 Mar 2025 08:50:08 +0100
Uros Bizjak <ubizjak@...il.com> wrote:

> On Sat, Mar 8, 2025 at 8:08 PM H. Peter Anvin <hpa@...or.com> wrote:
...
> > In fact, I would wonder if we shouldn't simply do:
> >
> > #define asm __asm__ __inline__
> > #define asm_noinline __asm__
> >
> > ... in other words, to make asm inline an opt-out instead of an opt-in.

The asm statements themselves get inlined (typically they are in an
always_inline wrapper), the size affects whether the calling code is inlined.
You are now in the 'games' of I$ fetches, overall code size and TLB lookups
(not helped by the speculative execution mitigations for 'ret').

> > It is comparatively unusual that we do complex things in inline assembly
> > that we would want gcc to treat as something that should be avoided.
> 
> I don't think we need such radical changes. There are only a few
> groups of instructions, nicely hidden behind macros, that need asm
> noinline. Alternatives (gcc counted them as 20 - 23 instructions) are
> already using asm inline (please see
> arch/x86/include/asm/alternative.h) in their high-level macros, and my
> proposed patch converts all asm using LOCK_PREFIX by amending macros
> in 7 header files.

The other ones that are likely to get mis-sized are the ones that change
the section to add annotations.
The size overestimate may be better in order to reduce the number of
annotations?

	David



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ