diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2024-09-04 12:15:38 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-09-04 12:15:38 +0200 |
commit | eb876ea724835126f215c9a5bcc9e6148e2a6d15 (patch) | |
tree | 689c215270b023c2f94a6629c7f1d3ef8e49c28a /kernel/task_work.c | |
parent | 2dce993165088dbe728faa21547e3b74213b6732 (diff) | |
parent | 67784a74e258a467225f0e68335df77acd67b7ab (diff) |
Merge branch 'linus' into smp/core
Pull in upstream changes so further patches don't conflict.
Diffstat (limited to 'kernel/task_work.c')
-rw-r--r-- | kernel/task_work.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/task_work.c b/kernel/task_work.c index 5c2daa7ad3f90..5d14d639ac71b 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -6,12 +6,14 @@ static struct callback_head work_exited; /* all we need is ->next == NULL */ +#ifdef CONFIG_IRQ_WORK static void task_work_set_notify_irq(struct irq_work *entry) { test_and_set_tsk_thread_flag(current, TIF_NOTIFY_RESUME); } static DEFINE_PER_CPU(struct irq_work, irq_work_NMI_resume) = IRQ_WORK_INIT_HARD(task_work_set_notify_irq); +#endif /** * task_work_add - ask the @task to execute @work->func() @@ -57,6 +59,8 @@ int task_work_add(struct task_struct *task, struct callback_head *work, if (notify == TWA_NMI_CURRENT) { if (WARN_ON_ONCE(task != current)) return -EINVAL; + if (!IS_ENABLED(CONFIG_IRQ_WORK)) + return -EINVAL; } else { /* record the work call stack in order to print it in KASAN reports */ kasan_record_aux_stack(work); @@ -81,9 +85,11 @@ int task_work_add(struct task_struct *task, struct callback_head *work, case TWA_SIGNAL_NO_IPI: __set_notify_signal(task); break; +#ifdef CONFIG_IRQ_WORK case TWA_NMI_CURRENT: irq_work_queue(this_cpu_ptr(&irq_work_NMI_resume)); break; +#endif default: WARN_ON_ONCE(1); break; |