Skip to content

Commit 9b3661c

Browse files
bp3tk0vKAGA-KOKO
authored andcommitted
x86/CPU: Call detect_nopl() only on the BSP
Make it use the setup_* variants and have it be called only on the BSP and drop the call in generic_identify() - X86_FEATURE_NOPL will be replicated to the APs through the forced caps. Helps to keep the mess at a manageable level. Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Pavel Tatashin <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 8990cac commit 9b3661c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

arch/x86/kernel/cpu/common.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,12 +1024,12 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
10241024
* unless we can find a reliable way to detect all the broken cases.
10251025
* Enable it explicitly on 64-bit for non-constant inputs of cpu_has().
10261026
*/
1027-
static void detect_nopl(struct cpuinfo_x86 *c)
1027+
static void detect_nopl(void)
10281028
{
10291029
#ifdef CONFIG_X86_32
1030-
clear_cpu_cap(c, X86_FEATURE_NOPL);
1030+
setup_clear_cpu_cap(X86_FEATURE_NOPL);
10311031
#else
1032-
set_cpu_cap(c, X86_FEATURE_NOPL);
1032+
setup_force_cpu_cap(X86_FEATURE_NOPL);
10331033
#endif
10341034
}
10351035

@@ -1108,7 +1108,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
11081108
if (!pgtable_l5_enabled())
11091109
setup_clear_cpu_cap(X86_FEATURE_LA57);
11101110

1111-
detect_nopl(c);
1111+
detect_nopl();
11121112
}
11131113

11141114
void __init early_cpu_init(void)
@@ -1206,8 +1206,6 @@ static void generic_identify(struct cpuinfo_x86 *c)
12061206

12071207
get_model_name(c); /* Default name */
12081208

1209-
detect_nopl(c);
1210-
12111209
detect_null_seg_behavior(c);
12121210

12131211
/*

0 commit comments

Comments
 (0)