Skip to content

Commit c5e6fc0

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
sched,x86: Allow !PREEMPT_DYNAMIC
Allow building x86 with PREEMPT_DYNAMIC=n, this is needed for PREEMPT_RT as it makes no sense to not have full preemption on PREEMPT_RT. Fixes: 8c98e8cf723c ("preempt/dynamic: Provide preempt_schedule[_notrace]() static calls") Reported-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Mike Galbraith <efault@gmx.de> Link: https://lkml.kernel.org/r/YCK1+JyFNxQnWeXK@hirez.programming.kicks-ass.net
1 parent 4ae7dc9 commit c5e6fc0

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

arch/x86/include/asm/preempt.h

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ extern asmlinkage void preempt_schedule_thunk(void);
110110

111111
#define __preempt_schedule_func preempt_schedule_thunk
112112

113+
extern asmlinkage void preempt_schedule_notrace(void);
114+
extern asmlinkage void preempt_schedule_notrace_thunk(void);
115+
116+
#define __preempt_schedule_notrace_func preempt_schedule_notrace_thunk
117+
118+
#ifdef CONFIG_PREEMPT_DYNAMIC
119+
113120
DECLARE_STATIC_CALL(preempt_schedule, __preempt_schedule_func);
114121

115122
#define __preempt_schedule() \
@@ -118,11 +125,6 @@ do { \
118125
asm volatile ("call " STATIC_CALL_TRAMP_STR(preempt_schedule) : ASM_CALL_CONSTRAINT); \
119126
} while (0)
120127

121-
extern asmlinkage void preempt_schedule_notrace(void);
122-
extern asmlinkage void preempt_schedule_notrace_thunk(void);
123-
124-
#define __preempt_schedule_notrace_func preempt_schedule_notrace_thunk
125-
126128
DECLARE_STATIC_CALL(preempt_schedule_notrace, __preempt_schedule_notrace_func);
127129

128130
#define __preempt_schedule_notrace() \
@@ -131,6 +133,16 @@ do { \
131133
asm volatile ("call " STATIC_CALL_TRAMP_STR(preempt_schedule_notrace) : ASM_CALL_CONSTRAINT); \
132134
} while (0)
133135

134-
#endif
136+
#else /* PREEMPT_DYNAMIC */
137+
138+
#define __preempt_schedule() \
139+
asm volatile ("call preempt_schedule_thunk" : ASM_CALL_CONSTRAINT);
140+
141+
#define __preempt_schedule_notrace() \
142+
asm volatile ("call preempt_schedule_notrace_thunk" : ASM_CALL_CONSTRAINT);
143+
144+
#endif /* PREEMPT_DYNAMIC */
145+
146+
#endif /* PREEMPTION */
135147

136148
#endif /* __ASM_PREEMPT_H */

0 commit comments

Comments
 (0)