linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] arm64/cpufeature: Make use of sysreg helpers for hwcaps
@ 2022-12-27 12:55 Mark Brown
  2022-12-27 12:55 ` [PATCH v3 1/7] arm64/cpufeature: Fix field sign for DIT hwcap detection Mark Brown
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Mark Brown @ 2022-12-27 12:55 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Suzuki K Poulose, James Morse, Mark Rutland, linux-arm-kernel,
	Mark Brown

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.

There is no difference in the .rodata generated before and after these
changes other than the single byte changed from 0 to 1 which is expected
due to the first patch fixing the declared sign for ID_AA64PFR0_EL1.DIT.

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

v3:
- Rebase onto v6.2-rc1.
- Link to v2: https://lore.kernel.org/r/20221207-arm64-sysreg-helpers-v2-0-19f0e63dbb36@kernel.org
v2:
- Also add an explicit UnsignedEnum and don't generate sign defines for
  unannotated enums.
- Annotate the unsigned enums that we use.
- Rename the new defines from _SIGN to _SIGNED.
- Commit message rewording and thinko fixes.
- Link to v1: https://lore.kernel.org/r/20221207-arm64-sysreg-helpers-v1-0-149fa1308a23@kernel.org

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

---
Mark Brown (7):
      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 or unsigned
      arm64/sysreg: Initial annotation of signed ID registers
      arm64/sysreg: Initial unsigned annotations for ID registers
      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 |  29 +++
 arch/arm64/tools/sysreg         | 380 ++++++++++++++++++++--------------------
 3 files changed, 306 insertions(+), 284 deletions(-)
---
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
change-id: 20221207-arm64-sysreg-helpers-6734642b7fb9

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-01-12 17:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-27 12:55 [PATCH v3 0/7] arm64/cpufeature: Make use of sysreg helpers for hwcaps Mark Brown
2022-12-27 12:55 ` [PATCH v3 1/7] arm64/cpufeature: Fix field sign for DIT hwcap detection Mark Brown
2022-12-27 12:55 ` [PATCH v3 2/7] arm64/sysreg: Fix errors in 32 bit enumeration values Mark Brown
2022-12-27 12:55 ` [PATCH v3 3/7] arm64/sysreg: Allow enumerations to be declared as signed or unsigned Mark Brown
2022-12-27 12:55 ` [PATCH v3 4/7] arm64/sysreg: Initial annotation of signed ID registers Mark Brown
2022-12-27 12:55 ` [PATCH v3 5/7] arm64/sysreg: Initial unsigned annotations for " Mark Brown
2022-12-27 12:55 ` [PATCH v3 6/7] arm64/cpufeature: Always use symbolic name for feature value in hwcaps Mark Brown
2022-12-27 12:56 ` [PATCH v3 7/7] arm64/cpufeature: Use helper macros to specify hwcaps Mark Brown
2023-01-11 18:26 ` [PATCH v3 0/7] arm64/cpufeature: Make use of sysreg helpers for hwcaps Catalin Marinas
2023-01-11 18:53   ` Mark Brown
2023-01-12 17:51 ` (subset) " Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).