public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] KVM: selftests: Add test of SET_NESTED_STATE with 48-bit L2 on 57-bit L1
@ 2025-09-17 21:48 Jim Mattson
  2025-09-17 21:48 ` [PATCH 1/4] KVM: selftests: Use a loop to create guest page tables Jim Mattson
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Jim Mattson @ 2025-09-17 21:48 UTC (permalink / raw)
  To: Paolo Bonzini, Shuah Khan, Sean Christopherson, Bibo Mao,
	Huacai Chen, Andrew Jones, Claudio Imbrenda, Pratik R. Sampat,
	Kai Huang, Eric Auger, linux-kernel, kvm, linux-kselftest
  Cc: Jim Mattson

Prior to commit 9245fd6b8531 ("KVM: x86: model canonical checks more
precisely"), KVM_SET_NESTED_STATE would fail if the state was captured
with L2 active, L1 had CR4.LA57 set, L2 did not, and the
VMCS12.HOST_GSBASE (or other host-state field checked for canonicality)
had an address greater than 48 bits wide.

Add a regression test that reproduces the KVM_SET_NESTED_STATE failure
conditions. To do so, the first three patches add support for 5-level
paging in the selftest L1 VM.

Jim Mattson (4):
  KVM: selftests: Use a loop to create guest page tables
  KVM: selftests: Use a loop to walk guest page tables
  KVM: selftests: Add VM_MODE_PXXV57_4K VM mode
  KVM: selftests: Add a VMX test for LA57 nested state

 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../testing/selftests/kvm/include/kvm_util.h  |   1 +
 tools/testing/selftests/kvm/lib/kvm_util.c    |  21 +++
 .../testing/selftests/kvm/lib/x86/processor.c |  66 ++++-----
 tools/testing/selftests/kvm/lib/x86/vmx.c     |   7 +-
 .../kvm/x86/vmx_la57_nested_state_test.c      | 137 ++++++++++++++++++
 6 files changed, 195 insertions(+), 38 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86/vmx_la57_nested_state_test.c

-- 
2.51.0.470.ga7dc726c21-goog


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-10-22 18:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 21:48 [PATCH 0/4] KVM: selftests: Add test of SET_NESTED_STATE with 48-bit L2 on 57-bit L1 Jim Mattson
2025-09-17 21:48 ` [PATCH 1/4] KVM: selftests: Use a loop to create guest page tables Jim Mattson
2025-10-20 17:10   ` Yosry Ahmed
2025-09-17 21:48 ` [PATCH 2/4] KVM: selftests: Use a loop to walk " Jim Mattson
2025-10-20 17:21   ` Yosry Ahmed
2025-10-21 22:11     ` Jim Mattson
2025-10-21 22:24       ` Yosry Ahmed
2025-09-17 21:48 ` [PATCH 3/4] KVM: selftests: Add VM_MODE_PXXV57_4K VM mode Jim Mattson
2025-10-15 21:23   ` Yosry Ahmed
2025-10-21 22:34     ` Jim Mattson
2025-10-21 22:56       ` Yosry Ahmed
2025-10-15 21:25   ` Yosry Ahmed
2025-10-15 22:58     ` Sean Christopherson
2025-10-15 22:59   ` Sean Christopherson
2025-10-16  0:40     ` Sean Christopherson
2025-10-21 22:37       ` Jim Mattson
2025-09-17 21:48 ` [PATCH 4/4] KVM: selftests: Add a VMX test for LA57 nested state Jim Mattson
2025-10-20 17:26   ` Yosry Ahmed
2025-10-21 23:40     ` Jim Mattson
2025-10-22 18:07       ` Yosry Ahmed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox