[PATCH v5 3/7] arm64/sysreg/tools: Move TRFCR definitions to sysreg
James Clark
james.clark at arm.com
Wed Feb 21 02:10:18 PST 2024
On 20/02/2024 16:11, Mark Brown wrote:
> On Tue, Feb 20, 2024 at 10:09:13AM +0000, James Clark wrote:
>> Add separate definitions for ELx and EL2 as TRFCR_EL1 doesn't have CX.
>> This also mirrors the previous definition so no code change is required.
>
> This is also converting to automatic generation in the process.
>
>> +SysregFields TRFCR_EL2
>> +Res0 63:7
>> +UnsignedEnum 6:5 TS
>> + 0b0000 USE_TRFCR_EL1_TS
>> + 0b0001 VIRTUAL
>> + 0b0010 GUEST_PHYSICAL
>> + 0b0011 PHYSICAL
>> +EndEnum
>> +Res0 4
>> +Field 3 CX
>> +Res0 2
>> +Field 1 E2TRE
>> +Field 0 E0HTRE
>> +EndSysregFields
>
> This has exactly one user and I'd not expect more so why have a separate
> SysregFields?
>
No reason, probably just a copy paste thing. I'll change it to a Sysreg.
>> +# TRFCR_EL1 doesn't have the CX bit so redefine it without CX instead of
>> +# using a shared definition between TRFCR_EL2 and TRFCR_EL1
>
> This comment is reflecting the default state?
>
True, will remove.
>> +Sysreg TRFCR_EL1 3 0 1 2 1
>> +Fields TRFCR_ELx
>> +EndSysreg
>> +
>> +Sysreg TRFCR_EL2 3 4 1 2 1
>> +Fields TRFCR_EL2
>> +EndSysreg
>> +
>> +Sysreg TRFCR_EL12 3 5 1 2 1
>> +Fields TRFCR_ELx
>> +EndSysreg
>
> These are generally sorted by encoding (simiarly to how sysreg.h was
> sorted historically).
Ah I didn't know that. Can I add a comment to the top of the file saying
that it should be kept sorted?
More information about the linux-arm-kernel
mailing list