Messages in this thread Patch in this message | | | From | Frederic Weisbecker <> | Subject | [PATCH 4/4] arm64: Implement HAVE_PREEMPT_DYNAMIC | Date | Mon, 25 Oct 2021 14:21:02 +0200 |
| |
Provide the static calls for the common preemption points and report arm64 ability to support dynamic preemption.
Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Quentin Perret <qperret@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: James Morse <james.morse@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Ard Biesheuvel <ardb@kernel.org> Cc: David Laight <David.Laight@ACULAB.COM> --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/preempt.h | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 34b175b1e247..24915ca7d6d5 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -191,6 +191,7 @@ config ARM64 select HAVE_PERF_EVENTS select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP + select HAVE_PREEMPT_DYNAMIC select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_STATIC_CALL select HAVE_FUNCTION_ARG_ACCESS_API diff --git a/arch/arm64/include/asm/preempt.h b/arch/arm64/include/asm/preempt.h index 4fbbe644532f..69d1cc491d3b 100644 --- a/arch/arm64/include/asm/preempt.h +++ b/arch/arm64/include/asm/preempt.h @@ -82,15 +82,29 @@ static inline bool should_resched(int preempt_offset) #ifdef CONFIG_PREEMPTION void preempt_schedule(void); -#define __preempt_schedule() preempt_schedule() void preempt_schedule_notrace(void); -#define __preempt_schedule_notrace() preempt_schedule_notrace() -#endif /* CONFIG_PREEMPTION */ #ifdef CONFIG_PREEMPT_DYNAMIC + +#define __preempt_schedule_func preempt_schedule +DECLARE_STATIC_CALL(preempt_schedule, __preempt_schedule_func); +#define __preempt_schedule() static_call(preempt_schedule)() + +#define __preempt_schedule_notrace_func preempt_schedule_notrace +DECLARE_STATIC_CALL(preempt_schedule_notrace, __preempt_schedule_notrace_func); +#define __preempt_schedule_notrace() static_call(preempt_schedule_notrace)() + void arm64_preempt_schedule_irq(void); #define __irqentry_exit_cond_resched_func arm64_preempt_schedule_irq DECLARE_STATIC_CALL(irqentry_exit_cond_resched, __irqentry_exit_cond_resched_func); + +#else /* !CONFIG_PREEMPT_DYNAMIC */ + +#define __preempt_schedule() preempt_schedule() +#define __preempt_schedule_notrace() preempt_schedule_notrace() + #endif /* CONFIG_PREEMPT_DYNAMIC */ +#endif /* CONFIG_PREEMPTION */ + #endif /* __ASM_PREEMPT_H */ -- 2.25.1
| |