[PATCH] tools/headers: Workaround the copy coherency issue of arm64's cputype.h

Yicong Yang yangyicong at huawei.com
Wed Jun 18 04:22:26 PDT 2025


On 2025/6/18 16:44, Mark Rutland wrote:
> On Wed, Jun 18, 2025 at 04:30:17PM +0800, Yicong Yang wrote:
>> From: Yicong Yang <yangyicong at hisilicon.com>
>>
>> arch/arm64/include/asm/cputype.h is copied from arch/arm64 and used
>> by perf to parsing vendor specific SPE packets according to the MIDR.
>> The header diverge after errata management handling for VM live
>> migration merged [1] so a direct copy will lead to the build failure
>> of perf [2]: is_midr_in_range_list() is used but the implementation
>> has been changed and moved out of the kernel header.
> 
> The build failure described above manifests *IF AND WHEN* we update the
> userspace header with a copy of the kernel header, and there's no need
> to do so.
> 
>> Workaround this issue by maintaining is_perf_midr_in_range_list()
>> in the userspace. Temporarily include the kernel headers for the
>> MIDR definitions, a later refactor will generate the MIDR header
>> dynamically similar to how we handle the sysreg-defs.h in userspace.
>> Remove cputype.h from check-headers.sh.
> 
> Sorry, but NAK to this. As-is, this means that any change to the
> kernel-internal asm/cputype.h is liable to break the userspace tool, and
> placing a burden on whoever modifies the kernel-internal headers.
> 
> The simple solution for now is to *NOT* update the userspace header, and
> to stop warning that this has diverged from the kernel header. If we
> want to improve matters, we should split things appropriately for
> sharing.
> 

ok then I think we just make it as is and wait for Leo's refactor.

thanks.



More information about the linux-arm-kernel mailing list