From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, tony.luck@intel.com,
antonio.gomez.iglesias@linux.intel.com,
Daniel Sneddon <daniel.sneddon@linux.intel.com>,
andrew.cooper3@citrix.com, Josh Poimboeuf <jpoimboe@kernel.org>
Subject: Re: [RESEND RFC PATCH] x86/bugs: Add "unknown" reporting for MMIO Stale Data
Date: Fri, 29 Jul 2022 14:46:27 -0700 [thread overview]
Message-ID: <20220729214627.wowu5sny226c5pe4@desk> (raw)
In-Reply-To: <YuRDbuQPYiYBZghm@zn.tnic>
On Fri, Jul 29, 2022 at 10:30:38PM +0200, Borislav Petkov wrote:
> On Fri, Jul 29, 2022 at 10:36:09AM -0700, Pawan Gupta wrote:
> > Does this look okay:
> >
> > - if (cpu_matches(cpu_vuln_blacklist, MMIO) &&
> > - !arch_cap_mmio_immune(ia32_cap))
> > - setup_force_cpu_bug(X86_BUG_MMIO_STALE_DATA);
> > + if (!boot_cpu_has_bug(X86_BUG_MMIO_UNKNOWN)) {
> > + if (cpu_matches(cpu_vuln_blacklist, MMIO) &&
> > + !arch_cap_mmio_immune(ia32_cap)) {
> > + setup_force_cpu_bug(X86_BUG_MMIO_STALE_DATA);
> > + }
> > + }
>
> Yeah, I had initially X86_BUG_MMIO_UNKNOWN set unconditionally on all.
>
> Then I thought I should set it only on older but as dhansen said, Intel
> is going in and out of servicing period so we better set it on all
> initially and then clear it when the CPU is not in the vuln blacklist.
Setting all to "unknown" initially can lead to some CPUs incorrectly
reporting "Unknown".
Let me see if there is a way to distinguish between 4. and 5. below:
CPU category X86_BUG_MMIO_STALE_DATA X86_BUG_MMIO_UNKNOWN
-----------------------------------------------------------------------------------------------
1. Known affected (in cpu list) 1 0
2. CPUs with HW immunity (MMIO_NO=1) 0 0
3. Other vendors 0 0
4. Older Intel CPUs 0 1
5. Not affected current CPUs (but MMIO_NO=0) 0 ?
> > > if (!cpu_has(c, X86_FEATURE_BTC_NO)) {
> > > if (cpu_matches(cpu_vuln_blacklist, RETBLEED) || (ia32_cap & ARCH_CAP_RSBA))
> > > diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> > > index 663f6e6dd288..5b2508adc38a 100644
> > > --- a/arch/x86/kernel/cpu/intel.c
> > > +++ b/arch/x86/kernel/cpu/intel.c
> > > @@ -372,6 +372,10 @@ static void early_init_intel(struct cpuinfo_x86 *c)
> > > static void bsp_init_intel(struct cpuinfo_x86 *c)
> > > {
> > > resctrl_cpu_detect(c);
> > > +
> > > + /* Set on older crap */
> > > + if (c->x86_model < INTEL_FAM6_IVYBRIDGE)
>
> i.e., remove this check.
This check actually solves the above problem, but consider it gone.
> > > + setup_force_cpu_bug(X86_BUG_MMIO_UNKNOWN);
> >
> > Thanks for suggesting this approach.
>
> You're welcome. I'm assuming you're gonna finish it or should I?
I will finish it, working on it.
next prev parent reply other threads:[~2022-07-29 21:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 1:30 [RESEND RFC PATCH] x86/bugs: Add "unknown" reporting for MMIO Stale Data Pawan Gupta
2022-07-28 1:29 ` Pawan Gupta
2022-07-28 12:00 ` Borislav Petkov
2022-07-29 2:28 ` Pawan Gupta
2022-07-29 10:40 ` David Laight
2022-07-29 17:45 ` 'Pawan Gupta'
2022-07-29 14:05 ` Borislav Petkov
2022-07-29 17:36 ` Pawan Gupta
2022-07-29 20:30 ` Borislav Petkov
2022-07-29 21:46 ` Pawan Gupta [this message]
2022-07-29 22:02 ` Borislav Petkov
2022-07-30 2:31 ` Pawan Gupta
2022-07-29 22:54 ` Dave Hansen
2022-07-29 23:07 ` Tony Luck
2022-07-29 23:18 ` Dave Hansen
2022-07-30 2:40 ` Pawan Gupta
2022-07-28 19:08 ` Dave Hansen
2022-07-29 17:59 ` Pawan Gupta
2022-07-29 18:02 ` Dave Hansen
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=20220729214627.wowu5sny226c5pe4@desk \
--to=pawan.kumar.gupta@linux.intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=antonio.gomez.iglesias@linux.intel.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=daniel.sneddon@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=stable@vger.kernel.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