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-next>] [day] [month] [year] [list]
Message-ID: <20250731083433.3173437-1-ptesarik@suse.com>
Date: Thu, 31 Jul 2025 10:34:33 +0200
From: Petr Tesarik <ptesarik@...e.com>
To: "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
	x86@...nel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	linux-kernel@...r.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	Petr Tesarik <ptesarik@...e.com>
Subject: [PATCH] x86/tsx: Get the tsx= command line parameter with core_param()

Use core_param() to get the value of the tsx= command line parameter.
Although cmdline_find_option() works fine, the option is 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.

Signed-off-by: Petr Tesarik <ptesarik@...e.com>
---
 arch/x86/kernel/cpu/tsx.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/cpu/tsx.c b/arch/x86/kernel/cpu/tsx.c
index 49782724a943..03e1f28cf9ec 100644
--- a/arch/x86/kernel/cpu/tsx.c
+++ b/arch/x86/kernel/cpu/tsx.c
@@ -156,11 +156,11 @@ static void tsx_dev_mode_disable(void)
 	}
 }
 
+static char *tsx_cmdline_param __initdata;
+core_param(tsx, tsx_cmdline_param, charp, 0);
+
 void __init tsx_init(void)
 {
-	char arg[5] = {};
-	int ret;
-
 	tsx_dev_mode_disable();
 
 	/*
@@ -194,13 +194,12 @@ void __init tsx_init(void)
 		return;
 	}
 
-	ret = cmdline_find_option(boot_command_line, "tsx", arg, sizeof(arg));
-	if (ret >= 0) {
-		if (!strcmp(arg, "on")) {
+	if (tsx_cmdline_param) {
+		if (!strcmp(tsx_cmdline_param, "on")) {
 			tsx_ctrl_state = TSX_CTRL_ENABLE;
-		} else if (!strcmp(arg, "off")) {
+		} else if (!strcmp(tsx_cmdline_param, "off")) {
 			tsx_ctrl_state = TSX_CTRL_DISABLE;
-		} else if (!strcmp(arg, "auto")) {
+		} else if (!strcmp(tsx_cmdline_param, "auto")) {
 			tsx_ctrl_state = x86_get_tsx_auto_mode();
 		} else {
 			tsx_ctrl_state = TSX_CTRL_DISABLE;
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ