diff mbox series

[2/5] KVM: selftests: Assert that both XTILE{CFG,DATA} are XSAVE-enabled

Message ID 20230217215959.1569092-3-aaronlewis@google.com (mailing list archive)
State New, archived
Headers show
Series Overhauling amx_test, part 2 | expand

Commit Message

Aaron Lewis Feb. 17, 2023, 9:59 p.m. UTC
The check in amx_test that ensures that XTILE is XSAVE-enabled 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 7ee8b68064000..27889e5acbedb 100644
--- a/tools/testing/selftests/kvm/x86_64/amx_test.c
+++ b/tools/testing/selftests/kvm/x86_64/amx_test.c
@@ -175,7 +175,7 @@  static void init_regs(void)
 	xcr0 = __xgetbv(0);
 	xcr0 |= XFEATURE_MASK_XTILE;
 	__xsetbv(0x0, xcr0);
-	GUEST_ASSERT(__xgetbv(0) & XFEATURE_MASK_XTILE);
+	GUEST_ASSERT((__xgetbv(0) & XFEATURE_MASK_XTILE) == XFEATURE_MASK_XTILE);
 }
 
 static void __attribute__((__flatten__)) guest_code(struct tile_config *amx_cfg,