hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/arch/x86/include/asm/fpu/api.h
....@@ -28,7 +28,6 @@
2828 extern void kernel_fpu_end(void);
2929 extern bool irq_fpu_usable(void);
3030 extern void fpregs_mark_activate(void);
31
-extern void kernel_fpu_resched(void);
3231
3332 /* Code that is unaware of kernel_fpu_begin_mask() can use this */
3433 static inline void kernel_fpu_begin(void)
....@@ -41,32 +40,17 @@
4140 * A context switch will (and softirq might) save CPU's FPU registers to
4241 * fpu->state and set TIF_NEED_FPU_LOAD leaving CPU's FPU registers in
4342 * a random state.
44
- *
45
- * local_bh_disable() protects against both preemption and soft interrupts
46
- * on !RT kernels.
47
- *
48
- * On RT kernels local_bh_disable() is not sufficient because it only
49
- * serializes soft interrupt related sections via a local lock, but stays
50
- * preemptible. Disabling preemption is the right choice here as bottom
51
- * half processing is always in thread context on RT kernels so it
52
- * implicitly prevents bottom half processing as well.
53
- *
54
- * Disabling preemption also serializes against kernel_fpu_begin().
5543 */
5644 static inline void fpregs_lock(void)
5745 {
58
- if (!IS_ENABLED(CONFIG_PREEMPT_RT))
59
- local_bh_disable();
60
- else
61
- preempt_disable();
46
+ preempt_disable();
47
+ local_bh_disable();
6248 }
6349
6450 static inline void fpregs_unlock(void)
6551 {
66
- if (!IS_ENABLED(CONFIG_PREEMPT_RT))
67
- local_bh_enable();
68
- else
69
- preempt_enable();
52
+ local_bh_enable();
53
+ preempt_enable();
7054 }
7155
7256 #ifdef CONFIG_X86_DEBUG_FPU