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