mbox series

[v2,0/4] arm64: cpucap cleanup

Message ID 20230607164846.3967305-1-mark.rutland@arm.com (mailing list archive)
Headers show
Series arm64: cpucap cleanup | expand

Message

Mark Rutland June 7, 2023, 4:48 p.m. UTC
Currently arm64 uses inconsistent terminology when handling cpucaps,
with different places in the code referring to these as "capabilities",
"features", "cpufeatures", "hwcaps", and "cpu_hwcaps" with the latter
two easily being confused with the ELF hwcaps.

Similarly, the bitmaps used to store the boot and system cpucaps are
named "boot_capabilities" and "cpu_hwcaps" respectively.

All of this is unnecessarily confusing.

This series tries to apply a consistent "cpucap" naming scheme,
following the example of "asm/cpucaps.h" where the cpucap values are
defined. This clearly separates these from the ELF hwcaps, and makes it
easier to understand the code.

I've split this out from a larger rework of the cpucap logic, as that
larger rework isn't yet ready and I think this stands on its own as a
nice cleanup.

There should be no functional change as a result of this series.

Thanks,
Mark.

Since v1 [1]:
* Fold in Reviewed-by tags
* Move mmu_context.h comment change to patch 1

[1] https://lore.kernel.org/linux-arm-kernel/20230601100812.2303944-1-mark.rutland@arm.com/

Mark Rutland (4):
  arm64: standardise cpucap bitmap names
  arm64: alternatives: use cpucap naming
  arm64: cpufeature: use cpucap naming
  arm64: cpufeature: fold cpus_set_cap() into update_cpu_capabilities()

 arch/arm64/include/asm/alternative-macros.h | 54 ++++++++++-----------
 arch/arm64/include/asm/alternative.h        |  4 +-
 arch/arm64/include/asm/cpufeature.h         | 24 +++------
 arch/arm64/include/asm/irqflags.h           |  2 +-
 arch/arm64/include/asm/lse.h                |  2 +-
 arch/arm64/include/asm/mmu_context.h        |  2 +-
 arch/arm64/kernel/alternative.c             | 23 +++++----
 arch/arm64/kernel/cpufeature.c              | 53 ++++++++++----------
 8 files changed, 77 insertions(+), 87 deletions(-)

Comments

Catalin Marinas June 7, 2023, 5:21 p.m. UTC | #1
On Wed, 07 Jun 2023 17:48:42 +0100, Mark Rutland wrote:
> Currently arm64 uses inconsistent terminology when handling cpucaps,
> with different places in the code referring to these as "capabilities",
> "features", "cpufeatures", "hwcaps", and "cpu_hwcaps" with the latter
> two easily being confused with the ELF hwcaps.
> 
> Similarly, the bitmaps used to store the boot and system cpucaps are
> named "boot_capabilities" and "cpu_hwcaps" respectively.
> 
> [...]

Applied to arm64 (for-next/cpucap), thanks!

[1/4] arm64: standardise cpucap bitmap names
      https://git.kernel.org/arm64/c/7f242982e408
[2/4] arm64: alternatives: use cpucap naming
      https://git.kernel.org/arm64/c/5235c7e2cfcc
[3/4] arm64: cpufeature: use cpucap naming
      https://git.kernel.org/arm64/c/1c8ae42975bd
[4/4] arm64: cpufeature: fold cpus_set_cap() into update_cpu_capabilities()
      https://git.kernel.org/arm64/c/7dae5f086fce