[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181122071043.GA41788@gmail.com>
Date: Thu, 22 Nov 2018 08:10:43 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jiri Kosina <jkosina@...e.cz>,
Tom Lendacky <thomas.lendacky@....com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
David Woodhouse <dwmw@...zon.co.uk>,
Andi Kleen <ak@...ux.intel.com>,
Dave Hansen <dave.hansen@...el.com>,
Casey Schaufler <casey.schaufler@...el.com>,
Asit Mallick <asit.k.mallick@...el.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
Jon Masters <jcm@...hat.com>,
Waiman Long <longman9394@...il.com>,
Greg KH <gregkh@...uxfoundation.org>,
Dave Stewart <david.c.stewart@...el.com>,
Kees Cook <keescook@...omium.org>,
Tim Chen <tim.c.chen@...ux.intel.com>
Subject: Re: [patch 22/24] x86/speculation: Create PRCTL interface to
restrict indirect branch speculation
* Thomas Gleixner <tglx@...utronix.de> wrote:
> From: Tim Chen <tim.c.chen@...ux.intel.com>
>
> Add the PR_SPEC_INDIR_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.
>
> Invocations:
> Check indirect branch speculation status with
> - prctl(PR_GET_SPECULATION_CTRL, PR_SPEC_INDIR_BRANCH, 0, 0, 0);
>
> Enable indirect branch speculation with
> - prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIR_BRANCH, PR_SPEC_ENABLE, 0, 0);
>
> Disable indirect branch speculation with
> - prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIR_BRANCH, PR_SPEC_DISABLE, 0, 0);
>
> Force disable indirect branch speculation with
> - prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIR_BRANCH, PR_SPEC_FORCE_DISABLE, 0, 0);
>
> See Documentation/userspace-api/spec_ctrl.rst.
>
> Signed-off-by: Tim Chen <tim.c.chen@...ux.intel.com>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Please either de-capitalize the title to 'prctl()', or use PR_SPEC_PRCTL
or PR_SET/GET_SPECULATION_CTRL - there's no such thing as 'PRCTL'
interface - the interface is called prctl() and the speculation control
ABIs have their own names.
This applies to the next patch as well.
> --- a/include/uapi/linux/prctl.h
> +++ b/include/uapi/linux/prctl.h
> @@ -212,6 +212,7 @@ struct prctl_mm_map {
> #define PR_SET_SPECULATION_CTRL 53
> /* Speculation control variants */
> # define PR_SPEC_STORE_BYPASS 0
> +# define PR_SPEC_INDIR_BRANCH 1
> /* Return and control values for PR_SET/GET_SPECULATION_CTRL */
> # define PR_SPEC_NOT_AFFECTED 0
> # define PR_SPEC_PRCTL (1UL << 0)
> --- a/tools/include/uapi/linux/prctl.h
> +++ b/tools/include/uapi/linux/prctl.h
> @@ -212,6 +212,7 @@ struct prctl_mm_map {
> #define PR_SET_SPECULATION_CTRL 53
> /* Speculation control variants */
> # define PR_SPEC_STORE_BYPASS 0
> +# define PR_SPEC_INDIR_BRANCH 1
> /* Return and control values for PR_SET/GET_SPECULATION_CTRL */
> # define PR_SPEC_NOT_AFFECTED 0
> # define PR_SPEC_PRCTL (1UL << 0)
Please de-abbreviate the new ABI: PR_SPEC_INDIRECT_BRANCH?
Thanks,
Ingo
Powered by blists - more mailing lists