public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/5] Align SVM with APM defined behaviors
@ 2026-01-22  4:57 Kevin Cheng
  2026-01-22  4:57 ` [PATCH V3 1/5] KVM: SVM: Move STGI and CLGI intercept handling Kevin Cheng
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Kevin Cheng @ 2026-01-22  4:57 UTC (permalink / raw)
  To: seanjc, pbonzini; +Cc: kvm, linux-kernel, yosry.ahmed, Kevin Cheng

The APM lists the following behaviors
  - The VMRUN, VMLOAD, VMSAVE, CLGI, VMMCALL, and INVLPGA instructions
    can be used when the EFER.SVME is set to 1; otherwise, these
    instructions generate a #UD exception.
  - If VMMCALL instruction is not intercepted, the instruction raises a
    #UD exception.
  - STGI instruction causes a #UD exception if SVM is not enabled and
    neither SVM Lock nor the device exclusion vector (DEV) are
    supported.

The patches in this series fix current SVM bugs that do not adhere to
the APM listed behaviors.

v2 -> v3:
  - Elaborated on 'Move STGI and CLGI intercept handling' commit message
    as per Sean
  - Fixed bug due to interaction with svm_enable_nmi_window() and 'Move
    STGI and CLGI intercept handling' as pointed out by Yosry. Code
    changes suggested by Sean/Yosry.
  - Removed open-coded nested_svm_check_permissions() in STGI
    interception function as per Yosry

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

v1 -> v2:
  - Split up the series into smaller more logical changes as suggested
    by Sean
  - Added patch for injecting #UD for STGI under APM defined conditions
    as suggested by Sean
  - Combined EFER.SVME=0 conditional with intel CPU logic in
    svm_recalc_instruction_intercepts

Kevin Cheng (5):
  KVM: SVM: Move STGI and CLGI intercept handling
  KVM: SVM: Inject #UD for STGI if EFER.SVME=0 and SVM Lock and DEV are
    not available
  KVM: SVM: Inject #UD for INVLPGA if EFER.SVME=0
  KVM: SVM: Recalc instructions intercepts when EFER.SVME is toggled
  KVM: SVM: Raise #UD if VMMCALL instruction is not intercepted

 arch/x86/kvm/svm/nested.c |  9 +++--
 arch/x86/kvm/svm/svm.c    | 74 +++++++++++++++++++++++++++++++++------
 arch/x86/kvm/svm/svm.h    |  1 +
 3 files changed, 71 insertions(+), 13 deletions(-)

--
2.52.0.457.g6b5491de43-goog


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

end of thread, other threads:[~2026-02-13 15:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22  4:57 [PATCH V3 0/5] Align SVM with APM defined behaviors Kevin Cheng
2026-01-22  4:57 ` [PATCH V3 1/5] KVM: SVM: Move STGI and CLGI intercept handling Kevin Cheng
2026-01-22  4:57 ` [PATCH V3 2/5] KVM: SVM: Inject #UD for STGI if EFER.SVME=0 and SVM Lock and DEV are not available Kevin Cheng
2026-02-12 21:16   ` Sean Christopherson
2026-02-12 21:18     ` Sean Christopherson
2026-02-12 21:57       ` Kevin Cheng
2026-02-13 15:06         ` Sean Christopherson
2026-01-22  4:57 ` [PATCH V3 3/5] KVM: SVM: Inject #UD for INVLPGA if EFER.SVME=0 Kevin Cheng
2026-01-22  4:57 ` [PATCH V3 4/5] KVM: SVM: Recalc instructions intercepts when EFER.SVME is toggled Kevin Cheng
2026-01-22  4:57 ` [PATCH V3 5/5] KVM: SVM: Raise #UD if VMMCALL instruction is not intercepted Kevin Cheng

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