Skip to content

Commit 48ad422

Browse files
mzhang3579sean-jc
authored andcommitted
KVM: selftests: Enable checking on xcomp_bv in amx_test
After tilerelease instruction, AMX tiles are in INIT state. According to Intel SDM vol 1. 13.10: "If RFBM[i] = 1, XSTATE_BV[i] is set to the value of XINUSE[i].", XSTATE_BV[18] should be cleared after xsavec. On the other hand, according to Intel SDM vol 1. 13.4.3: "If XCOMP_BV[i] = 1, state component i is located at a byte offset locationI from the base address of the XSAVE area". Since at the time of xsavec, XCR0[18] is set indicating AMX tile data component is still enabled, xcomp_bv[18] should be set. Complete the checks by adding the assert to xcomp_bv[18] after xsavec. Signed-off-by: Mingwei Zhang <mizhang@google.com> Link: https://lore.kernel.org/r/20230221163655.920289-5-mizhang@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent bec357a commit 48ad422

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static void __attribute__((__flatten__)) guest_code(struct tile_config *amx_cfg,
197197
xstate->header.xstate_bv = XFEATURE_MASK_XTILEDATA;
198198
__xsavec(xstate, XFEATURE_MASK_XTILEDATA);
199199
GUEST_ASSERT(!(xstate->header.xstate_bv & XFEATURE_MASK_XTILEDATA));
200+
GUEST_ASSERT(xstate->header.xcomp_bv & XFEATURE_MASK_XTILEDATA);
200201

201202
/* xfd=0x40000, disable amx tiledata */
202203
wrmsr(MSR_IA32_XFD, XFEATURE_MASK_XTILEDATA);

0 commit comments

Comments
 (0)