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

Oliver Upton oliver.upton at linux.dev
Wed Oct 29 13:48:24 PDT 2025


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.

Thanks,
Oliver



More information about the linux-arm-kernel mailing list