Thomas Gleixner
2d99bc055e
x86/speculation: Add prctl() control for indirect branch speculation
commit 9137bb27e6 upstream.
Add the PR_SPEC_INDIRECT_BRANCH option for the PR_GET_SPECULATION_CTRL and
PR_SET_SPECULATION_CTRL prctls to allow fine grained per task control of
indirect branch speculation via STIBP and IBPB.
Invocations:
Check indirect branch speculation status with
- prctl(PR_GET_SPECULATION_CTRL, PR_SPEC_INDIRECT_BRANCH, 0, 0, 0);
Enable indirect branch speculation with
- prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIRECT_BRANCH, PR_SPEC_ENABLE, 0, 0);
Disable indirect branch speculation with
- prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIRECT_BRANCH, PR_SPEC_DISABLE, 0, 0);
Force disable indirect branch speculation with
- prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIRECT_BRANCH, PR_SPEC_FORCE_DISABLE, 0, 0);
See Documentation/userspace-api/spec_ctrl.rst.
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Casey Schaufler <casey.schaufler@intel.com>
Cc: Asit Mallick <asit.k.mallick@intel.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Jon Masters <jcm@redhat.com>
Cc: Waiman Long <longman9394@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Dave Stewart <david.c.stewart@intel.com>
Cc: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20181125185005.866780996@linutronix.de
[bwh: Backported to 4.9:
- Renumber the PFA flags
- Drop changes in tools/include/uapi/linux/prctl.h
- Adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-14 19:19:39 +02:00
..
2017-06-17 06:41:58 +02:00
2017-11-02 09:49:13 +01:00
2016-12-05 19:43:02 -05:00
2018-03-28 18:39:19 +02:00
2016-11-13 12:35:13 -05:00
2016-10-04 14:21:41 -07:00
2016-10-11 15:06:31 -07:00
2016-10-11 15:06:31 -07:00
2017-12-05 11:24:34 +01:00
2016-11-13 00:57:53 -05:00
2018-12-08 13:05:11 +01:00
2016-12-07 10:45:57 +01:00
2018-09-19 22:47:12 +02:00
2018-03-22 09:17:38 +01:00
2017-03-15 10:02:44 +08:00
2019-02-20 10:18:35 +01:00
2016-12-06 10:43:32 -05:00
2019-01-13 10:03:48 +01:00
2017-05-03 08:36:36 -07:00
2016-10-23 15:56:23 -07:00
2018-08-15 18:14:52 +02:00
2019-02-20 10:18:35 +01:00
2017-10-21 17:21:37 +02:00
2018-06-06 16:44:33 +02:00
2017-03-22 12:43:34 +01:00
2018-04-08 12:12:43 +02:00
2019-05-14 19:19:39 +02:00
2018-04-20 08:21:04 +02:00
2018-04-24 09:34:16 +02:00
2017-11-21 09:23:28 +01:00
2016-10-19 11:07:57 -04:00
2018-05-22 16:58:01 +02:00
2018-10-18 09:13:25 +02:00
2017-02-23 17:44:37 +01:00