linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: "Tada, Kenta (Sony)" <Kenta.Tada@sony.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
	"jpoimboe@redhat.com" <jpoimboe@redhat.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"tony.luck@intel.com" <tony.luck@intel.com>,
	"pawan.kumar.gupta@linux.intel.com" 
	<pawan.kumar.gupta@linux.intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/speculation: Check whether speculation is force disabled
Date: Wed, 3 Jun 2020 11:39:38 -0400	[thread overview]
Message-ID: <d0356d0a-83dd-f3ae-c0ba-82089976c014@redhat.com> (raw)
In-Reply-To: <TYXPR01MB150318D484EE220452A5085AF5880@TYXPR01MB1503.jpnprd01.prod.outlook.com>

On 6/3/20 3:12 AM, Tada, Kenta (Sony) wrote:
> Once PR_SPEC_FORCE_DISABLE is set, users cannot set PR_SPEC_ENABLE.
> This commit checks whether PR_SPEC_FORCE_DISABLE was previously set.
>
> Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
> ---
>   arch/x86/kernel/cpu/bugs.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index ed54b3b21c39..678ace157035 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -1173,6 +1173,9 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
>   		if (spectre_v2_user == SPECTRE_V2_USER_STRICT ||
>   		    spectre_v2_user == SPECTRE_V2_USER_STRICT_PREFERRED)
>   			return -EPERM;
> +		/* If speculation is force disabled, enable is not allowed */
> +		if (task_spec_ib_force_disable(task))
> +			return -EPERM;
>   		task_clear_spec_ib_disable(task);
>   		task_update_spec_tif(task);
>   		break;

There is a comment up a few lines about this:

                 /*
                  * Indirect branch speculation is always allowed when
                  * mitigation is force disabled.
                  */
It conflicts with your new code. We can have an argument on whether IB 
should follow how SSB is being handled. Before that is settled,

Nacked-by: Waiman Long <longman@redhat.com>


  reply	other threads:[~2020-06-03 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03  7:12 [PATCH] x86/speculation: Check whether speculation is force disabled Tada, Kenta (Sony)
2020-06-03 15:39 ` Waiman Long [this message]
2020-06-04  7:29   ` Tada, Kenta (Sony)
2020-06-04 16:10     ` Waiman Long
2020-06-05 12:07       ` Tada, Kenta (Sony)
2020-06-17  0:15         ` Tada, Kenta (Sony)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0356d0a-83dd-f3ae-c0ba-82089976c014@redhat.com \
    --to=longman@redhat.com \
    --cc=Kenta.Tada@sony.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).