summaryrefslogtreecommitdiff
path: root/include/linux/task_work.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2024-07-04 19:03:36 +0200
committerPeter Zijlstra <peterz@infradead.org>2024-07-09 13:26:34 +0200
commit466e4d801cd438a1ab2c8a2cce1bef6b65c31bbb (patch)
tree4608ba4395cb65142ba8974a900a0b9f85bded78 /include/linux/task_work.h
parent058244c683111d44a5de16ac74f19a1754dd7a0c (diff)
task_work: Add TWA_NMI_CURRENT as an additional notify mode.
Adding task_work from NMI context requires the following: - The kasan_record_aux_stack() is not NMU safe and must be avoided. - Using TWA_RESUME is NMI safe. If the NMI occurs while the CPU is in userland then it will continue in userland and not invoke the `work' callback. Add TWA_NMI_CURRENT as an additional notify mode. In this mode skip kasan and use irq_work in hardirq-mode to for needed interrupt. Set TIF_NOTIFY_RESUME within the irq_work callback due to k[ac]san instrumentation in test_and_set_bit() which does not look NMI safe in case of a report. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20240704170424.1466941-3-bigeasy@linutronix.de
Diffstat (limited to 'include/linux/task_work.h')
-rw-r--r--include/linux/task_work.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/task_work.h b/include/linux/task_work.h
index 26b8a47f41fc..cf5e7e891a77 100644
--- a/include/linux/task_work.h
+++ b/include/linux/task_work.h
@@ -18,6 +18,7 @@ enum task_work_notify_mode {
TWA_RESUME,
TWA_SIGNAL,
TWA_SIGNAL_NO_IPI,
+ TWA_NMI_CURRENT,
};
static inline bool task_work_pending(struct task_struct *task)