Skip to content

Commit 9cbd9aa

Browse files
mzhang3579sean-jc
authored andcommitted
KVM: selftests: Assert that XTILE_DATA is set in IA32_XFD on #NM
Add an extra check to IA32_XFD to ensure that XTILE_DATA is actually set, i.e. is consistent with the AMX architecture. In addition, repeat the checks after the guest/host world switch to ensure the values of IA32_XFD and IA32_XFD_ERR are well preserved. Signed-off-by: Mingwei Zhang <mizhang@google.com> Link: https://lore.kernel.org/r/20230221163655.920289-7-mizhang@google.com [sean: massage changelog] Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 0aeb972 commit 9cbd9aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,10 @@ void guest_nm_handler(struct ex_regs *regs)
218218
GUEST_SYNC(7);
219219
GUEST_ASSERT(!(get_cr0() & X86_CR0_TS));
220220
GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA);
221+
GUEST_ASSERT(rdmsr(MSR_IA32_XFD) == XFEATURE_MASK_XTILEDATA);
221222
GUEST_SYNC(8);
222223
GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA);
224+
GUEST_ASSERT(rdmsr(MSR_IA32_XFD) == XFEATURE_MASK_XTILEDATA);
223225
/* Clear xfd_err */
224226
wrmsr(MSR_IA32_XFD_ERR, 0);
225227
/* xfd=0, enable amx */

0 commit comments

Comments
 (0)