Commit 8d7d5852 authored by Pawan Gupta's avatar Pawan Gupta Committed by Khalid Elmously

x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR

BugLink: https://bugs.launchpad.net/bugs/1864775

[ Upstream commit 5efc6fa9 ]

/proc/cpuinfo currently reports Hardware Lock Elision (HLE) feature to
be present on boot cpu even if it was disabled during the bootup. This
is because cpuinfo_x86->x86_capability HLE bit is not updated after TSX
state is changed via the new MSR IA32_TSX_CTRL.

Update the cached HLE bit also since it is expected to change after an
update to CPUID_CLEAR bit in MSR IA32_TSX_CTRL.

Fixes: 95c5824f ("x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default")
Signed-off-by: default avatarPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarNeelima Krishnan <neelima.krishnan@intel.com>
Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/2529b99546294c893dfa1c89e2b3e46da3369a59.1578685425.git.pawan.kumar.gupta@linux.intel.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent bb76087a
...@@ -115,11 +115,12 @@ void __init tsx_init(void) ...@@ -115,11 +115,12 @@ void __init tsx_init(void)
tsx_disable(); tsx_disable();
/* /*
* tsx_disable() will change the state of the * tsx_disable() will change the state of the RTM and HLE CPUID
* RTM CPUID bit. Clear it here since it is now * bits. Clear them here since they are now expected to be not
* expected to be not set. * set.
*/ */
setup_clear_cpu_cap(X86_FEATURE_RTM); setup_clear_cpu_cap(X86_FEATURE_RTM);
setup_clear_cpu_cap(X86_FEATURE_HLE);
} else if (tsx_ctrl_state == TSX_CTRL_ENABLE) { } else if (tsx_ctrl_state == TSX_CTRL_ENABLE) {
/* /*
...@@ -131,10 +132,10 @@ void __init tsx_init(void) ...@@ -131,10 +132,10 @@ void __init tsx_init(void)
tsx_enable(); tsx_enable();
/* /*
* tsx_enable() will change the state of the * tsx_enable() will change the state of the RTM and HLE CPUID
* RTM CPUID bit. Force it here since it is now * bits. Force them here since they are now expected to be set.
* expected to be set.
*/ */
setup_force_cpu_cap(X86_FEATURE_RTM); setup_force_cpu_cap(X86_FEATURE_RTM);
setup_force_cpu_cap(X86_FEATURE_HLE);
} }
} }
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