[MODERATED] Re: [PATCH 3/4] V7 more sampling fun 3

mark gross <[email protected]> Tue, 14 Apr 2020 14:53:21 -0700
Newsgroups org.kernel.lore.historical-speck
Message-ID <[email protected]>
On Tue, Apr 14, 2020 at 04:23:27PM -0500, speck for Josh Poimboeuf wrote:
> On Tue, Apr 14, 2020 at 02:03:02PM -0700, speck for mark gross wrote:
> > > > +	[SRBDS_MITIGATION_NOT_AFFECTED_TSX_OFF]	= "Not affected (TSX disabled)",
> > > 
> > > The CPU *is* affected, it just happens to be mitigated, right?
> > This depends on perspective.
> > The only mitigation to SRBS is for the uCode to serialize access to the off
> > core hwRNG and to do a ghost transfer of a through away random number such that
> > if it leaks you don't get the right random number.  I think there may be some
> > buffer clearing in there too.
> > 
> > Disabling TSX from that point of view is not mitigating the issue so much as
> > hiding exposure to it.
> > 
> > I can see it either way.  Not sure which is better.  After reading my logic do
> > you still think it would make more sence to change "Not affected (TSX
> > disabled)" to "Mitigated: TSX disabled"?
> 
> From a user's perspective, "hiding exposure" is the same as a
> mitigation.  So I think it makes sense to call it a mitigation.
done

> > > > +		 */
> > > > +		if ((ia32_cap & ARCH_CAP_MDS_NO) &&
> > > > +		    !((ia32_cap & ARCH_CAP_TSX_CTRL_MSR) ||
> > > > +		      cpu_has(c, X86_FEATURE_RTM)))
> > > > +			goto srbds_not_affected;
> > > > +
> > > > +		setup_force_cpu_bug(X86_BUG_SRBDS);
> > > > +	}
> > > > +srbds_not_affected:
> > > > +
> > > >  	if (cpu_matches(NO_MELTDOWN, cpu_vuln_whitelist))
> > > >  		return;
> > > 
> > > I'm thinking it would be more readable to have the newline between the
> > > bracket and the 'if', instead of between the label and the 'if'.
> > so, lose the newline between the label and the if?
> 
> Yes, and add one between the '}' and the label.
done
--mark

> -- 
> Josh