Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 0/2] x86/svm: Add testing for L1 intercept bug
@ 2025-12-05  8:02 Kevin Cheng
  2025-12-05  8:02 ` [kvm-unit-tests PATCH 1/2] x86/svm: Add missing svm intercepts Kevin Cheng
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kevin Cheng @ 2025-12-05  8:02 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/

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

 x86/svm.c         |   6 +-
 x86/svm.h         |  87 ++++++++++++++++++---
 x86/svm_tests.c   | 188 ++++++++++++++++++++++++++++++++--------------
 x86/unittests.cfg |   9 ++-
 4 files changed, 220 insertions(+), 70 deletions(-)

--
2.52.0.223.gf5cc29aaa4-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [kvm-unit-tests PATCH 0/2] x86/svm: Add testing for L1 intercept bug
@ 2025-12-05  8:14 Kevin Cheng
  2025-12-05  8:14 ` [kvm-unit-tests PATCH 1/2] x86/svm: Add missing svm intercepts Kevin Cheng
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Cheng @ 2025-12-05  8:14 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/

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

 x86/svm.c         |   6 +-
 x86/svm.h         |  87 +++++++++++++++++++---
 x86/svm_tests.c   | 186 ++++++++++++++++++++++++++++++++--------------
 x86/unittests.cfg |   9 ++-
 4 files changed, 218 insertions(+), 70 deletions(-)

--
2.52.0.223.gf5cc29aaa4-goog


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

end of thread, other threads:[~2025-12-09  1:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05  8:02 [kvm-unit-tests PATCH 0/2] x86/svm: Add testing for L1 intercept bug Kevin Cheng
2025-12-05  8:02 ` [kvm-unit-tests PATCH 1/2] x86/svm: Add missing svm intercepts Kevin Cheng
2025-12-05  8:14   ` Kevin Cheng
2025-12-05  8:02 ` [kvm-unit-tests PATCH] x86/svm: Add unsupported instruction intercept test Kevin Cheng
2025-12-05  8:14   ` Kevin Cheng
2025-12-05  8:14 ` [kvm-unit-tests PATCH 0/2] x86/svm: Add testing for L1 intercept bug Kevin Cheng
  -- strict thread matches above, loose matches on Subject: below --
2025-12-05  8:14 Kevin Cheng
2025-12-05  8:14 ` [kvm-unit-tests PATCH 1/2] x86/svm: Add missing svm intercepts Kevin Cheng
2025-12-09  1:31   ` Yosry Ahmed

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