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 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2018-11-28 11:57:13 +01:00
2018-10-17 12:30:31 +02:00
2018-10-23 18:43:04 +01:00
2018-10-23 17:54:58 +01:00
2018-09-20 09:01:15 +02:00
2018-09-27 18:28:58 +02:00
2018-01-11 15:09:24 +01:00
2018-09-15 10:16:25 +02:00
2018-07-20 01:11:36 +02:00
2018-09-03 16:50:36 +02:00
2018-10-23 18:43:04 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-09-10 14:47:33 +02:00
2018-03-27 12:01:48 +02:00
2017-11-02 11:10:55 +01:00
2018-10-06 12:09:26 +02:00
2018-04-13 17:10:27 -07:00
2018-09-28 14:25:58 -05:00
2017-12-17 13:59:55 +01:00
2018-03-08 12:04:59 +01:00
2018-03-08 12:04:59 +01:00
2018-09-06 14:33:12 +02:00
2018-10-31 08:54:16 -07:00
2018-10-02 21:02:47 +02:00
2018-07-20 12:29:24 +10:00
2017-11-02 11:10:55 +01:00
2018-09-11 23:36:50 +02:00
2018-04-09 18:27:33 +02:00
2018-01-12 00:14:30 +01:00
2018-01-28 12:19:23 -08:00
2017-11-02 11:10:55 +01:00
2018-10-10 10:44:22 +02:00
2018-10-29 07:13:28 +01:00
2018-07-20 01:11:41 +02:00
2018-10-23 17:54:58 +01:00
2018-08-05 09:53:13 +02:00
2018-06-26 09:07:55 +02:00
2018-04-27 16:44:29 +02:00
2017-11-02 11:10:55 +01:00
2018-08-05 09:53:13 +02:00
2018-08-05 09:53:13 +02:00
2017-11-02 11:10:55 +01:00
2018-04-02 20:16:12 +02:00
2018-08-05 09:53:13 +02:00
2018-08-05 09:53:13 +02:00
2017-11-02 11:10:55 +01:00
2018-08-05 09:53:13 +02:00
2018-07-03 10:56:27 +02:00
2018-08-05 09:53:13 +02:00
2017-12-12 11:32:24 +01:00
2018-05-19 14:03:14 +02:00
2018-09-27 17:56:48 +02:00
2017-07-18 11:37:58 +02:00
2018-08-16 09:57:20 -07:00
2018-06-12 16:19:22 -07:00
2018-09-03 16:50:35 +02:00
2018-10-23 17:54:58 +01:00
2018-11-06 21:35:11 +01:00
2018-07-30 13:53:48 +02:00
2018-05-19 11:56:57 +02:00
2018-10-06 15:52:17 +02:00
2018-07-03 10:56:27 +02:00
2017-11-02 11:10:55 +01:00
2018-09-27 17:56:47 +02:00
2018-10-31 08:54:16 -07:00
2018-10-29 07:13:28 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 11:01:08 +02:00
2018-10-30 09:55:31 +01:00
2018-10-30 09:55:31 +01:00
2018-09-03 16:50:35 +02:00
2018-10-30 09:55:31 +01:00
2018-03-20 10:01:58 +01:00
2018-10-31 08:54:16 -07:00
2018-08-02 14:33:19 +02:00
2018-10-31 08:54:16 -07:00
2018-07-24 09:46:42 +02:00
2018-05-25 08:11:12 +02:00
2018-04-27 16:44:29 +02:00
2017-11-07 15:35:57 +01:00
2017-11-02 11:10:55 +01:00
2018-11-28 11:57:11 +01:00
2018-11-28 11:57:11 +01:00
2018-11-28 11:57:13 +01:00
2018-11-28 11:57:11 +01:00
2018-10-24 11:22:39 +01:00
2018-10-31 08:54:16 -07:00
2018-06-07 22:22:12 +02:00
2017-11-02 11:10:55 +01:00
2018-02-17 11:47:45 +01:00
2018-01-31 08:39:40 +01:00
2017-11-02 11:10:55 +01:00
2018-05-19 14:03:14 +02:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2018-04-25 10:40:56 -05:00
2018-06-22 19:04:22 +02:00
2018-08-05 09:53:13 +02:00
2018-10-31 08:54:16 -07:00
2018-06-21 16:34:56 +02:00
2017-11-02 11:10:55 +01:00
2018-11-01 12:59:25 +01:00
2018-01-11 23:36:59 +01:00
2018-10-31 08:54:16 -07:00
2018-10-23 19:07:25 +01:00
2017-12-23 21:13:01 +01:00
2018-09-12 21:15:02 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-10-29 07:19:26 +01:00
2018-10-02 10:14:32 +02:00
2017-11-13 19:07:38 -08:00
2018-10-23 17:54:58 +01:00
2018-09-21 15:30:54 +02:00
2017-10-10 12:49:49 +02:00
2017-07-26 13:18:20 +02:00
2018-06-21 16:34:56 +02:00
2018-09-11 21:18:53 +02:00
2017-09-28 09:39:03 +02:00
2018-10-09 16:51:12 +02:00
2018-10-23 18:43:04 +01:00
2018-11-06 21:35:11 +01:00
2018-10-10 10:44:22 +02:00