All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v3 0/2] x86/svm: Add testing for L1 intercept bug
@ 2025-12-24  1:43 Kevin Cheng
  2025-12-24  1:43 ` [kvm-unit-tests PATCH v3 1/2] x86/svm: Add missing svm intercepts Kevin Cheng
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kevin Cheng @ 2025-12-24  1:43 UTC (permalink / raw)
  To: kvm; +Cc: yosryahmed, andrew.jones, thuth, pbonzini, seanjc, Kevin Cheng

If a feature is not advertised to L1, L1 intercepts for instructions
controlled by this feature should be ignored. Currently, the added test
fails due to a bug in nested vm exit handling where vmcb12 intercepts
are checked before vmcb02 intercepts, causing the #UD exception to never
be injected into L2 if the L1 intercept is set. This is fixed in [0]

The first patch just adds the missing intercepts needed for testing and
restructures the vmcb_control_area struct to make adding the missing
intercepts less ugly. The second patch adds the test which disables all
relevant features that have available instruction intercepts, and checks
that the #UD exception is correctly delivered despite the L1 intercept
being set.

[0] https://lore.kernel.org/all/20251205070630.4013452-1-chengkev@google.com/

v2 -> v3:
  - Added assertions to unsupported instructions test to verify that CPU
    does not support features enabling tested instructions [Yosry Ahmed]
  - Added some comments [Yosry Ahmed]
  - Changed insn_invpcid() into assembly [Yosry Ahmed]
  - Added a check to the unsupported instruction test to ensure that
    L1's vmcb is not modified by KVM [Yosry Ahmed]
  - Redacted reviewed-by tag for 2nd patch in series. I mistakingly
    added that

v2: https://lore.kernel.org/all/20251215210026.2422155-1-chengkev@google.com/

v1 -> v2:
  - Added save/restore helpers for all intercepts as suggested by Yosry
  - Reuse invpcid_safe() for added test as suggested by Yosry
  - Include '-skinit' in unittests.cfg for added test target as pointed
    out by Yosry

v1: https://lore.kernel.org/all/20251205081448.4062096-1-chengkev@google.com/

Kevin Cheng (2):
  x86/svm: Add missing svm intercepts
  x86/svm: Add unsupported instruction intercept test

 lib/x86/processor.h |   1 +
 x86/svm.c           |  18 +++-
 x86/svm.h           |  89 ++++++++++++++++--
 x86/svm_tests.c     | 224 +++++++++++++++++++++++++++++++-------------
 x86/unittests.cfg   |  11 ++-
 5 files changed, 262 insertions(+), 81 deletions(-)

--
2.52.0.351.gbe84eed79e-goog


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

end of thread, other threads:[~2026-05-27 22:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-24  1:43 [kvm-unit-tests PATCH v3 0/2] x86/svm: Add testing for L1 intercept bug Kevin Cheng
2025-12-24  1:43 ` [kvm-unit-tests PATCH v3 1/2] x86/svm: Add missing svm intercepts Kevin Cheng
2026-05-20 14:57   ` Sean Christopherson
2026-05-20 14:59     ` Paolo Bonzini
2025-12-24  1:43 ` [kvm-unit-tests PATCH v3 2/2] x86/svm: Add unsupported instruction intercept test Kevin Cheng
2026-05-27 17:49 ` [kvm-unit-tests PATCH v3 0/2] x86/svm: Add testing for L1 intercept bug Sean Christopherson
2026-05-27 22:00   ` Yosry Ahmed

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.