[PATCH 2/3] KVM: arm64: selftests: Remove ARM64_FEATURE_FIELD_BITS and its last user

Ben Horgan ben.horgan at arm.com
Thu Oct 30 02:40:00 PDT 2025


Hi Oliver,

On 10/29/25 20:45, Oliver Upton wrote:
> Hi Ben,
> 
> On Tue, Oct 14, 2025 at 11:21:07AM +0100, Ben Horgan wrote:
>> ARM64_FEATURE_FIELD_BITS is set to 4 but not all ID register fields are 4
>> bits. See for instance ID_AA64SMFR0_EL1. The last user of this define,
>> ARM64_FEATURE_FIELD_BITS, is the set_id_regs selftest. Its logic assumes
>> the fields aren't a single bits; assert that's the case and stop using the
>> define. As there are no more users, ARM64_FEATURE_FIELD_BITS is removed.
>>
>> Signed-off-by: Ben Horgan <ben.horgan at arm.com>
>> ---
>>  arch/arm64/include/asm/sysreg.h                 | 2 --
>>  tools/testing/selftests/kvm/arm64/set_id_regs.c | 8 ++++++--
>>  2 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
>> index 6455db1b54fd..d9aa76d08e13 100644
>> --- a/arch/arm64/include/asm/sysreg.h
>> +++ b/arch/arm64/include/asm/sysreg.h
>> @@ -1129,8 +1129,6 @@
>>  #define gicr_insn(insn)			read_sysreg_s(GICV5_OP_GICR_##insn)
>>  #define gic_insn(v, insn)		write_sysreg_s(v, GICV5_OP_GIC_##insn)
>>  
>> -#define ARM64_FEATURE_FIELD_BITS	4
>> -
>>  #ifdef __ASSEMBLY__
>>  
>>  	.macro	mrs_s, rt, sreg
> 
> You can send this diff as a separate patch. Selftests actually uses the
> definition from tools/arch/arm64/include/asm/sysreg.h, so you'll want to
> drop that definition along with the change to set_id_regs.

Thanks for the pointers. I'll do as you suggest.

> 
> Thanks,
> Oliver
> 

-- 
Thanks,

Ben




More information about the linux-arm-kernel mailing list