[MODERATED] Re: [PATCH 1/2] v3 more sampling fun 1

mark gross <[email protected]> Wed, 11 Mar 2020 16:18:19 -0700
Newsgroups org.kernel.lore.historical-speck
Message-ID <[email protected]>
On Wed, Mar 11, 2020 at 08:28:36PM +0000, speck for Andrew Cooper wrote:
> On 16/01/2020 22:16, speck for mark gross wrote:
> > +static void __init srbds_select_mitigation(void)
> > +{
> > +	u64 ia32_cap;
> > +
> > +	if (!boot_cpu_has_bug(X86_BUG_SRBDS)) {
> > +		srbds_mitigation = SRBDS_NOT_AFFECTED;
> > +		return;
> > +	}
> > +
> > +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
> > +		srbds_mitigation = SRBDS_HYPERVISOR;
> > +		return;
> > +	}
> 
> These two ought to be reversing (and with a suitable adjustment to the
> docs in patch 2).
> 
> If you're running as a guest, you can't even trust the model number used
> to divine X86_BUG_SRBDS in the first place.
> 

I'll change this for the next version.

--mark