Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 19 Mar 2020 18:14:00 -0000 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jEzg7-000755-Ni for speck@linutronix.de; Thu, 19 Mar 2020 19:13:59 +0100 From: Thomas Gleixner Subject: Re: [PATCH 1/3] v4 more sampling fun 1 In-Reply-To: <20200319085040.GA3494118@kroah.com> References: <5e7296c7.1c69fb81.f9a2f.00ebSMTPIN_ADDED_BROKEN@mx.google.com> <20200319085040.GA3494118@kroah.com> Date: Thu, 19 Mar 2020 19:13:58 +0100 Message-ID: <87y2rw43h5.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: speck for Greg KH writes: > On Mon, Mar 16, 2020 at 05:56:27PM -0700, speck for mark gross wrote: >> From: mark gross >> 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? > > 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? > >> --- 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. > > The macros should be fixed up anyway to use named identifiers, no time > like the present :) > > And this, and the cleanups, can be done in public, like I thought we > asked for before, right? I have played with this already. That's a pretty amazing amount of creative macro games all over the place and about 55+ files to cleanup. Let me dust off the patches a bit and send them as reference to LKML. Thanks, tglx