]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/tsx: Get the tsx= command line parameter with early_param()
authorPetr Tesarik <ptesarik@suse.com>
Wed, 22 Oct 2025 10:26:13 +0000 (12:26 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 24 Oct 2025 16:35:17 +0000 (18:35 +0200)
commite9cc99142a145efc04b7fb871c2e19bffee2729c
treed0bc4f53e823c410019be7466f1d346d6d5b952a
parentf018fca8f90bc383fefd97e3b2db03ea612ac789
x86/tsx: Get the tsx= command line parameter with early_param()

Use early_param() to get the value of the tsx= command line parameter. It is
an early parameter, because it must be parsed before tsx_init(), which is
called long before kernel_init(), where normal parameters are parsed.

Although cmdline_find_option() from tsx_init() works fine, the option is later
reported as unknown and passed to user space. The latter is not a real issue,
but the former is confusing and makes people wonder if the tsx= parameter had
any effect and double-check for typos unnecessarily.

The behavior changes slightly if "tsx" is given without any argument (which is
invalid syntax). Until now, the kernel logged an error message and disabled
TSX. Now, the kernel still issues a warning (Malformed early option 'tsx'),
but TSX state is unchanged. The new behavior is consistent with other
parameters, e.g. "tsx_async_abort".

   [ bp: Fixup minor formatting request during review. ]

Suggested-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/all/cover.1758906115.git.ptesarik@suse.com
arch/x86/kernel/cpu/tsx.c