tools headers: Sync x86 cpufeatures and arm64 cputype headers
PATCH 1/1 tools headers: Sync x86 cpufeatures and arm64 cputype headers
To pick up the changes in this cset:
commit 2f8f173413f1 ("x86/vmscape: Add conditional IBPB mitigation")
commit a508cec6e521 ("x86/vmscape: Enumerate VMSCAPE bug")
commit c8c2647e69be ("arm64: Make _midr_in_range_list() an exported function") commit e3121298c7fc ("arm64: Modify _midr_range() functions to read MIDR/REVIDR internally")
This addresses these perf build warnings:tools/perf$ ./check-headers.sh
Warning: Kernel ABI header differences:
diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
Please see tools/include/uapi/README for further details.
--- tools/arch/arm64/include/asm/cputype.h | 36 ++++++++---------------- tools/arch/x86/include/asm/cpufeatures.h | 2 ++ 2 files changed, 13 insertions(+), 25 deletions(-)
tools/arch/arm64/include/asm/cputype.h +11 -25
@@ -251,6 +251,16 @@#define read_cpuid (reg) read_sysreg_s(SYS_ ## reg) +/* +* The CPU ID never changes at run time, so we might as well tell the +* compiler that it's constant. Use this function to read the CPU ID +* rather than directly reading processor_id or read_cpuid() directly. +*/ +static inline u32 __attribute_const__ read_cpuid_id(void) +{ +return read_cpuid (MIDR_EL1 ); +} +/* * Represent a range of MIDR values for a given CPU model and a * range of variant/revision values.
@@ -286,31 +296,6 @@ static inline bool midr_is_cpu_model_range(u32 midr, u32 model, u32 rv_min,return _model == model && rv >= rv_min && rv <= rv_max; } -static inline bool is_midr_in_range (u32 midr,struct midr_range const *range) -{ -return midr_is_cpu_model_range (midr, range->model, - range->rv_min, range->rv_max); -} - -static inline bool -is_midr_in_range_list (u32 midr,struct midr_range const *ranges) -{ -while (ranges->model) -if (is_midr_in_range (midr, ranges++)) -return true; -return false; -} - -/* -* The CPU ID never changes at run time, so we might as well tell the -* compiler that it's constant. Use this function to read the CPU ID -* rather than directly reading processor_id or read_cpuid() directly. -*/ -static inline u32 __attribute_const__ read_cpuid_id(void) -{ -return read_cpuid (MIDR_EL1 ); -} -struct target_impl_cpu {u64 midr;u64 revidr;
@@ -318,6 +303,7 @@ struct target_impl_cpu { };bool cpu_errata_set_target_impl (u64 num,void *impl_cpus); +bool is_midr_in_range_list (struct midr_range const *ranges); static inline u64 __attribute_const__ read_cpuid_mpidr(void) {
tools/arch/x86/include/asm/cpufeatures.h +2 -0
@@ -495,6 +495,7 @@#define X86_FEATURE_TSA_SQ_NO (21*32+11)/* AMD CPU not vulnerable to TSA-SQ */ #define X86_FEATURE_TSA_L1_NO (21*32+12)/* AMD CPU not vulnerable to TSA-L1 */ #define X86_FEATURE_CLEAR_CPU_BUF_VM (21*32+13)/* Clear CPU buffers using VERW before VMRUN */ +#define X86_FEATURE_IBPB_EXIT_TO_USER (21*32+14)/* Use IBPB on exit-to-userspace, see VMSCAPE bug */ /* * BUG word(s)
@@ -551,4 +552,5 @@#define X86_BUG_ITS X86_BUG( 1*32+ 7)/* "its" CPU is affected by Indirect Target Selection */ #define X86_BUG_ITS_NATIVE_ONLY X86_BUG( 1*32+ 8)/* "its_native_only" CPU is affected by ITS, VMX is not affected */ #define X86_BUG_TSA X86_BUG( 1*32+ 9)/* "tsa" CPU is affected by Transient Scheduler Attacks */ +#define X86_BUG_VMSCAPE X86_BUG( 1*32+10)/* "vmscape" CPU is affected by VMSCAPE attacks from guests */ #endif /* _ASM_X86_CPUFEATURES_H */
Signature · 1 line
2.43.0
Hi Shivank,
[ + James, perf-user ML ]
Quoted 7 lines · Shivank Garg
To pick up the changes in this cset:
commit
2f8f173413f1("x86/vmscape: Add conditional IBPB mitigation")
commita508cec6e521("x86/vmscape: Enumerate VMSCAPE bug")
commitc8c2647e69be("arm64: Make _midr_in_range_list() an exported function") commite3121298c7fc("arm64: Modify_midr_range()functions to read MIDR/REVIDR internally")
Quoted 5 lines
This addresses these perf build warnings:
tools/perf$./check-headers.sh
Warning: Kernel ABI header differences:
diff -utools/arch/x86/include/asm/cpufeatures.harch/x86/include/asm/cpufeaturesdiff -utools/arch/arm64/include/asm/cputype.harch/arm64/include/asm/cputype.h
Please drop arm64 related syncing, otherwise, it will break perf building.
At the meantime, James is working on refactoring cpu type definitions for Arm64, we expect to avoid syncing cputype.h.
Thanks,
Leo
Quoted 12 lines · Leo Yan
Hi Shivank,
[ + James, perf-user ML ]
Quoted 7 lines · Shivank Garg
To pick up the changes in this cset:
commit
2f8f173413f1("x86/vmscape: Add conditional IBPB mitigation")
commita508cec6e521("x86/vmscape: Enumerate VMSCAPE bug")
commitc8c2647e69be("arm64: Make _midr_in_range_list() an exported function") commite3121298c7fc("arm64: Modify_midr_range()functions to read MIDR/REVIDR internally")
Quoted 8 lines
Quoted 5 lines
This addresses these perf build warnings:
tools/perf$./check-headers.sh
Warning: Kernel ABI header differences:
diff -utools/arch/x86/include/asm/cpufeatures.harch/x86/include/asm/cpufeaturesdiff -utools/arch/arm64/include/asm/cputype.harch/arm64/include/asm/cputype.hPlease drop arm64 related syncing, otherwise, it will break perf building.
Sure, I'll send V2 without arm64 sync.
Thanks,
Shivank
Quoted 6 lines
At the meantime, James is working on refactoring cpu type definitions for Arm64, we expect to avoid syncing
cputype.h.Thanks,
Leo
Quoted 21 lines · Shivank
Quoted 18 lines · Leo Yan
Hi Shivank,
[ + James, perf-user ML ]
Quoted 12 lines · Shivank Garg
To pick up the changes in this cset:
commit
2f8f173413f1("x86/vmscape: Add conditional IBPB mitigation")
commita508cec6e521("x86/vmscape: Enumerate VMSCAPE bug")
commitc8c2647e69be("arm64: Make _midr_in_range_list() an exported function") commite3121298c7fc("arm64: Modify_midr_range()functions to read MIDR/REVIDR internally")This addresses these perf build warnings:
tools/perf$./check-headers.sh
Warning: Kernel ABI header differences:
diff -utools/arch/x86/include/asm/cpufeatures.harch/x86/include/asm/cpufeaturesdiff -utools/arch/arm64/include/asm/cputype.harch/arm64/include/asm/cputype.h
Quoted 14 lines
Quoted 2 lines
Please drop arm64 related syncing, otherwise, it will break perf building.
Sure, I'll send V2 without arm64 sync.
Thanks,
ShivankQuoted 6 lines
At the meantime, James is working on refactoring cpu type definitions for Arm64, we expect to avoid syncing
cputype.h.Thanks,
Leo
tools/perf$ make
BUILD: Doing 'make -j128' parallel build
Warning: Kernel ABI header differences:
diff -u tools/include/linux/cfi_types.h include/linux/cfi_types.h
diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h diff -u tools/include/asm-generic/bitops/__fls.h include/asm-generic/bitops/__fls.h diff -u tools/include/asm-generic/bitops/fls.h include/asm-generic/bitops/fls.h diff -u tools/include/asm-generic/bitops/fls64.h include/asm-generic/bitops/fls64.h diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h diff -u tools/perf/trace/beauty/include/uapi/linux/fcntl.h include/uapi/linux/fcntl.h diff -u tools/perf/trace/beauty/include/uapi/linux/fs.h include/uapi/linux/fs.h
There are a lot of new ABI differences today, so I think it’s best to sync after the merge window?
Thanks,
Shivank
kernel test robot
build botkernel test robot noticed "perf-sanity-tests.perf.make.fail" on:
Hello,
kernel test robot noticed "perf-sanity-tests.perf.make.fail" on:
commit: 00bacc579a0558c23b9fb50846091d3eb69dcd12 ("[PATCH] tools headers: Sync x86 cpufeatures and arm64 cputype headers")
url: https://github.com/intel-lab-lkp/linux/commits/Shivank-Garg/tools-headers-Sync-x86-cpufeatures-and-arm64-cputype-headers/20250929-141957
base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git e5f0a698b34ed76002dc5cff3804a61c80233a7a
patch link: https://lore.kernel.org/all/[email protected]/
patch subject: [PATCH] tools headers: Sync x86 cpufeatures and arm64 cputype headers
in testcase: perf-sanity-tests
version:
with following parameters:
perf_compiler: clang group: group-01
config: x86_64-rhel-9.4-bpf
compiler: gcc-14
test machine: 224 threads 4 sockets Intel(R) Xeon(R) Platinum 8380H CPU @ 2.90GHz (Cooper Lake) with 192G memory
(please refer to attached dmesg/kmsg for entire log/backtrace)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]
user :err : [ 247.978055] [ T2565] util/arm-spe.c: In function ‘arm_spe__synth_ds’:
user :err : [ 248.467637] [ T2565] util/arm-spe.c:885:43: error: passing argument 1 of ‘is_midr_in_range_list’ makes pointer from integer without a cast [-Wint-conversion]
user :err : [ 248.495319] [ T2565] 885 | if (is_midr_in_range_list(midr, data_source_handles[i].midr_ranges)) {
user :err : [ 248.512094] [ T2565] | ^~~~
user :err : [ 248.526499] [ T2565] | |
user :err : [ 248.542706] [ T2565] | u64 {aka long unsigned int}
user :err : [ 248.558780] [ T2565] In file included from util/arm-spe.c:37:
user :err : [ 249.826660] [ T2565] util/../../arch/arm64/include/asm/cputype.h:306:53: note: expected ‘const struct midr_range *’ but argument is of type ‘u64’ {aka ‘long unsigned int’}
user :err : [ 249.854297] [ T2565] 306 | bool is_midr_in_range_list(struct midr_range const *ranges);
user :err : [ 249.871522] [ T2565] | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
user :err : [ 250.353462] [ T2565] util/arm-spe.c:885:21: error: too many arguments to function ‘is_midr_in_range_list’
user :err : [ 250.373933] [ T2565] 885 | if (is_midr_in_range_list(midr, data_source_handles[i].midr_ranges)) {
user :err : [ 250.392421] [ T2565] | ^~~~~~~~~~~~~~~~~~~~~
user :err : [ 250.408497] [ T2565] util/../../arch/arm64/include/asm/cputype.h:306:6: note: declared here
user :err : [ 250.422856] [ T2565] 306 | bool is_midr_in_range_list(struct midr_range const *ranges);
user :err : [ 250.439238] [ T2565] | ^~~~~~~~~~~~~~~~~~~~~
user :err : [ 250.465872] [ T2565] make[4]: *** [/usr/src/perf_selftests-x86_64-rhel-9.4-bpf-00bacc579a0558c23b9fb50846091d3eb69dcd12/tools/build/Makefile.build:85: util/arm-spe.o] Error 1
user :err : [ 250.488993] [ T2565] make[4]: *** Waiting for unfinished jobs....
user :err : [ 250.502580] [ T2565] make[3]: *** [/usr/src/perf_selftests-x86_64-rhel-9.4-bpf-00bacc579a0558c23b9fb50846091d3eb69dcd12/tools/build/Makefile.build:142: util] Error 2
user :err : [ 250.527554] [ T2565] make[2]: *** [Makefile.perf:797: perf-util-in.o] Error 2
The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20251002/[email protected]
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki