[MODERATED] Re: [PATCH 1/3] v4 more sampling fun 1

mark gross <[email protected]> Thu, 19 Mar 2020 08:40:46 -0700
Newsgroups org.kernel.lore.historical-speck
Message-ID <[email protected]>
On Thu, Mar 19, 2020 at 09:50:40AM +0100, speck for Greg KH wrote:
> On Mon, Mar 16, 2020 at 05:56:27PM -0700, speck for mark gross wrote:
> > From: mark gross <[email protected]>
> > Subject: [PATCH 1/3] x86/cpu: Add stepping field to x86_cpu_id structure
> > 
> > Intel uses the same family/model for several CPUs. Sometimes
> > the stepping must be checked to tell them apart.
> > 
> > Note that to keep this patch simple the new field has been added at the
> > end to avoid churn with all the pre-C99 initialized uses of this
> > structure. Such legacy usage will result in a "0" value for the stepping
> > field, hence X86_STEPPING_ANY is defined as "0".
> 
> Are you sure about the "avoid churn" stuff?  Can't you just fix up the
> X86_FEATURE_MATCH() #define to do that?
I wasn't confident about avoiding churn but I was hoping too.
Yes, I am pretty sure I can fix up that macro.

> Also INTEL_CPU_FAM_ANY() already uses named identifiers, so you are ok
> with that usage.  How many other places is this "open coded" that would
> need to be fixed up.  Can't be more than 10-20, right?
git grep X86_FEATURE_MATCH |wc
    15      37    1110

Right.

> 
> > --- a/include/linux/mod_devicetable.h
> > +++ b/include/linux/mod_devicetable.h
> > @@ -665,6 +665,7 @@ struct x86_cpu_id {
> >  	__u16 model;
> >  	__u16 feature;	/* bit index */
> >  	kernel_ulong_t driver_data;
> > +	__u16 stepping;
> >  };
> 
> That just makes my eyes hurt, stepping really should be before
> driver_data.
Well, it wasnt' my first choice but, it did minimize wripple.

> 
> The macros should be fixed up anyway to use named identifiers, no time
> like the present :)
Works for me.

> 
> And this, and the cleanups, can be done in public, like I thought we
> asked for before, right?

Yes, I think you and Boris both and maybe a few others did.  I wanted to
pre-flight things here as much as possible given the design level changes I've
made to date on this.  Unless I get massive pushback on this version of the
patch set I think now is an ok time to push a patch to add steppings  along
with using named fields clean up on the public list.

Thank your for the feedback.  I will post a public version of this dependency
for the SRBDS mitigation control before my next patch post to the spec list.

--mark
> 
> thanks,
> 
> greg k-h