[PATCH 0/6] arm64/cpufeature: Make use of sysreg helpers for hwcaps

Mark Brown broonie at kernel.org
Thu Dec 8 08:03:21 PST 2022


Now that all the ID registers we use have been converted to automatic
register generation we can start to make use of the regular definitions
we have for the registers and their bitfields to make the hwcap tables
easier to write and review.  This series does that, updating the macros
used to generate the hwcaps to provide what should be clearer and less
error prone specifications for the hwcaps.  We move from specifying like
this:

      HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_EL1_BT_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_EL1_BT_IMP, CAP_HWCAP, KERNEL_HWCAP_BTI),

to this:

      HWCAP_CAP(ID_AA64PFR1_EL1, BT, IMP, CAP_HWCAP, KERNEL_HWCAP_BTI),

which is shorter due to having less duplicate information and makes it
much harder to make an error like specifying the wrong field width or
an invalid enumeration value since everything must be a constant defined
for the sysreg and names are only typed once.

I'm posting it now in the hope of getting some review before v6.2-rc1
comes around, changing this will cause dependency issues for any series
adding new features so if we're going to do it it's probably helpful to
get it merged relatively early.

While doing this I found some errors which I have previously posted,
I've rolled those fixes into this series for simplicity.

To: Catalin Marinas <catalin.marinas at arm.com>
To: Will Deacon <will at kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose at arm.com>
Cc: James Morse <james.morse at arm.com>
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Mark Brown <broonie at kernel.org>

---
Mark Brown (6):
      arm64/cpufeature: Fix field sign for DIT hwcap detection
      arm64/sysreg: Fix errors in 32 bit enumeration values
      arm64/sysreg: Allow enumerations to be declared as signed
      arm64/sysreg: Annotate signed enumerations
      arm64/cpufeature: Always use symbolic name for feature value in hwcaps
      arm64/cpufeature: Use helper macros to specify hwcaps

 arch/arm64/kernel/cpufeature.c  | 181 +++++++++++++++++++---------------------
 arch/arm64/tools/gen-sysreg.awk |  18 ++++
 arch/arm64/tools/sysreg         |  12 +--
 3 files changed, 111 insertions(+), 100 deletions(-)
---
base-commit: 5f4c374760b031f06c69c2fdad1b0e981a1ad42f
change-id: 20221207-arm64-sysreg-helpers-6734642b7fb9

Best regards,
-- 
Mark Brown <broonie at kernel.org>



More information about the linux-arm-kernel mailing list