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: <5if6tsm26vyprchmx2ohki2hkzwur2skjykvqitazvqdlovdua@kouzjteilzsf>
Date: Tue, 18 Mar 2025 15:07:42 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>, 
	"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org, Juergen Gross <jgross@...e.com>, 
	Stefano Stabellini <sstabellini@...nel.org>, "Ahmed S . Darwish" <darwi@...utronix.de>, 
	Andrew Cooper <andrew.cooper3@...rix.com>, John Ogness <john.ogness@...utronix.de>, 
	Peter Zijlstra <peterz@...radead.org>, Borislav Petkov <bp@...en8.de>, 
	Thomas Gleixner <tglx@...utronix.de>, Uros Bizjak <ubizjak@...il.com>
Subject: Re: [PATCH] compiler/gcc: Make asm() templates asm __inline__() by
 default


On Tue, Mar 18, 2025 at 09:11:40PM +0100, Ingo Molnar wrote:
>  #ifdef CONFIG_CC_HAS_ASM_INLINE
>  # define asm_inline __asm__ __inline
>  # define asm(...) asm_inline(__VA_ARGS__)
>  #else
>  # define asm_inline asm
>  #endif

Nice, I'd been wanting to do that for a while.

> And I fixed up the places where this isn't syntactically correct:
> 
>  35 files changed, 82 insertions(+), 79 deletions(-)
> 
> I haven't looked at code generation much yet, but text size changes are 
> minimal:
> 
>       text	   data	    bss	     dec	    hex	filename
>   29429076	7931870	1401196	38762142	24f769e	vmlinux.before
>   29429631	7931870	1401200	38762701	24f78cd	vmlinux.after
> 
> Which is promising, assuming I haven't messed up anywhere.

Unfortunately "size" can be misleading:

  - Inexplicably, "text" includes a lot of non-executable sections, many
    of which have sizes which are directly affected by actual .text
    changes.

  - CONFIG_MITIGATION_SRSO adds ~2MB padding between entry code and the
    rest of the runtime text, though this is not much of a concern for
    comparing apples to apples as it only hides the size of the entry
    text which is tiny.

This was discussed before (and yes "objtool size" would be nice
someday).

  https://lore.kernel.org/20231012013507.jrqnm35p7az6atov@treble

I think this should work decently enough:

  $ readelf -WS vmlinux | grep " .text" | sed 's/\[ //' | awk '{printf("0x%s\n", $6)}'
  0x5588b08

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ