hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/arch/x86/include/asm/fpu/api.h
....@@ -41,16 +41,25 @@
4141 * fpu->state and set TIF_NEED_FPU_LOAD leaving CPU's FPU registers in
4242 * a random state.
4343 */
44
-static inline void fpregs_lock(void)
44
+static inline unsigned long fpregs_lock(void)
4545 {
46
- preempt_disable();
47
- local_bh_disable();
46
+ if (IS_ENABLED(CONFIG_IRQ_PIPELINE)) {
47
+ return hard_preempt_disable();
48
+ } else {
49
+ preempt_disable();
50
+ local_bh_disable();
51
+ return 0;
52
+ }
4853 }
4954
50
-static inline void fpregs_unlock(void)
55
+static inline void fpregs_unlock(unsigned long flags)
5156 {
52
- local_bh_enable();
53
- preempt_enable();
57
+ if (IS_ENABLED(CONFIG_IRQ_PIPELINE)) {
58
+ hard_preempt_enable(flags);
59
+ } else {
60
+ local_bh_enable();
61
+ preempt_enable();
62
+ }
5463 }
5564
5665 #ifdef CONFIG_X86_DEBUG_FPU
....@@ -64,6 +73,10 @@
6473 */
6574 extern void switch_fpu_return(void);
6675
76
+/* For Dovetail context switching. */
77
+void fpu__suspend_inband(void);
78
+void fpu__resume_inband(void);
79
+
6780 /*
6881 * Query the presence of one or more xfeatures. Works on any legacy CPU as well.
6982 *