[PATCH 1/3] KVM: arm64: selftests: Count test_guest_reg_read() as a test

Ben Horgan ben.horgan at arm.com
Thu Oct 30 02:36:16 PDT 2025


Hi Oliver,

On 10/29/25 20:48, Oliver Upton wrote:
> On Tue, Oct 14, 2025 at 11:21:06AM +0100, Ben Horgan wrote:
>> The test test_guest_reg_read() is run without announcing its presence or
>> contributing to the test count. Rectify this.
>>
>> Signed-off-by: Ben Horgan <ben.horgan at arm.com>
>> ---
>>  tools/testing/selftests/kvm/arm64/set_id_regs.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/kvm/arm64/set_id_regs.c b/tools/testing/selftests/kvm/arm64/set_id_regs.c
>> index 5e24f77868b5..6878ee23310e 100644
>> --- a/tools/testing/selftests/kvm/arm64/set_id_regs.c
>> +++ b/tools/testing/selftests/kvm/arm64/set_id_regs.c
>> @@ -655,6 +655,8 @@ static void test_guest_reg_read(struct kvm_vcpu *vcpu)
>>  			TEST_FAIL("Unexpected ucall: %lu", uc.cmd);
>>  		}
>>  	}
>> +
>> +	ksft_test_result_pass("%s\n", __func__);
>>  }
>>  
>>  /* Politely lifted from arch/arm64/include/asm/cache.h */
>> @@ -786,7 +788,7 @@ int main(void)
>>  
>>  	ksft_print_header();
>>  
>> -	test_cnt = 3 + MPAM_IDREG_TEST + MTE_IDREG_TEST;
>> +	test_cnt = 4 + MPAM_IDREG_TEST + MTE_IDREG_TEST;
> 
> TBH, I'd actually be in favor of a patch that removes usage of the
> ksft_* harness from this test altogether. I don't think it adds much and
> we use the KVM-specific test assertions anyway.

I'll give this a go for a respin unless anyone pipes up to say the
ksft_* usage in this test is helpful for them.

> 
> Thanks,
> Oliver

-- 
Thanks,

Ben




More information about the linux-arm-kernel mailing list