aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/prctl.h
diff options
context:
space:
mode:
authorBalbir Singh <sblbir@amazon.com>2021-01-08 23:10:55 +1100
committerThomas Gleixner <tglx@linutronix.de>2021-07-28 11:42:25 +0200
commite893bb1bb4d2eb635eba61e5d9c5135d96855773 (patch)
tree5f9ce68517fe8a06ae0dd9220a45ab31a61556df /include/uapi/linux/prctl.h
parentx86/mm: Prepare for opt-in based L1D flush in switch_mm() (diff)
downloadlinux-dev-e893bb1bb4d2eb635eba61e5d9c5135d96855773.tar.xz
linux-dev-e893bb1bb4d2eb635eba61e5d9c5135d96855773.zip
x86, prctl: Hook L1D flushing in via prctl
Use the existing PR_GET/SET_SPECULATION_CTRL API to expose the L1D flush capability. For L1D flushing PR_SPEC_FORCE_DISABLE and PR_SPEC_DISABLE_NOEXEC are not supported. Enabling L1D flush does not check if the task is running on an SMT enabled core, rather a check is done at runtime (at the time of flush), if the task runs on a SMT sibling then the task is sent a SIGBUS which is executed before the task returns to user space or to a guest. This is better than the other alternatives of: a. Ensuring strict affinity of the task (hard to enforce without further changes in the scheduler) b. Silently skipping flush for tasks that move to SMT enabled cores. Hook up the core prctl and implement the x86 specific parts which in turn makes it functional. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Balbir Singh <sblbir@amazon.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20210108121056.21940-5-sblbir@amazon.com
Diffstat (limited to 'include/uapi/linux/prctl.h')
-rw-r--r--include/uapi/linux/prctl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h
index 967d9c55323d..964c41ed303e 100644
--- a/include/uapi/linux/prctl.h
+++ b/include/uapi/linux/prctl.h
@@ -213,6 +213,7 @@ struct prctl_mm_map {
/* Speculation control variants */
# define PR_SPEC_STORE_BYPASS 0
# define PR_SPEC_INDIRECT_BRANCH 1
+# define PR_SPEC_L1D_FLUSH 2
/* Return and control values for PR_SET/GET_SPECULATION_CTRL */
# define PR_SPEC_NOT_AFFECTED 0
# define PR_SPEC_PRCTL (1UL << 0)