Loading
x86/selftests: Skip the tests if prerequisites aren't fulfilled
mainline inclusion from mainline-v6.10-rc1 commit 99c84311e35f9399bdce666f6306a048e2a5b404 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5O23 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=99c84311e35f9399bdce666f6306a048e2a5b404 -------------------------------- Skip instead of failing when prerequisite conditions aren't fulfilled, such as invalid xstate values etc. Make the tests show as 'SKIP' when run: 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 the 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. Signed-off-by:Muhammad Usama Anjum <usama.anjum@collabora.com> Signed-off-by:
Ingo Molnar <mingo@kernel.org> Reviewed-by:
Chang S. Bae <chang.seok.bae@intel.com> Reviewed-by:
Binbin Wu <binbin.wu@linux.intel.com> Acked-by:
Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Link: https://lore.kernel.org/r/20240327111720.3509180-1-usama.anjum@collabora.com Signed-off-by:
Jiangshan Yi <yijiangshan@kylinos.cn>