Re: [PATCH RFC v2 9/9] selftests/x86/apx: Add APX test

From: Sohil Mehta
Date: Mon Apr 14 2025 - 12:03:15 EST


On 3/20/2025 4:43 PM, Chang S. Bae wrote:
> The extended general-purpose registers for APX may contain random data,
> which is currently assumed by the xstate testing framework. This allows
> the testing of the new userspace feature using the common test code.
>
> Invoke the test entry function from apx.c after enumerating the
> state component and adding it to the support list
>
> Signed-off-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
> ---

Reviewed-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>

AVX and APX have very similar single line testcases. If we end up adding
more, it might be useful to consider merging them into a common file.


> diff --git a/tools/testing/selftests/x86/apx.c b/tools/testing/selftests/x86/apx.c
> new file mode 100644
> index 000000000000..d9c8d41b8c5a
> --- /dev/null
> +++ b/tools/testing/selftests/x86/apx.c
> @@ -0,0 +1,10 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#define _GNU_SOURCE
> +
> +#include "xstate.h"
> +
> +int main(void)
> +{
> + test_xstate(XFEATURE_APX);
> +}