Files
linux/include/linux
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
..
2016-07-08 16:23:11 +02:00
2018-04-24 09:36:39 +02:00
2017-06-08 18:52:36 -07:00
2017-07-03 16:56:28 -06:00
2018-02-22 15:42:23 +01:00
2017-08-30 14:40:40 +02:00
2018-08-03 07:50:38 +02:00
2017-08-24 13:23:03 -07:00
2016-10-28 08:48:16 -06:00
2018-02-22 15:42:23 +01:00
2017-07-17 13:42:48 +02:00
2017-08-03 19:09:26 -07:00
2017-08-07 17:22:14 +02:00
2018-02-22 15:42:23 +01:00
2018-06-21 04:02:49 +09:00
2017-03-21 10:15:47 +02:00
2017-05-18 10:07:40 -04:00
2017-06-21 14:37:12 -04:00
2018-02-22 15:42:24 +01:00
2017-08-15 18:23:52 +02:00
2017-01-05 15:01:55 -06:00
2016-05-11 22:37:54 +02:00
2017-08-14 13:33:39 -07:00
2017-02-24 17:46:57 -08:00
2017-08-28 20:51:22 +02:00
2017-09-07 11:53:11 +02:00
2018-02-22 15:42:23 +01:00
2016-04-25 15:09:11 -04:00
2017-07-06 11:30:07 -04:00
2017-07-25 18:05:25 +02:00
2017-09-25 08:56:05 -06:00
2017-05-26 10:10:37 +02:00
2018-09-09 19:55:54 +02:00
2017-08-06 20:55:29 -07:00
2017-07-06 16:24:30 -07:00
2017-08-16 16:28:47 -07:00
2018-11-13 11:15:11 -08:00
2017-07-24 17:50:37 +02:00
2017-08-31 18:50:14 +02:00
2017-08-15 09:02:07 -07:00
2017-08-15 09:02:08 -07:00