Re: [PATCH V2 1/7] arm64/perf: Add register definitions for BRBE

From: Anshuman Khandual
Date: Tue Sep 13 2022 - 02:24:25 EST



On 9/12/22 15:27, Mark Brown wrote:
> On Thu, Sep 08, 2022 at 10:40:40AM +0530, Anshuman Khandual wrote:
>
>> ---
>> arch/arm64/include/asm/sysreg.h | 222 ++++++++++++++++++++++++++++++++
>> 1 file changed, 222 insertions(+)
>
> Rather than manually encoding register definitions in sysreg.h
> can we add them to arch/arm64/tools/sysreg so that all the
> #defines and so on are generated instead?

SYS_[BRBINF<N>|BRBSRC<N>|BRBTGT<N>]_EL1 registers are encoded as per three
distinct formulas where <CRm> and <op2> are derived from corresponding <N>
Just wondering if those could be accommodated in arch/arm64/tools/sysreg ?

System register description via arch/arm64/tools/sysreg seems bit cryptic.
BTW, do we expect all existing sysreg definitions to move there ? Because
still there are many registers and their fields present in sysreg.h

Besides, there is also some benefit in being able to grep system registers
and their fields, across headers and implementations simultaneously.