Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-13 Thread Andi Kleen
> So instead of adding helpers the 1<< ops can be written out explicitly - they > are > easy to read after all. Can also be: > > var &= ~BIT(bit); > var |= BIT(bit); It's some more complicated because "var" are arrays. Opencoding is fairly ugly. I changed the main bitmap to use DEC

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-13 Thread Andi Kleen
> > I was looking at that as well and decided that we preferrably have a > > compressed data structure. The code which walks the table is hardly > > performance critical and the difference in text size is marginal. > > So the code should all be __init (once that is fixed), hence data and text > s

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-12 Thread Ingo Molnar
* Thomas Gleixner wrote: > On Thu, 12 Oct 2017, Ingo Molnar wrote: > > > > * Andi Kleen wrote: > > > > > --- /dev/null > > > +++ b/arch/x86/kernel/cpu/cpuid-deps.c > > > @@ -0,0 +1,109 @@ > > > +/* Declare dependencies between CPUIDs */ > > > +#include > > > +#include > > > +#include > > >

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-12 Thread Andi Kleen
> > Why isn't this __initdata? It's referenced during cpu hotplug. Actually it should never change in this case, but it's hard to tell that to the dependency checker. -Andi

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-12 Thread Andi Kleen
On Thu, Oct 12, 2017 at 05:13:34PM +0200, Thomas Gleixner wrote: > On Thu, 12 Oct 2017, Ingo Molnar wrote: > > > > * Andi Kleen wrote: > > > > > --- /dev/null > > > +++ b/arch/x86/kernel/cpu/cpuid-deps.c > > > @@ -0,0 +1,109 @@ > > > +/* Declare dependencies between CPUIDs */ > > > +#include >

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-12 Thread Thomas Gleixner
On Thu, 12 Oct 2017, Ingo Molnar wrote: > > * Andi Kleen wrote: > > > --- /dev/null > > +++ b/arch/x86/kernel/cpu/cpuid-deps.c > > @@ -0,0 +1,109 @@ > > +/* Declare dependencies between CPUIDs */ > > +#include > > +#include > > +#include > > +#include > > + > > +struct cpuid_dep { > > + un

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-12 Thread Ingo Molnar
* Ingo Molnar wrote: > > + bool changed; > > + __u32 disable[NCAPINTS + NBUGINTS]; > > + unsigned long *disable_mask = (unsigned long *)disable; > > + const struct cpuid_dep *d; > > The constant forced types are really ugly and permeate the whole code. Please > introduce some suitably

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-12 Thread Ingo Molnar
* Andi Kleen wrote: > --- /dev/null > +++ b/arch/x86/kernel/cpu/cpuid-deps.c > @@ -0,0 +1,109 @@ > +/* Declare dependencies between CPUIDs */ > +#include > +#include > +#include > +#include > + > +struct cpuid_dep { > + unsigned short feature; > + unsigned short depends; > +}; Why a

Re: [PATCH v9 2/5] x86/cpuid: Add generic table for cpuid dependencies

2017-10-08 Thread Thomas Gleixner
On Fri, 6 Oct 2017, Andi Kleen wrote: > From: Andi Kleen > > Some CPUID features depend on other features. Currently it's > possible to to clear dependent features, but not clear the base features, > which can cause various interesting problems. > > This patch implements a generic table to desc