From: Marc Zyngier <maz@kernel.org>
To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Joey Gouly <joey.gouly@arm.com>, Mark Brown <broonie@kernel.org>
Subject: [PATCH 1/4] arm64/sysreg: Allow a 'Mapping' descriptor for system registers
Date: Sat, 7 Dec 2024 19:07:37 +0000 [thread overview]
Message-ID: <20241207190740.2607673-2-maz@kernel.org> (raw)
In-Reply-To: <20241207190740.2607673-1-maz@kernel.org>
*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.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/tools/gen-sysreg.awk | 2 +-
arch/arm64/tools/sysreg | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
index d1254a056114e..1a2afc9fdd42e 100755
--- a/arch/arm64/tools/gen-sysreg.awk
+++ b/arch/arm64/tools/gen-sysreg.awk
@@ -206,7 +206,7 @@ END {
# Currently this is effectivey a comment, in future we may want to emit
# defines for the fields.
-/^Fields/ && block_current() == "Sysreg" {
+(/^Fields/ || /^Mapping/) && block_current() == "Sysreg" {
expect_fields(2)
if (next_bit != 63)
diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
index b081b54d6d227..b6846c601df6c 100644
--- a/arch/arm64/tools/sysreg
+++ b/arch/arm64/tools/sysreg
@@ -38,6 +38,13 @@
# Fields <fieldsname>
# EndSysreg
+# For register names indicating a cross-EL access (*_EL12, *EL02),
+# a Mapping entry describes the register it actually accesses:
+
+# Sysreg <name_EL12> <op0> <op1> <crn> <crm> <op2>
+# Mapping <name_EL1>
+# EndSysreg
+
# For ID registers we adopt a few conventions for translating the
# language in the ARM into defines:
#
--
2.39.2
next prev parent reply other threads:[~2024-12-07 19:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 19:07 [PATCH 0/4] arm64/sysreg: Get rid of *_ELx as fields for EL12 accessors Marc Zyngier
2024-12-07 19:07 ` Marc Zyngier [this message]
2024-12-09 13:56 ` [PATCH 1/4] arm64/sysreg: Allow a 'Mapping' descriptor for system registers Mark Rutland
2024-12-09 14:05 ` Mark Brown
2024-12-07 19:07 ` [PATCH 2/4] arm64/sysreg: Get rid of the TCR2_EL1x SysregFields Marc Zyngier
2024-12-09 13:57 ` Mark Rutland
2024-12-07 19:07 ` [PATCH 3/4] arm64/sysreg: Convert *_EL12 accessors to Mapping Marc Zyngier
2024-12-09 13:59 ` Mark Rutland
2024-12-09 14:22 ` Mark Brown
2024-12-07 19:07 ` [PATCH 4/4] arm64/sysreg: Get rid of CPACR_ELx SysregFields Marc Zyngier
2024-12-09 14:01 ` Mark Rutland
2024-12-09 14:50 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241207190740.2607673-2-maz@kernel.org \
--to=maz@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).