All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: speck@linutronix.de
Subject: [MODERATED] Re: [patch V11 00/16] SSB 0
Date: Thu, 3 May 2018 08:10:04 +0200	[thread overview]
Message-ID: <20180503061004.yalw5atl7gf7fryt@gmail.com> (raw)
In-Reply-To: <c6a25d39-633c-75ac-3699-8be5f6c89ff1@linux.intel.com>


* speck for Tim Chen <speck@linutronix.de> wrote:


> On 05/02/2018 02:51 PM, speck for Thomas Gleixner wrote:
> > Changes since V10:
> > 
> >   - Addressed Ingos review feedback
> > 
> >   - Picked up Reviewed-bys
> > 
> > Delta patch below. Bundle is coming in separate mail. Git repo branches are
> > updated as well. The master branch contains also the fix for the lost IBRS
> > issue Tim was seeing.
> > 
> > If there are no further issues and nitpicks, I'm going to make the
> > changes immutable and changes need to go incremental on top.
> > 
> > Thanks,
> > 
> > 	tglx
> > 
> > 
> 
> I notice that this code ignores the current process's TIF_RDS setting
> in the prctl case:
> 
> #define firmware_restrict_branch_speculation_end()                      \
> do {                                                                    \
>         u64 val = x86_get_default_spec_ctrl();                          \
>                                                                         \
>         alternative_msr_write(MSR_IA32_SPEC_CTRL, val,                  \
>                               X86_FEATURE_USE_IBRS_FW);                 \
>         preempt_enable();                                               \
> } while (0)
> 
> x86_get_default_spec_ctrl will return x86_spec_ctrl_base, which
> will result in x86_spec_ctrl_base written to the MSR
> in the prctl case for Intel CPU.  That incorrectly ignores current
> process's TIF_RDS setting and the RDS bit will not be set.
> 
> Instead, the following value should have been written to the MSR
> for Intel CPU:
> x86_spec_ctrl_base | rds_tif_to_spec_ctrl(current_thread_info()->flags)

I wanted to suggest to do testing on affected and non-affected CPUs, both AMD and 
Intel, because the runtime TIF and MSR indexing logic looks sufficiently complex 
to me for it to be possibly wrong in some of the scenarios.

Thanks,

	Ingo

  reply	other threads:[~2018-05-03  6:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 21:51 [patch V11 00/16] SSB 0 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 01/16] SSB 1 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 02/16] SSB 2 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 03/16] SSB 3 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 04/16] SSB 4 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 05/16] SSB 5 Thomas Gleixner
2018-05-10 17:52   ` [MODERATED] " Andi Kleen
2018-05-10 18:30     ` Konrad Rzeszutek Wilk
2018-05-10 19:08       ` Andi Kleen
2018-05-10 21:22         ` Konrad Rzeszutek Wilk
2018-05-10 22:25           ` Andi Kleen
2018-05-10 23:50             ` Konrad Rzeszutek Wilk
2018-05-11 16:11               ` Andi Kleen
2018-05-16  7:55               ` Paolo Bonzini
2018-05-16 13:52                 ` Konrad Rzeszutek Wilk
2018-05-02 21:51 ` [patch V11 06/16] SSB 6 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 07/16] SSB 7 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 08/16] SSB 8 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 09/16] SSB 9 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 10/16] SSB 10 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 11/16] SSB 11 Thomas Gleixner
2018-05-04 20:58   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-02 21:51 ` [patch V11 12/16] SSB 12 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 13/16] SSB 13 Thomas Gleixner
2018-05-02 21:51 ` [patch V11 14/16] SSB 14 Thomas Gleixner
2018-05-03  7:19   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-03  7:31     ` Thomas Gleixner
2018-05-03  7:22   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-02 21:51 ` [patch V11 15/16] SSB 15 Thomas Gleixner
2018-05-03  7:21   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-02 21:51 ` [patch V11 16/16] SSB 16 Thomas Gleixner
2018-05-02 23:21 ` [patch V11 00/16] SSB 0 Thomas Gleixner
2018-05-03  4:27 ` [MODERATED] Encrypted Message Tim Chen
2018-05-03  6:10   ` Ingo Molnar [this message]
2018-05-03  6:30   ` [patch V11 00/16] SSB 0 Thomas Gleixner

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=20180503061004.yalw5atl7gf7fryt@gmail.com \
    --to=mingo@kernel.org \
    --cc=speck@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.