Skip to content

Commit 5efc6fa

Browse files
pa1guptaKAGA-KOKO
authored andcommitted
x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR
/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: 95c5824 ("x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default") Signed-off-by: Pawan Gupta <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Neelima Krishnan <[email protected]> Reviewed-by: Dave Hansen <[email protected]> Reviewed-by: Josh Poimboeuf <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/2529b99546294c893dfa1c89e2b3e46da3369a59.1578685425.git.pawan.kumar.gupta@linux.intel.com
1 parent b3a987b commit 5efc6fa

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

arch/x86/kernel/cpu/tsx.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ void __init tsx_init(void)
115115
tsx_disable();
116116

117117
/*
118-
* tsx_disable() will change the state of the
119-
* RTM CPUID bit. Clear it here since it is now
120-
* expected to be not set.
118+
* tsx_disable() will change the state of the RTM and HLE CPUID
119+
* bits. Clear them here since they are now expected to be not
120+
* set.
121121
*/
122122
setup_clear_cpu_cap(X86_FEATURE_RTM);
123+
setup_clear_cpu_cap(X86_FEATURE_HLE);
123124
} else if (tsx_ctrl_state == TSX_CTRL_ENABLE) {
124125

125126
/*
@@ -131,10 +132,10 @@ void __init tsx_init(void)
131132
tsx_enable();
132133

133134
/*
134-
* tsx_enable() will change the state of the
135-
* RTM CPUID bit. Force it here since it is now
136-
* expected to be set.
135+
* tsx_enable() will change the state of the RTM and HLE CPUID
136+
* bits. Force them here since they are now expected to be set.
137137
*/
138138
setup_force_cpu_cap(X86_FEATURE_RTM);
139+
setup_force_cpu_cap(X86_FEATURE_HLE);
139140
}
140141
}

0 commit comments

Comments
 (0)