Skip to content

Commit 9c92374

Browse files
committed
x86/cpu: Move arch_smt_update() to a neutral place
arch_smt_update() will be used to control IPI/NMI broadcasting via the shorthand mechanism. Keeping it in the bugs file and calling the apic function from there is possible, but not really intuitive. Move it to a neutral place and invoke the bugs function from there. No functional change. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 82e5747 commit 9c92374

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

arch/x86/include/asm/bugs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ int ppro_with_ram_bug(void);
1818
static inline int ppro_with_ram_bug(void) { return 0; }
1919
#endif
2020

21+
extern void cpu_bugs_smt_update(void);
22+
2123
#endif /* _ASM_X86_BUGS_H */

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ static void update_mds_branch_idle(void)
700700

701701
#define MDS_MSG_SMT "MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for more details.\n"
702702

703-
void arch_smt_update(void)
703+
void cpu_bugs_smt_update(void)
704704
{
705705
/* Enhanced IBRS implies STIBP. No update required. */
706706
if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)

arch/x86/kernel/cpu/common.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,3 +1945,12 @@ void microcode_check(void)
19451945
pr_warn("x86/CPU: CPU features have changed after loading microcode, but might not take effect.\n");
19461946
pr_warn("x86/CPU: Please consider either early loading through initrd/built-in or a potential BIOS update.\n");
19471947
}
1948+
1949+
/*
1950+
* Invoked from core CPU hotplug code after hotplug operations
1951+
*/
1952+
void arch_smt_update(void)
1953+
{
1954+
/* Handle the speculative execution misfeatures */
1955+
cpu_bugs_smt_update();
1956+
}

0 commit comments

Comments
 (0)