diff mbox series

[v2,2/2] KVM: selftests: Assert that XSAVE supports both XTILE{CFG,DATA}

Message ID 20221230013648.2850519-3-aaronlewis@google.com (mailing list archive)
State New, archived
Headers show
Series Fix check in amx_test | expand

Commit Message

Aaron Lewis Dec. 30, 2022, 1:36 a.m. UTC
The check in amx_test that ensures that XSAVE supports XTILE makes sure
at least one of the XTILE bits are set, XTILECFG or XTILEDATA, when it
really should be checking that both are set.

Assert that both XTILECFG and XTILEDATA a set.

Fixes: bf70636d9443 ("selftest: kvm: Add amx selftest")
Signed-off-by: Aaron Lewis <aaronlewis@google.com>
---
 tools/testing/selftests/kvm/x86_64/amx_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/x86_64/amx_test.c b/tools/testing/selftests/kvm/x86_64/amx_test.c
index 2f555f5c93e99..db1b38ca7c840 100644
--- a/tools/testing/selftests/kvm/x86_64/amx_test.c
+++ b/tools/testing/selftests/kvm/x86_64/amx_test.c
@@ -121,7 +121,7 @@  static inline void check_cpuid_xsave(void)
 
 static inline void check_xsave_supports_xtile(void)
 {
-	GUEST_ASSERT(__xgetbv(0) & XFEATURE_MASK_XTILE);
+	GUEST_ASSERT((__xgetbv(0) & XFEATURE_MASK_XTILE) == XFEATURE_MASK_XTILE);
 }
 
 static void check_xtile_info(void)