diff options
author | Mingwei Zhang <mizhang@google.com> | 2023-02-21 16:36:48 +0000 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-03-24 14:21:38 -0700 |
commit | 9cbd9aaa670f7be61ba569f5c3ebafc2e0aabeb6 (patch) | |
tree | 85a899fd6add11679e274e74f3d4bf336b27898d /tools/testing/selftests/kvm/x86_64/amx_test.c | |
parent | 0aeb9729486a32fab168114b00006b2643aa8a41 (diff) |
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>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/amx_test.c')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/amx_test.c | 2 |
1 files changed, 2 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 95a30611e03e..cd0491cc7c8c 100644 --- a/tools/testing/selftests/kvm/x86_64/amx_test.c +++ b/tools/testing/selftests/kvm/x86_64/amx_test.c @@ -218,8 +218,10 @@ void guest_nm_handler(struct ex_regs *regs) GUEST_SYNC(7); GUEST_ASSERT(!(get_cr0() & X86_CR0_TS)); GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA); + GUEST_ASSERT(rdmsr(MSR_IA32_XFD) == XFEATURE_MASK_XTILEDATA); GUEST_SYNC(8); GUEST_ASSERT(rdmsr(MSR_IA32_XFD_ERR) == XFEATURE_MASK_XTILEDATA); + GUEST_ASSERT(rdmsr(MSR_IA32_XFD) == XFEATURE_MASK_XTILEDATA); /* Clear xfd_err */ wrmsr(MSR_IA32_XFD_ERR, 0); /* xfd=0, enable amx */ |