Skip to content

Commit 078bc96

Browse files
Marc Zyngierwilldeacon
authored andcommitted
arm64/sysreg: Allow a 'Mapping' descriptor for system registers
*EL02 and *_EL12 system registers are actually only accessors for EL0 and EL1 registers accessed from EL2 when HCR_EL2.E2H==1. They do not have fields of their own. To that effect, introduce a 'Mapping' entry, describing which system register an _EL12 register maps to. Implementation wise, this is handled the same was as Fields, which ls only a comment. Acked-by: Mark Rutland <[email protected]> Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent e52163d commit 078bc96

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

arch/arm64/tools/gen-sysreg.awk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ END {
206206

207207
# Currently this is effectivey a comment, in future we may want to emit
208208
# defines for the fields.
209-
/^Fields/ && block_current() == "Sysreg" {
209+
(/^Fields/ || /^Mapping/) && block_current() == "Sysreg" {
210210
expect_fields(2)
211211

212212
if (next_bit != 63)

arch/arm64/tools/sysreg

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@
2424
# ...
2525
# EndEnum
2626

27-
# Alternatively if multiple registers share the same layout then
28-
# a SysregFields block can be used to describe the shared layout
27+
# For VHE aliases (*_EL12, *_EL02) of system registers, a Mapping
28+
# entry describes the register the alias actually accesses:
29+
30+
# Sysreg <name_EL12> <op0> <op1> <crn> <crm> <op2>
31+
# Mapping <name_EL1>
32+
# EndSysreg
33+
34+
# Where multiple system regsiters are not VHE aliases but share a
35+
# common layout, a SysregFields block can be used to describe the
36+
# shared layout:
2937

3038
# SysregFields <fieldsname>
3139
# <field>

0 commit comments

Comments
 (0)