summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorMingwei Zhang <mizhang@google.com>2023-02-21 16:36:47 +0000
committerSean Christopherson <seanjc@google.com>2023-03-24 14:21:37 -0700
commit0aeb9729486a32fab168114b00006b2643aa8a41 (patch)
tree67068f3c807858093912d22aa8c7268b59ab6c74 /tools/testing
parent48ad4222c43ceb5ce303758ff26e1d8c881502ac (diff)
downloadlinux-stable-0aeb9729486a32fab168114b00006b2643aa8a41.tar.gz
linux-stable-0aeb9729486a32fab168114b00006b2643aa8a41.tar.bz2
linux-stable-0aeb9729486a32fab168114b00006b2643aa8a41.zip
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>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/kvm/x86_64/amx_test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/amx_test.c b/tools/testing/selftests/kvm/x86_64/amx_test.c
index 34cf6f253c13..95a30611e03e 100644
--- a/tools/testing/selftests/kvm/x86_64/amx_test.c
+++ b/tools/testing/selftests/kvm/x86_64/amx_test.c
@@ -216,6 +216,7 @@ void guest_nm_handler(struct ex_regs *regs)
{
/* Check if #NM is triggered by XFEATURE_MASK_XTILEDATA */
GUEST_SYNC(7);
+ GUEST_ASSERT(!(get_cr0() & X86_CR0_TS));
GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA);
GUEST_SYNC(8);
GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA);