Skip to content

Commit 0aeb972

Browse files
mzhang3579sean-jc
authored andcommitted
KVM: selftests: Add check of CR0.TS in the #NM handler in amx_test
Be extra paranoid and assert that CR0.TS is clear when verifying the #NM in the AMX test is due to the expected XFeature Disable error, i.e. that the #NM isn't due to CR0.TS=1. Signed-off-by: Mingwei Zhang <mizhang@google.com> Link: https://lore.kernel.org/r/20230221163655.920289-6-mizhang@google.com [sean: reword changelog to make it clear this is pure paranoia] Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 48ad422 commit 0aeb972

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
@@ -216,6 +216,7 @@ void guest_nm_handler(struct ex_regs *regs)
216216
{
217217
/* Check if #NM is triggered by XFEATURE_MASK_XTILEDATA */
218218
GUEST_SYNC(7);
219+
GUEST_ASSERT(!(get_cr0() & X86_CR0_TS));
219220
GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA);
220221
GUEST_SYNC(8);
221222
GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA);

0 commit comments

Comments
 (0)