[PATCH] arm64: Generate cpucaps.h

Catalin Marinas catalin.marinas at arm.com
Thu Apr 29 13:32:43 BST 2021


On Wed, Apr 28, 2021 at 01:12:31PM +0100, Mark Brown wrote:
> The arm64 code allocates an internal constant to every CPU feature it can
> detect, distinct from the public hwcap numbers we use to expose some
> features to userspace. Currently this is maintained manually which is an
> irritating source of conflicts when working on new features, to avoid this
> replace the header with a simple text file listing the names we've assigned
> and sort it to minimise conflicts.
> 
> As part of doing this we also do the Kbuild hookup required to hook up
> an arch tools directory and to generate header files in there.
> 
> This will result in a renumbering and reordering of the existing constants,
> since they are all internal only the values should not be important. The
> reordering will impact the order in which some steps in enumeration handle
> features but the algorithm is not intended to depend on this and I haven't
> seen any issues when testing. Due to the UAO cpucap having been removed in
> the past we end up with ARM64_NCAPS being 1 smaller than it was before.
> 
> Signed-off-by: Mark Brown <broonie at kernel.org>
> ---
>  arch/arm64/Makefile              |  3 ++
>  arch/arm64/include/asm/Kbuild    |  2 +
>  arch/arm64/include/asm/cpucaps.h | 74 --------------------------------
>  arch/arm64/tools/Makefile        | 22 ++++++++++
>  arch/arm64/tools/cpucaps         | 65 ++++++++++++++++++++++++++++
>  arch/arm64/tools/gen-cpucaps.awk | 40 +++++++++++++++++
>  6 files changed, 132 insertions(+), 74 deletions(-)
>  delete mode 100644 arch/arm64/include/asm/cpucaps.h
>  create mode 100644 arch/arm64/tools/Makefile
>  create mode 100644 arch/arm64/tools/cpucaps
>  create mode 100755 arch/arm64/tools/gen-cpucaps.awk

It's a good cleanup, it saves us from always sorting out conflicts
around ARM64_NCAPS. I'll either take it during the merging window with
the for-next/fixes folded in or push it at -rc1 as there's a change in
cpucaps.h not currently in for-next/core.

Thanks.

-- 
Catalin



More information about the linux-arm-kernel mailing list