Messages in this thread Patch in this message | | | Date | Tue, 21 May 2024 09:49:47 +0200 | From | Borislav Petkov <> | Subject | Re: [PATCH v6 02/49] x86/cpu: Fix x86_match_cpu() to match just X86_VENDOR_INTEL |
| |
On Mon, May 20, 2024 at 03:45:33PM -0700, Tony Luck wrote: > Fixes: 644e9cbbe3fc ("Add driver auto probing for x86 features v4")
Do you really want to backport this to everything since 2012, as that patch is from then?
> @@ -690,6 +690,7 @@ struct x86_cpu_id { > __u16 model; > __u16 steppings; > __u16 feature; /* bit index */ > + __u16 flags; > kernel_ulong_t driver_data; > }; > > @@ -700,6 +701,9 @@ struct x86_cpu_id { > #define X86_STEPPING_ANY 0 > #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ > > +/* x86_cpu_id::flags */ > +#define X86_CPU_ID_FLAG_ENTRY_VALID BIT(0)
I would definitely not want to have those visible in userspace.
IOW, something like this:
diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h index 54a71c669ce9..b6325ee30871 100644 --- a/arch/x86/include/asm/cpu_device_id.h +++ b/arch/x86/include/asm/cpu_device_id.h @@ -53,6 +53,9 @@ #define X86_CENTAUR_FAM6_C7_D 0xd #define X86_CENTAUR_FAM6_NANO 0xf +/* x86_cpu_id::flags */ +#define X86_CPU_ID_FLAG_ENTRY_VALID BIT(0) + #define X86_STEPPINGS(mins, maxs) GENMASK(maxs, mins) /** * X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE - Base macro for CPU matching diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index ca3468ad06ff..4338b1b4ac44 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -690,6 +690,7 @@ struct x86_cpu_id { __u16 model; __u16 steppings; __u16 feature; /* bit index */ + /* Solely for kernel-internal use: DO NOT EXPORT to userspace! */ __u16 flags; kernel_ulong_t driver_data; }; @@ -701,9 +702,6 @@ struct x86_cpu_id { #define X86_STEPPING_ANY 0 #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ -/* x86_cpu_id::flags */ -#define X86_CPU_ID_FLAG_ENTRY_VALID BIT(0) - /* * Generic table type for matching CPU features. * @feature: the bit number of the feature (0 - 65535) -- Regards/Gruss, Boris.
https://people.kernel.org/tglx/notes-about-netiquette
| |