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: <20251211010606.GBaToY_vclqaqkX2xs@renoirsky.local>
Date: Thu, 11 Dec 2025 02:06:06 +0100
From: Borislav Petkov <bp@...en8.de>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 0/8] objtool, x86/alternative: Convert objtool
 annotations and x86 alternatives to assembler macros

On Sat, Dec 06, 2025 at 01:41:07PM -0800, Josh Poimboeuf wrote:
> Convert objtool annotations and x86 alternatives to assembler macros.
> This creates a shared C/asm alternative implementation and makes the
> code generation significantly more readable.

I don't understand: all this churn for that?

So that .s output - which is looked at by 3 people on this planet - is "readable"?

Dunno, it was readable before too...

> Patches 1-5: convert objtool
> Patches 6-8: convert alternatives
> 
> Based on tip/master.
> 
> Before:
> -----
>   # ./arch/x86/include/asm/smap.h:47: 	alternative("", "stac", X86_FEATURE_SMAP);
>   # 47 "./arch/x86/include/asm/smap.h" 1
>   	# ALT: oldinstr
>   771:
> 
>   772:
>   # ALT: padding

... especially with those helpful comments...

>   .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90
>   773:
>   .pushsection .altinstructions, "aM", @progbits, 14
>    .long 771b - .
>    .long 774f - .
>    .4byte ( 9*32+20)
>    .byte 773b-771b
>    .byte 775f-774f
>   .popsection
>   .pushsection .altinstr_replacement, "ax"
>   .pushsection .discard.annotate_data, "M", @progbits, 8; .long 1b - ., 1; .popsection
>   # ALT: replacement
>   774:
>   	stac
>   775:
>   .popsection
> -----
> 
> After:
> -----
>   # ./arch/x86/include/asm/smap.h:47: 	alternative("", "stac", X86_FEATURE_SMAP);
>   # 47 "./arch/x86/include/asm/smap.h" 1
> 	ALTERNATIVE "", "stac", "( 9*32+20)"

Well, that's "readable" but one still needs to go see that ALTERNATIVE
macro definition now, right?

So you move the gory details somewhere else.

Sorry, I fail to see why we're doing this...

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ