Thomas Gleixner
9137bb27e6
x86/speculation: Add prctl() control for indirect branch speculation
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>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185005.866780996@linutronix.de
2018-11-28 11:57:13 +01:00
..
2018-10-31 10:57:43 -07:00
2018-11-09 17:33:32 +01:00
2018-11-08 17:51:11 +01:00
2018-10-26 10:50:10 -07:00
2018-10-25 17:57:35 -07:00
2018-10-31 16:47:55 -07:00
2018-10-26 07:38:19 -07:00
2018-11-06 17:40:31 +01:00
2018-11-03 13:27:50 +01:00
2018-10-26 08:14:13 -07:00
2018-11-01 08:42:21 -07:00
2018-10-26 07:38:19 -07:00
2018-11-28 11:57:07 +01:00
2018-11-04 08:20:09 -08:00
2018-11-07 13:23:18 +01:00
2018-10-25 06:50:48 -07:00
2018-10-31 19:24:21 +01:00
2018-11-01 19:59:53 -06:00
2018-10-31 08:54:12 -07:00
2018-11-01 19:59:53 -06:00
2018-11-01 19:59:53 -06:00
2018-10-25 11:17:40 -06:00
2018-10-31 16:53:17 -07:00
2018-10-26 16:26:32 -07:00
2018-11-02 11:25:48 -07:00
2018-10-25 11:14:36 -07:00
2018-11-03 23:42:16 +01:00
2018-11-08 11:33:52 +01:00
2018-11-06 15:30:16 +01:00
2018-11-05 08:14:18 -08:00
2018-11-05 08:14:18 -08:00
2018-11-02 19:39:54 +01:00
2018-10-26 16:26:32 -07:00
2018-10-26 12:57:38 -07:00
2018-10-26 08:42:25 -07:00
2018-11-21 18:47:52 +01:00
2018-11-15 10:04:46 +01:00
2018-10-25 17:11:42 -07:00
2018-11-02 09:33:08 -07:00
2018-11-03 10:09:37 -07:00
2018-11-22 08:57:38 +01:00
2018-10-31 08:54:12 -07:00
2018-10-26 16:38:15 -07:00
2018-11-04 11:04:46 +01:00
2018-10-29 20:26:06 -07:00
2018-10-26 16:25:18 -07:00
2018-10-26 09:30:46 +01:00
2018-10-26 09:30:46 +01:00
2018-10-26 16:25:18 -07:00
2018-10-24 11:49:35 +01:00
2018-10-26 16:25:19 -07:00
2018-10-31 08:54:16 -07:00
2018-10-26 16:26:35 -07:00
2018-10-31 08:54:17 -07:00
2018-11-03 10:09:37 -07:00
2018-11-09 06:30:44 -06:00
2018-10-26 16:25:19 -07:00
2018-10-31 08:54:14 -07:00
2018-10-24 11:49:35 +01:00
2018-11-22 11:36:54 -08:00
2018-11-03 15:40:01 -07:00
2018-11-06 21:58:00 +01:00
2018-11-03 10:09:37 -07:00
2018-10-29 10:42:20 -07:00
2018-10-26 16:26:34 -07:00
2018-10-25 06:50:48 -07:00
2018-10-25 06:50:48 -07:00
2018-10-31 08:54:14 -07:00
2018-10-26 16:26:35 -07:00
2018-10-26 16:26:32 -07:00
2018-10-26 16:26:32 -07:00
2018-11-28 11:57:11 +01:00
2018-10-31 08:54:13 -07:00
2018-11-28 11:57:13 +01:00
2018-10-31 08:54:14 -07:00
2018-11-23 11:08:03 -08:00
2018-10-26 16:26:31 -07:00
2018-10-28 11:35:40 -07:00
2018-11-21 15:49:52 -08:00
2018-10-25 11:14:36 -07:00
2018-11-01 19:59:53 -06:00
2018-11-05 16:38:10 -05:00