Skip to content

Commit ef79970

Browse files
aeglKAGA-KOKO
authored andcommitted
x86/split-lock: Remove unused TIF_SLD bit
Changes to the "warn" mode of split lock handling mean that TIF_SLD is never set. Remove the bit, and the functions that use it. Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b041b52 commit ef79970

File tree

4 files changed

+1
-20
lines changed

4 files changed

+1
-20
lines changed

arch/x86/include/asm/cpu.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ unsigned int x86_model(unsigned int sig);
4343
unsigned int x86_stepping(unsigned int sig);
4444
#ifdef CONFIG_CPU_SUP_INTEL
4545
extern void __init sld_setup(struct cpuinfo_x86 *c);
46-
extern void switch_to_sld(unsigned long tifn);
4746
extern bool handle_user_split_lock(struct pt_regs *regs, long error_code);
4847
extern bool handle_guest_split_lock(unsigned long ip);
4948
extern void handle_bus_lock(struct pt_regs *regs);
5049
u8 get_this_hybrid_cpu_type(void);
5150
#else
5251
static inline void __init sld_setup(struct cpuinfo_x86 *c) {}
53-
static inline void switch_to_sld(unsigned long tifn) {}
5452
static inline bool handle_user_split_lock(struct pt_regs *regs, long error_code)
5553
{
5654
return false;

arch/x86/include/asm/thread_info.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ struct thread_info {
9292
#define TIF_NOCPUID 15 /* CPUID is not accessible in userland */
9393
#define TIF_NOTSC 16 /* TSC is not accessible in userland */
9494
#define TIF_NOTIFY_SIGNAL 17 /* signal notifications exist */
95-
#define TIF_SLD 18 /* Restore split lock detection on context switch */
9695
#define TIF_MEMDIE 20 /* is terminating due to OOM killer */
9796
#define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */
9897
#define TIF_IO_BITMAP 22 /* uses I/O bitmap */
@@ -116,7 +115,6 @@ struct thread_info {
116115
#define _TIF_NOCPUID (1 << TIF_NOCPUID)
117116
#define _TIF_NOTSC (1 << TIF_NOTSC)
118117
#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
119-
#define _TIF_SLD (1 << TIF_SLD)
120118
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
121119
#define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP)
122120
#define _TIF_SPEC_FORCE_UPDATE (1 << TIF_SPEC_FORCE_UPDATE)
@@ -128,7 +126,7 @@ struct thread_info {
128126
/* flags to check in __switch_to() */
129127
#define _TIF_WORK_CTXSW_BASE \
130128
(_TIF_NOCPUID | _TIF_NOTSC | _TIF_BLOCKSTEP | \
131-
_TIF_SSBD | _TIF_SPEC_FORCE_UPDATE | _TIF_SLD)
129+
_TIF_SSBD | _TIF_SPEC_FORCE_UPDATE)
132130

133131
/*
134132
* Avoid calls to __switch_to_xtra() on UP as STIBP is not evaluated.

arch/x86/kernel/cpu/intel.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,18 +1232,6 @@ void handle_bus_lock(struct pt_regs *regs)
12321232
}
12331233
}
12341234

1235-
/*
1236-
* This function is called only when switching between tasks with
1237-
* different split-lock detection modes. It sets the MSR for the
1238-
* mode of the new task. This is right most of the time, but since
1239-
* the MSR is shared by hyperthreads on a physical core there can
1240-
* be glitches when the two threads need different modes.
1241-
*/
1242-
void switch_to_sld(unsigned long tifn)
1243-
{
1244-
sld_update_msr(!(tifn & _TIF_SLD));
1245-
}
1246-
12471235
/*
12481236
* Bits in the IA32_CORE_CAPABILITIES are not architectural, so they should
12491237
* only be trusted if it is confirmed that a CPU model implements a

arch/x86/kernel/process.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,9 +686,6 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
686686
/* Enforce MSR update to ensure consistent state */
687687
__speculation_ctrl_update(~tifn, tifn);
688688
}
689-
690-
if ((tifp ^ tifn) & _TIF_SLD)
691-
switch_to_sld(tifn);
692689
}
693690

694691
/*

0 commit comments

Comments
 (0)