Re: [PATCH v3] selftests: x86: skip the tests if prerequisites aren't fulfilled

From: Shuah Khan
Date: Thu Mar 28 2024 - 14:42:21 EST


On 3/27/24 05:17, Muhammad Usama Anjum wrote:
Skip instead of failing when prerequisite conditions aren't fulfilled,
such as invalid xstate values etc. This patch would make the tests show
as skip when run by:
make -C tools/testing/selftests/ TARGETS=x86 run_tests

...
# timeout set to 45
# selftests: x86: amx_64
# # xstate cpuid: invalid tile data size/offset: 0/0
ok 42 selftests: x86: amx_64 # SKIP
# timeout set to 45
# selftests: x86: lam_64
# # Unsupported LAM feature!
ok 43 selftests: x86: lam_64 # SKIP
...

In amx test, Move away from check_cpuid_xsave() and start using
arch_prctl() to find out if amx support is present or not. In the
kernels where amx isn't present, arch_prctl returns -EINVAL. Hence it is
backward compatible.

Reviewed-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx>
---
Changes since v2:
- Update the changelog


Thank you - applied to linux-kselftest next for 6.10-rc1

thanks,
-- Shuah