Skip to content

Commit 2ab3991

Browse files
suomilewissean-jc
authored andcommitted
KVM: selftests: Assert that both XTILE{CFG,DATA} are XSAVE-enabled
Assert that both XTILE{CFG,DATA} are written and read back via XSETBV and XGETBV respectively. The original check in amx_test only ensures at least one of the XTILE bits are set, XTILECFG or XTILEDATA, when it really should be checking that both are set. Fixes: bf70636 ("selftest: kvm: Add amx selftest") Signed-off-by: Aaron Lewis <aaronlewis@google.com> Signed-off-by: Mingwei Zhang <mizhang@google.com> Link: https://lore.kernel.org/r/20230221163655.920289-11-mizhang@google.com [sean: massage changelog] Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 7e1075f commit 2ab3991

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/kvm/x86_64/amx_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void init_regs(void)
161161
xcr0 = __xgetbv(0);
162162
xcr0 |= XFEATURE_MASK_XTILE;
163163
__xsetbv(0x0, xcr0);
164-
GUEST_ASSERT(__xgetbv(0) & XFEATURE_MASK_XTILE);
164+
GUEST_ASSERT((__xgetbv(0) & XFEATURE_MASK_XTILE) == XFEATURE_MASK_XTILE);
165165
}
166166

167167
static void __attribute__((__flatten__)) guest_code(struct tile_config *amx_cfg,

0 commit comments

Comments
 (0)