All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [patch 3/8] [PATCH v1.3.1 3/7] Linux Patch 3
Date: Thu, 19 Apr 2018 20:29:21 -0400	[thread overview]
Message-ID: <20180420002916.GA30864@localhost.localdomain> (raw)
In-Reply-To: <20180419211003.GE3905@pd.tnic>

On Thu, Apr 19, 2018 at 11:10:03PM +0200, speck for Borislav Petkov wrote:
> On Thu, Apr 19, 2018 at 04:51:37PM -0400, speck for Konrad Rzeszutek Wilk wrote:
> > That won't work. The reason is that check_bugs first calls
> > identify_boot_cpu() which calls identify_cpu() which calls
> > this_cpu->init. Once identify_boot_cpu() is done _then_ it walks
> > through the spectre_v2_select_mitigation() and ssb_select_mitigation().
> 
> So call md_select_mitigation() before identify_boot_cpu() in
> check_bugs().

That will mean that the init_speculation_control() won't happen
until _after_ md_select_mitigation().

And that throws a wrench in that as we need to rdmsrl(SPEC_CTRL)
(which is right now done from spectre_v2_select_mitigation):

347         if (boot_cpu_has(X86_FEATURE_IBPB) || boot_cpu_has(X86_FEATURE_IBRS))
348                 rdmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);
349 }

And x86_spec_ctrl_base is then ORed in md_select_mitigation().

But
spectre_v2_select_mitigation depends on identify_boot_cpu.
md_select_mitigation depends on spectre_v2_select_mitigation.

If I move the identify_boot_cpu before md_select_mitigation things
get wonky.

Maybe it will be easier to explain when I send out the patches?

  reply	other threads:[~2018-04-20  0:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180418141551.07CBB6111A@crypto-ml.lab.linutronix.de>
2018-04-18 15:37 ` [MODERATED] Re: ***UNCHECKED*** [patch 3/8] [PATCH v1.3.1 3/7] Linux Patch 3 Borislav Petkov
2018-04-18 16:00   ` [MODERATED] Re: ***UNCHECKED*** " Borislav Petkov
2018-04-18 18:07     ` [MODERATED] " Borislav Petkov
2018-04-19 20:51   ` [MODERATED] Re: ***UNCHECKED*** " Konrad Rzeszutek Wilk
2018-04-19 21:10     ` [MODERATED] " Borislav Petkov
2018-04-20  0:29       ` Konrad Rzeszutek Wilk [this message]
2018-04-20  2:39         ` Konrad Rzeszutek Wilk

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=20180420002916.GA30864@localhost.localdomain \
    --to=konrad.wilk@oracle.com \
    --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.