mbox series

[v2,0/4] arm64/sysreg: Get rid of *_ELx as fields for EL12 accessors

Message ID 20241219173351.1123087-1-maz@kernel.org (mailing list archive)
Headers show
Series arm64/sysreg: Get rid of *_ELx as fields for EL12 accessors | expand

Message

Marc Zyngier Dec. 19, 2024, 5:33 p.m. UTC
We keep adding *_ELx definition to the sysreg as an abstraction for
the mapping between an EL1 register and its EL12 counterpart.

But nothing in the architecture has these ELx suffixes to describe
such abstraction. When they are mentioned, it always is as a shortcut
for EL1, EL2 or EL3, and never for EL12. That's because *_EL12 are
*not* registers. They are accessors, nothing else. So what we
currently have is not only bizarre, it is actively wrong.

This small series aims are injecting some sanity, by explicitly
describing EL12 registers as mappings to EL1 registers, and keeping
the ELx description as fields for the EL{1,2} registers.

* From v1:

  - Fixed the description in the first patch following Mark's proposal

  - Couple of spelling funnies being fixed

  - Collected Acks and RBs.

Marc Zyngier (4):
  arm64/sysreg: Allow a 'Mapping' descriptor for system registers
  arm64/sysreg: Get rid of the TCR2_EL1x SysregFields
  arm64/sysreg: Convert *_EL12 accessors to Mapping
  arm64/sysreg: Get rid of CPACR_ELx SysregFields

 arch/arm64/include/asm/el2_setup.h      |  6 ++--
 arch/arm64/include/asm/kvm_arm.h        |  2 --
 arch/arm64/include/asm/kvm_emulate.h    | 40 +++++++++++-----------
 arch/arm64/include/asm/kvm_nested.h     |  8 ++---
 arch/arm64/kernel/cpufeature.c          |  4 +--
 arch/arm64/kvm/at.c                     |  6 ++--
 arch/arm64/kvm/emulate-nested.c         |  2 +-
 arch/arm64/kvm/fpsimd.c                 |  2 +-
 arch/arm64/kvm/hyp/include/hyp/switch.h |  4 +--
 arch/arm64/kvm/hyp/nvhe/hyp-main.c      |  4 +--
 arch/arm64/kvm/hyp/nvhe/pkvm.c          |  2 +-
 arch/arm64/kvm/hyp/nvhe/switch.c        |  6 ++--
 arch/arm64/kvm/hyp/vhe/switch.c         | 16 ++++-----
 arch/arm64/mm/proc.S                    |  5 +--
 arch/arm64/tools/gen-sysreg.awk         |  2 +-
 arch/arm64/tools/sysreg                 | 44 ++++++++++++-------------
 16 files changed, 76 insertions(+), 77 deletions(-)

Comments

Will Deacon Dec. 19, 2024, 7:47 p.m. UTC | #1
On Thu, 19 Dec 2024 17:33:46 +0000, Marc Zyngier wrote:
> We keep adding *_ELx definition to the sysreg as an abstraction for
> the mapping between an EL1 register and its EL12 counterpart.
> 
> But nothing in the architecture has these ELx suffixes to describe
> such abstraction. When they are mentioned, it always is as a shortcut
> for EL1, EL2 or EL3, and never for EL12. That's because *_EL12 are
> *not* registers. They are accessors, nothing else. So what we
> currently have is not only bizarre, it is actively wrong.
> 
> [...]

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

[1/4] arm64/sysreg: Allow a 'Mapping' descriptor for system registers
      https://git.kernel.org/arm64/c/078bc96539c3
[2/4] arm64/sysreg: Get rid of the TCR2_EL1x SysregFields
      https://git.kernel.org/arm64/c/7052e808c446
[3/4] arm64/sysreg: Convert *_EL12 accessors to Mapping
      https://git.kernel.org/arm64/c/233fc36bb5a2
[4/4] arm64/sysreg: Get rid of CPACR_ELx SysregFields
      https://git.kernel.org/arm64/c/e5ecedcd7cc2

Cheers,