Commit 7531a359 authored by Pawan Gupta's avatar Pawan Gupta Committed by Thomas Gleixner

x86/tsx: Add "auto" option to the tsx= cmdline parameter

Platforms which are not affected by X86_BUG_TAA may want the TSX feature
enabled. Add "auto" option to the TSX cmdline parameter. When tsx=auto
disable TSX when X86_BUG_TAA is present, otherwise enable TSX.

More details on X86_BUG_TAA can be found here:
https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_abort.html

 [ bp: Extend the arg buffer to accommodate "auto\0". ]
Signed-off-by: default avatarPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarTony Luck <tony.luck@intel.com>
Reviewed-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
parent e1d38b63
...@@ -4869,6 +4869,9 @@ ...@@ -4869,6 +4869,9 @@
update. This new MSR allows for the reliable update. This new MSR allows for the reliable
deactivation of the TSX functionality.) deactivation of the TSX functionality.)
auto - Disable TSX if X86_BUG_TAA is present,
otherwise enable TSX on the system.
Not specifying this option is equivalent to tsx=off. Not specifying this option is equivalent to tsx=off.
See Documentation/admin-guide/hw-vuln/tsx_async_abort.rst See Documentation/admin-guide/hw-vuln/tsx_async_abort.rst
......
...@@ -75,7 +75,7 @@ static bool __init tsx_ctrl_is_supported(void) ...@@ -75,7 +75,7 @@ static bool __init tsx_ctrl_is_supported(void)
void __init tsx_init(void) void __init tsx_init(void)
{ {
char arg[4] = {}; char arg[5] = {};
int ret; int ret;
if (!tsx_ctrl_is_supported()) if (!tsx_ctrl_is_supported())
...@@ -87,6 +87,11 @@ void __init tsx_init(void) ...@@ -87,6 +87,11 @@ void __init tsx_init(void)
tsx_ctrl_state = TSX_CTRL_ENABLE; tsx_ctrl_state = TSX_CTRL_ENABLE;
} else if (!strcmp(arg, "off")) { } else if (!strcmp(arg, "off")) {
tsx_ctrl_state = TSX_CTRL_DISABLE; tsx_ctrl_state = TSX_CTRL_DISABLE;
} else if (!strcmp(arg, "auto")) {
if (boot_cpu_has_bug(X86_BUG_TAA))
tsx_ctrl_state = TSX_CTRL_DISABLE;
else
tsx_ctrl_state = TSX_CTRL_ENABLE;
} else { } else {
tsx_ctrl_state = TSX_CTRL_DISABLE; tsx_ctrl_state = TSX_CTRL_DISABLE;
pr_err("tsx: invalid option, defaulting to off\n"); pr_err("tsx: invalid option, defaulting to off\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment