When running a SPR guest without AMX enabled CPUID.(EAX=0DH,ECX=0):EAX.XTILE_CFG[bit-17] will be set and CPUID.(EAX=0DH,ECX=0):EAX.XTILE_DATA[bit-18] will be clear. While this is architecturally correct it can be a little awkward for userspace or a guest when using them. Instead of leaving the CPUID leaf in a half baked state, either clear them both or leave them both set. Additionally, add testing to verify the CPUID isn't in such a state. Aaron Lewis (3): KVM: x86: Clear XTILE_CFG if XTILE_DATA is clear KVM: selftests: Hoist XGETBV and XSETBV to make them more accessible KVM: selftests: Add XCR0 Test arch/x86/kvm/cpuid.c | 4 + tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/include/x86_64/processor.h | 19 +++ tools/testing/selftests/kvm/x86_64/amx_test.c | 24 +--- .../selftests/kvm/x86_64/xcr0_cpuid_test.c | 134 ++++++++++++++++++ 5 files changed, 161 insertions(+), 21 deletions(-) create mode 100644 tools/testing/selftests/kvm/x86_64/xcr0_cpuid_test.c -- 2.39.0.314.g84b9a713c41-goog