Re: [RFC PATCH] x86/cpu: Move sparsely used bit leafs into scattered features (was: Re: [PATCH 2/2] x86/cpufeature: Add CLZERO feature)
From: Andy Lutomirski
Date: Mon Oct 26 2015 - 22:56:38 EST
On Mon, Oct 26, 2015 at 2:01 PM, Borislav Petkov <bp@xxxxxxxxx> wrote:
> On Mon, Oct 26, 2015 at 09:22:50PM +0100, Borislav Petkov wrote:
>> And btw, those Intel QoS single bit defines and the XSAVE stuff there
>> should move to that function too - that's a pure waste having them in
>> the cap_flags array. I'll fix that.
>
> I.e., something like that (I'm jetlagged and I can't sleep, bah :-\).
>
> So this one builds but no further guarantees. It looks straightforward
> though.
>
> Not-yet-signed-off-by: Borislav Petkov <bp@xxxxxxx>
>
> ---
> diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
> index 9727b3b48bd1..ea109b58a864 100644
> --- a/arch/x86/include/asm/cpufeature.h
> +++ b/arch/x86/include/asm/cpufeature.h
> @@ -12,7 +12,7 @@
> #include <asm/disabled-features.h>
> #endif
>
> -#define NCAPINTS 13 /* N 32-bit words worth of info */
> +#define NCAPINTS 10 /* N 32-bit words worth of info */
> #define NBUGINTS 1 /* N 32-bit bug flags */
>
> /*
> @@ -198,6 +198,15 @@
> #define X86_FEATURE_HWP_EPP ( 7*32+13) /* Intel HWP_EPP */
> #define X86_FEATURE_HWP_PKG_REQ ( 7*32+14) /* Intel HWP_PKG_REQ */
> #define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */
> +/* Extended state features, CPUID level 0x0000000d:1 (eax) */
> +#define X86_FEATURE_XSAVEOPT (7*32+ 16) /* XSAVEOPT */
> +#define X86_FEATURE_XSAVEC (7*32+ 17) /* XSAVEC */
> +#define X86_FEATURE_XGETBV1 (7*32+ 18) /* XGETBV with ECX = 1 */
> +#define X86_FEATURE_XSAVES (7*32+ 19) /* XSAVES/XRSTORS */
How few features in one leaf do we need before calling it scattered
makes sense? These four might make sense to keep as is...
> +/* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:0 (edx) */
> +#define X86_FEATURE_CQM_LLC (7*32+ 20) /* LLC QoS if 1 */
> +/* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:1 (edx) */
> +#define X86_FEATURE_CQM_OCCUP_LLC (7*32+ 21) /* LLC occupancy monitoring if 1 */
>
...whereas this looks totally reasonable.
FWIW, we have a ton of thses things. Would it make sense to convert
this to a text file giving features and their CPUID positions that
generates the defines and the code to enumerate them?
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/