sched: Add task_work callback for paranoid L1D flush
authorBalbir Singh <sblbir@amazon.com>
Mon, 26 Apr 2021 19:59:11 +0000 (21:59 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 28 Jul 2021 09:42:24 +0000 (11:42 +0200)
commit58e106e725eed59896b9141a1c9a917d2f67962a
treeed070e440c19cd31bd32342673065af6b48f636d
parent371b09c6fdc436f2c7bb67fc90df5eec8ce90f06
sched: Add task_work callback for paranoid L1D flush

The upcoming paranoid L1D flush infrastructure allows to conditionally
(opt-in) flush L1D in switch_mm() as a defense against potential new side
channels or for paranoia reasons. As the flush makes only sense when a task
runs on a non-SMT enabled core, because SMT siblings share L1, the
switch_mm() logic will kill a task which is flagged for L1D flush when it
is running on a SMT thread.

Add a taskwork callback so switch_mm() can queue a SIG_KILL command which
is invoked when the task tries to return to user space.

Signed-off-by: Balbir Singh <sblbir@amazon.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210108121056.21940-1-sblbir@amazon.com
arch/Kconfig
include/linux/sched.h