All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 00/14] Run access test in an L2 guest
@ 2021-11-10 21:19 Aaron Lewis
  2021-11-10 21:19 ` [kvm-unit-tests PATCH 01/14] x86: cleanup handling of 16-byte GDT descriptors Aaron Lewis
                   ` (14 more replies)
  0 siblings, 15 replies; 20+ messages in thread
From: Aaron Lewis @ 2021-11-10 21:19 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, jmattson, seanjc, Aaron Lewis

The motivation behind this change is to test the routing logic when an
exception occurs in an L2 guest and ensure the exception goes to the
correct place.  For example, if an exception occurs in L2, does L1 want
to get involved, or L0, or do niether of them care about it and leave
it to L2 to handle.  Test that the exception doesn't end up going to L1
When L1 didn't ask for it.  This was occurring before commit 18712c13709d
("KVM: nVMX: Use vmx_need_pf_intercept() when deciding if L0 wants a #PF")
fixed the issue.  Without that fix, running
vmx_pf_exception_test_reduced_maxphyaddr with allow_smaller_maxphyaddr=Y
would have resulted in the test failing with the following error:

x86/vmx_tests.c:10698: assert failed: false: Unexpected exit to L1,
exit_reason: VMX_EXC_NMI (0x0)

This series only tests the routing logic for #PFs.  A future
series will address other exceptions, however, getting #PF testing in
place is a big enough chunk that the other exceptions will be submitted
seperately (in a future series).

This series is dependant on Paolo's changes (inlcuded). Without them,
running ac_test_run() on one of the userspace test fails.  Of note:  the
commit ("x86: get rid of ring0stacktop") has been updated to include a fix
for a compiler error to get it building on clang.

This series is also dependant on the commit ("x86: Look up the PTEs rather
than assuming them").  This was sent out for review seperately, however,
it is needed to get ac_test_run() running on a different cr3 than the one
access_test runs on, so it is included here as well.  This is also v2 of
that commit.  While preparing this series a review came in, so I just
included the changes here.

Paolo Bonzini (9):
  x86: cleanup handling of 16-byte GDT descriptors
  x86: fix call to set_gdt_entry
  unify field names and definitions for GDT descriptors
  replace tss_descr global with a function
  x86: Move IDT to desc.c
  x86: unify name of 32-bit and 64-bit GDT
  x86: get rid of ring0stacktop
  x86: Move 64-bit GDT and TSS to desc.c
  x86: Move 32-bit GDT and TSS to desc.c

Aaron Lewis (5):
  x86: Look up the PTEs rather than assuming them (v2)
  x86: Prepare access test for running in L2
  x86: Fix tabs in access.c
  x86: Clean up the global, page_table_levels, in access.c
  x86: Add tests to run ac_test_run() in an L2 guest

 lib/libcflat.h         |    1 +
 lib/x86/asm/setup.h    |    6 +
 lib/x86/desc.c         |  116 +++-
 lib/x86/desc.h         |   31 +-
 lib/x86/setup.c        |   49 ++
 lib/x86/usermode.c     |    9 +-
 lib/x86/vm.c           |   21 +
 lib/x86/vm.h           |    3 +
 x86/Makefile.common    |    4 +
 x86/Makefile.x86_64    |    2 +-
 x86/access.c           | 1447 ++++++++++++++++++++--------------------
 x86/access.h           |    9 +
 x86/access_test.c      |   20 +
 x86/cstart.S           |  115 +---
 x86/cstart64.S         |   98 +--
 x86/flat.lds           |    1 +
 x86/smap.c             |    2 +-
 x86/svm_tests.c        |   15 +-
 x86/taskswitch.c       |    4 +-
 x86/umip.c             |   19 +-
 x86/unittests.cfg      |   17 +-
 x86/vmware_backdoors.c |   22 +-
 x86/vmx.c              |   17 +-
 x86/vmx_tests.c        |   53 +-
 24 files changed, 1080 insertions(+), 1001 deletions(-)
 create mode 100644 lib/x86/asm/setup.h
 create mode 100644 x86/access.h
 create mode 100644 x86/access_test.c

-- 
2.34.0.rc1.387.gb447b232ab-goog


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

end of thread, other threads:[~2021-11-29 22:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 21:19 [kvm-unit-tests PATCH 00/14] Run access test in an L2 guest Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 01/14] x86: cleanup handling of 16-byte GDT descriptors Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 02/14] x86: fix call to set_gdt_entry Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 03/14] unify field names and definitions for GDT descriptors Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 04/14] replace tss_descr global with a function Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 05/14] x86: Move IDT to desc.c Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 06/14] x86: unify name of 32-bit and 64-bit GDT Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 07/14] x86: get rid of ring0stacktop Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 08/14] x86: Move 64-bit GDT and TSS to desc.c Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 09/14] x86: Move 32-bit " Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 10/14] x86: Look up the PTEs rather than assuming them Aaron Lewis
2021-11-29 19:43   ` Babu Moger
2021-11-29 20:43     ` Sean Christopherson
2021-11-29 21:04       ` Babu Moger
2021-11-29 21:30       ` Babu Moger
2021-11-10 21:19 ` [kvm-unit-tests PATCH 11/14] x86: Prepare access test for running in L2 Aaron Lewis
2021-11-10 21:19 ` [kvm-unit-tests PATCH 12/14] x86: Fix tabs in access.c Aaron Lewis
2021-11-10 21:20 ` [kvm-unit-tests PATCH 13/14] x86: Clean up the global, page_table_levels, " Aaron Lewis
2021-11-10 21:20 ` [kvm-unit-tests PATCH 14/14] x86: Add tests that run ac_test_run() in an L2 guest Aaron Lewis
2021-11-11 17:51 ` [kvm-unit-tests PATCH 00/14] Run access test " Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.