LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Jörg Otte" <jrg.otte@gmail.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Borislav Petkov" <bp@alien8.de>
Subject: Re: [v4.17-rcx] Lost IBPB, IBRS_FW support for spectre_v2 mitigation.
Date: Tue, 01 May 2018 20:14:37 +0000	[thread overview]
Message-ID: <CA+55aFxKbPDrMQssyEtOnYZqE8HcOo=Zx6ASty6CybhwPfT9_g@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1805011458390.1596@nanos.tec.linutronix.de>

On Tue, May 1, 2018 at 5:59 AM Thomas Gleixner <tglx@linutronix.de> wrote:

> Then I really have no idea how reverting the patch you pointed out would
> fix it.

So I do think that the original patch is buggy.

What I think *may* be going on is:

  - first we do that

                 get_cpu_cap(c);
                 get_cpu_address_sizes(c);

     but at that point, CPU levels may be masked, and that 0x80000008 leaf
isn't seen

  - then we do

                 if (this_cpu->c_early_init)
                         this_cpu->c_early_init(c);

    which calls early_init_intel(), which does that

                 if (msr_clear_bit(MSR_IA32_MISC_ENABLE,
                                   MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) >
0) {

    which now raises the cpuid_level.

  - then we do

                         get_cpu_cap(c);

    again, because the cpuid level has been raised, and _now_ it used to get
that 0x80000008 leaf information.

But with the change, that second call to get_cpu_cap() didn't do anything,
because the 0x80000008 leaf handling had been moved away.

However, I agree that your patch to just do that CPUID_8000_0008_EBX in
get_cpu_cap() should have fixed it, and it's possible that Jörg mis-tested
it.

Jörg, are you sure you didn't somehow get the wrong microcode? Because
another way for those bits to be cleared again is if
bad_spectre_microcode() triggers. That should show up in dmesg as "Intel
Spectre v2 broken microcode detected" though.

            Linus

  parent reply	other threads:[~2018-05-01 20:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 15:59 Jörg Otte
2018-04-30 19:53 ` Thomas Gleixner
2018-05-01  7:39   ` Jörg Otte
2018-05-01 12:59     ` Thomas Gleixner
2018-05-01 18:27       ` Thomas Gleixner
2018-05-01 23:07         ` Tim Chen
2018-05-01 20:14       ` Linus Torvalds [this message]
2018-05-02  7:43         ` Jörg Otte
2018-05-02  9:02           ` Thomas Gleixner
2018-05-02  9:25             ` Jörg Otte
2018-05-02 12:20               ` Thomas Gleixner
2018-05-04 16:18                 ` Borislav Petkov
2018-05-05  9:47                   ` Jörg Otte
2018-05-05  9:53                     ` Borislav Petkov
2018-05-02 14:48             ` [tip:x86/urgent] x86/cpu: Restore CPUID_8000_0008_EBX reload tip-bot for Thomas Gleixner
2018-05-02 18:08               ` Tim Chen

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='CA+55aFxKbPDrMQssyEtOnYZqE8HcOo=Zx6ASty6CybhwPfT9_g@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=jrg.otte@gmail.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --subject='Re: [v4.17-rcx] Lost IBPB, IBRS_FW support for spectre_v2 mitigation.' \
    /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

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).