Thomas Gleixner
6a847a6057
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>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185005.866780996@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 19:41:22 +01:00
..
2018-12-01 09:42:52 +01:00
2018-12-05 19:41:10 +01:00
2018-08-24 13:09:18 +02:00
2018-11-04 14:52:45 +01:00
2018-11-04 14:52:51 +01:00
2018-08-03 07:50:36 +02:00
2018-06-21 04:02:59 +09:00
2018-11-27 16:10:48 +01:00
2018-10-18 09:16:24 +02:00
2018-10-03 17:00:58 -07:00
2018-08-03 07:50:40 +02:00
2018-12-05 19:41:20 +01:00
2018-09-09 19:55:59 +02:00
2018-05-25 16:17:41 +02:00
2018-07-08 15:30:46 +02:00
2018-10-03 17:00:59 -07:00
2018-07-22 14:28:43 +02:00
2018-07-22 14:28:49 +02:00
2018-10-13 09:27:30 +02:00
2018-05-30 07:52:09 +02:00
2018-07-03 11:25:05 +02:00
2018-12-05 19:41:10 +01:00
2018-11-04 14:52:44 +01:00
2018-10-18 09:16:24 +02:00
2018-06-21 04:02:42 +09:00
2018-11-13 11:14:54 -08:00
2018-11-04 14:52:46 +01:00
2018-08-15 18:12:47 +02:00
2018-07-22 14:28:41 +02:00
2018-07-03 11:24:49 +02:00
2018-08-15 18:13:00 +02:00
2018-09-26 08:38:09 +02:00
2018-07-11 16:29:22 +02:00
2018-05-30 07:51:47 +02:00
2018-08-03 07:50:38 +02:00
2018-08-03 07:50:35 +02:00
2018-06-21 04:02:48 +09:00
2018-12-01 09:42:59 +01:00
2018-06-21 04:02:49 +09:00
2018-10-20 09:48:53 +02:00
2018-10-13 09:27:22 +02:00
2018-09-09 19:55:56 +02:00
2018-11-21 09:24:11 +01:00
2018-05-30 07:52:22 +02:00
2018-12-01 09:43:00 +01:00
2018-09-09 19:56:00 +02:00
2018-12-05 19:41:17 +01:00
2018-06-21 04:02:57 +09:00
2018-07-17 11:39:25 +02:00
2018-09-19 22:43:48 +02:00
2018-09-19 22:43:48 +02:00
2018-10-13 09:27:22 +02:00
2018-10-18 09:16:25 +02:00
2018-10-18 09:16:17 +02:00
2018-11-21 09:24:10 +01:00
2018-05-22 18:54:04 +02:00
2018-12-01 09:42:54 +01:00
2018-09-15 09:45:25 +02:00
2018-09-09 19:55:54 +02:00
2018-06-21 04:03:00 +09:00
2018-12-01 09:42:59 +01:00
2018-11-04 14:52:43 +01:00
2018-10-03 17:00:50 -07:00
2018-10-03 17:00:47 -07:00
2018-09-05 09:26:35 +02:00
2018-05-30 07:51:54 +02:00
2018-12-05 19:41:21 +01:00
2018-09-19 22:43:46 +02:00
2018-08-09 12:16:38 +02:00
2018-09-05 09:26:29 +02:00
2018-06-21 04:03:00 +09:00
2018-12-05 19:41:22 +01:00
2018-05-22 18:54:04 +02:00
2018-08-03 07:50:39 +02:00
2018-11-13 11:15:07 -08:00
2018-12-05 19:41:17 +01:00
2018-10-03 17:00:55 -07:00
2018-07-22 14:28:52 +02:00
2018-06-21 04:02:51 +09:00
2018-08-15 18:12:51 +02:00
2018-09-05 09:26:41 +02:00
2018-11-13 11:15:11 -08:00
2018-06-05 11:41:58 +02:00
2018-08-03 07:50:20 +02:00
2018-09-19 22:43:38 +02:00
2018-05-25 16:17:37 +02:00
2018-09-09 19:55:54 +02:00
2018-10-18 09:16:19 +02:00
2018-09-19 22:43:48 +02:00
2018-09-19 22:43:48 +02:00