[PATCH 3/4] arm64/sysreg: Add TCR_EL2 register

Marc Zyngier maz at kernel.org
Tue Aug 19 01:29:07 PDT 2025


On Tue, 19 Aug 2025 06:58:51 +0100,
Anshuman Khandual <anshuman.khandual at arm.com> wrote:
> 
> On 18/08/25 9:13 PM, Marc Zyngier wrote:
> > On Mon, 18 Aug 2025 05:57:58 +0100,
> > Anshuman Khandual <anshuman.khandual at arm.com> wrote:
> >>
> >> Add TCR_EL2 register fields as per the latest ARM ARM DDI 0487 7.B in tools
> > 
> > 7.B??? My copy of the published ARM ARM has L.B as the version suffix.
> 
> Right, the version is L.B instead.
> > 
> > Also, if you got the registers from the ARM ARM, please stop doing
> > so. This is terribly error prone, and likely to be incomplete, given
> > that the ARM ARM lags about a year behind the published architecture.
> > 
> > You have the BSD-licensed MRS at your disposal, please make use of it.
> 
> I guess you are suggesting the latest layout from the XML. Sure will refer
> the layout from the following description.
> 
> https://developer.arm.com/documentation/ddi0601/2025-06/AArch64-Registers/TCR-EL2--Translation-Control-Register--EL2-

This not what I have said. Read this for a start:

https://developer.arm.com/documentation/ddi0601/2025-06/Proprietary-Notice?lang=en

The XML is *NOT* usable to generate Linux descriptions, full stop. If
you don't believe me, ask your favourite legal department.

What I'm asking you to do is to:

- Download https://developer.arm.com/-/cdn-downloads/permalink/Exploration-Tools-OS-Machine-Readable-Data/AARCHMRS_BSD/AARCHMRS_OPENSOURCE_A_profile-2025-06.tar.gz
  (which is BSD-licensed)

- Parse the JSON files to *extract* the information -- not copy/paste
  it or write it by hand. See
  https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/getting-started-aarchmrs-features-json-python
  as an example

- If you can't be bothered to write your own script, have a look at:
  git://git.kernel.org/pub/scm/linux/kernel/git/maz/AARCHMRS (the
  'tooling' branch).

[...]

> > This is only the E2H==0 version of TCR_EL2. IF you are going to
> > describe this register in a useful manner, then add both formats so
> > that we know what we are dealing with.
> 
> IIUC two different runtime layouts for TCR_EL2 is not possible to be
> defined in current tools sysreg format.

Then the tool is broken. Fix the tool. You have the same problem with
CNTHCTL_EL2, for example, and turning a blind eye is not going to
help.

> Also one layout is not just a larger extension of the other - in
> which cases we could have just defined the larger layout.
>
> But curious do we have use cases for bits from the other layout now ?

I don't. But given what you suggested in your reply to patch #2, this
would become an absolute requirement.

	M.

-- 
Jazz isn't dead. It just smells funny.



More information about the linux-arm-kernel mailing list