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: <20251008102136.GAaOY7MBd4_VBPBNtG@fat_crate.local>
Date: Wed, 8 Oct 2025 12:21:36 +0200
From: Borislav Petkov <bp@...en8.de>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
	"Kaplan, David" <David.Kaplan@....com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	"x86@...nel.org" <x86@...nel.org>,
	"H . Peter Anvin" <hpa@...or.com>,
	Klaus Kusche <klaus.kusche@...puterix.info>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/bugs: Qualify RETBLEED_INTEL_MSG

On Tue, Oct 07, 2025 at 05:14:29PM -0700, Josh Poimboeuf wrote:
> Isn't that what CONFIG_CPU_MITIGATIONS=n already does today?

I'd like =n to mean, code is not compiled in.

We do have some savings:

   text	   data	    bss	    dec	    hex	filename
136442490	9737118		36764336	182943944	ae780c8	vmlinux 	# CONFIG_CPU_MITIGATIONS is not set
138493310	10692818	37741668	186927796	b244ab4	vmlinux		# CONFIG_CPU_MITIGATIONS=y

but look at bugs.o:

# CONFIG_CPU_MITIGATIONS is not set	599K arch/x86/kernel/cpu/bugs.o
# CONFIG_CPU_MITIGATIONS=y		625K arch/x86/kernel/cpu/bugs.o

and those unused 600K still go into vmlinux:

$ readelf -W -s vmlinux | grep cpu_show_
 38058: ffffffff81869d20    27 FUNC    LOCAL  DEFAULT    1 cpu_show_not_affected
 91642: ffffffff81284980    70 FUNC    GLOBAL DEFAULT    1 cpu_show_vmscape
 92944: ffffffff812840f0    68 FUNC    GLOBAL DEFAULT    1 cpu_show_spectre_v1
 93449: ffffffff812847e0    70 FUNC    GLOBAL DEFAULT    1 cpu_show_gds
 96967: ffffffff81869d20    27 FUNC    WEAK   DEFAULT    1 cpu_show_ghostwrite
 99329: ffffffff812843b0    70 FUNC    GLOBAL DEFAULT    1 cpu_show_spec_store_bypass
102119: ffffffff81284830    70 FUNC    GLOBAL DEFAULT    1 cpu_show_reg_file_data_sampling
102618: ffffffff812845b0    56 FUNC    GLOBAL DEFAULT    1 cpu_show_itlb_multihit
102660: ffffffff81284880    85 FUNC    GLOBAL DEFAULT    1 cpu_show_old_microcode
103154: ffffffff812848e0    70 FUNC    GLOBAL DEFAULT    1 cpu_show_indirect_target_selection
103474: ffffffff81284460   164 FUNC    GLOBAL DEFAULT    1 cpu_show_mds
103673: ffffffff81284510   153 FUNC    GLOBAL DEFAULT    1 cpu_show_tsx_async_abort
106613: ffffffff81284930    70 FUNC    GLOBAL DEFAULT    1 cpu_show_tsa
109692: ffffffff81284400    92 FUNC    GLOBAL DEFAULT    1 cpu_show_l1tf
111021: ffffffff81284640   150 FUNC    GLOBAL DEFAULT    1 cpu_show_mmio_stale_data
111165: ffffffff812845f0    70 FUNC    GLOBAL DEFAULT    1 cpu_show_srbds
112332: ffffffff81284090    83 FUNC    GLOBAL DEFAULT    1 cpu_show_meltdown
114213: ffffffff812846e0   174 FUNC    GLOBAL DEFAULT    1 cpu_show_retbleed
114312: ffffffff81284790    70 FUNC    GLOBAL DEFAULT    1 cpu_show_spec_rstack_overflow
118586: ffffffff81284140   619 FUNC    GLOBAL DEFAULT    1 cpu_show_spectre_v2

$ readelf -W -s vmlinux | grep _parse_cmdline
  2575: ffffffff897a0050    27 FUNC    LOCAL  DEFAULT   18 nospectre_v2_parse_cmdline
  2578: ffffffff897a0070    27 FUNC    LOCAL  DEFAULT   18 nossb_parse_cmdline
  2587: ffffffff897a0110    37 FUNC    LOCAL  DEFAULT   18 its_parse_cmdline
  2591: ffffffff897a01d0   138 FUNC    LOCAL  DEFAULT   18 tsx_async_abort_parse_cmdline
  2594: ffffffff897a0260   138 FUNC    LOCAL  DEFAULT   18 mmio_stale_data_parse_cmdline
  2597: ffffffff897a02f0    97 FUNC    LOCAL  DEFAULT   18 rfds_parse_cmdline
  2599: ffffffff897a0360    56 FUNC    LOCAL  DEFAULT   18 srbds_parse_cmdline
  2601: ffffffff897a03a0    38 FUNC    LOCAL  DEFAULT   18 l1d_flush_parse_cmdline
  2603: ffffffff897a03d0    96 FUNC    LOCAL  DEFAULT   18 gds_parse_cmdline
  2604: ffffffff897a0430   166 FUNC    LOCAL  DEFAULT   18 tsa_parse_cmdline
  2606: ffffffff897a04e0   268 FUNC    LOCAL  DEFAULT   18 spectre_v2_user_parse_cmdline
  2608: ffffffff897a05f0   487 FUNC    LOCAL  DEFAULT   18 spectre_v2_parse_cmdline
  2609: ffffffff897a07e0   131 FUNC    LOCAL  DEFAULT   18 spectre_bhi_parse_cmdline
  2611: ffffffff897a0870   206 FUNC    LOCAL  DEFAULT   18 ssb_parse_cmdline
  2613: ffffffff897a0a30   200 FUNC    LOCAL  DEFAULT   18 srso_parse_cmdline
  2615: ffffffff897a0b00   178 FUNC    LOCAL  DEFAULT   18 vmscape_parse_cmdline
  2617: ffffffff897a0bc0   344 FUNC    LOCAL  DEFAULT   18 retbleed_parse_cmdline

and so on...

So I'd like to try to see whether completely axing it off in the =n case
without incurring a lot of ugly ifdeffery, would work.

> Then one only needs to grep their .config file for UGLY to understand
> why their disassembly is so inscrutable ;-)

Not sure about UGLY but if you can come up with a name that says "has impact
on the resulting code and when you have them enabled, you have weird asm
constructs all over the place", sure, why not.

-- 
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