KVM: selftests: Add a fully functional "struct xstate" for x86
authorMingwei Zhang <mizhang@google.com>
Tue, 21 Feb 2023 16:36:44 +0000 (16:36 +0000)
committerSean Christopherson <seanjc@google.com>
Fri, 24 Mar 2023 21:21:36 +0000 (14:21 -0700)
commit5de4a3765b7e703374aa955662bba67475a7ac92
treeae47e20a033154af12c0b886a1f12e8c9ff3fc0d
parent735b0e0f2d001b7ed9486db84453fb860e764a4d
KVM: selftests: Add a fully functional "struct xstate" for x86

Add a working xstate data structure for the usage of AMX and potential
future usage on other xstate components. AMX selftest requires checking
both the xstate_bv and xcomp_bv. Existing code relies on pointer
arithmetics to fetch xstate_bv and does not support xcomp_bv.

So, add a working xstate data structure into processor.h for x86.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Mingwei Zhang <mizhang@google.com>
Link: https://lore.kernel.org/r/20230221163655.920289-3-mizhang@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/x86_64/amx_test.c