[PATCH 0/3] nSVM: Minor cleanups for intercepts code

Yosry Ahmed posted 3 patches 3 weeks, 5 days ago
arch/x86/kvm/svm/nested.c | 37 ++++++++++++++++++-------------------
arch/x86/kvm/svm/sev.c    |  2 +-
arch/x86/kvm/svm/svm.c    |  4 ++--
arch/x86/kvm/svm/svm.h    | 10 +++++-----
4 files changed, 26 insertions(+), 27 deletions(-)
[PATCH 0/3] nSVM: Minor cleanups for intercepts code
Posted by Yosry Ahmed 3 weeks, 5 days ago
A few minor cleanups for nested intercepts code, namely making
recalc_intercepts() more readable and renaming it, and using
vmcb12_is_intercept() instead of open-coding it.

Yosry Ahmed (3):
  KVM: nSVM: Use intuitive local variables in recalc_intercepts()
  KVM: nSVM: Rename recalc_intercepts() to clarify vmcb02 as the target
  KVM: nSVM: Use vmcb12_is_intercept() in
    nested_sync_control_from_vmcb02()

 arch/x86/kvm/svm/nested.c | 37 ++++++++++++++++++-------------------
 arch/x86/kvm/svm/sev.c    |  2 +-
 arch/x86/kvm/svm/svm.c    |  4 ++--
 arch/x86/kvm/svm/svm.h    | 10 +++++-----
 4 files changed, 26 insertions(+), 27 deletions(-)

-- 
2.52.0.457.g6b5491de43-goog
Re: [PATCH 0/3] nSVM: Minor cleanups for intercepts code
Posted by Sean Christopherson 3 days, 8 hours ago
On Mon, Jan 12, 2026, Yosry Ahmed wrote:
> A few minor cleanups for nested intercepts code, namely making
> recalc_intercepts() more readable and renaming it, and using
> vmcb12_is_intercept() instead of open-coding it.

I'll send a v2.  Fixing the vmcb_mark_dirty() bug yields a fairly different
overall sequence:

  KVM: SVM: Explicitly mark vmcb01 dirty after modifying VMCB intercepts
  KVM: SVM: Separate recalc_intercepts() into nested vs. non-nested parts
  KVM: nSVM: WARN and abort vmcb02 intercepts recalc if vmcb02 isn't active
  KVM: nSVM: Directly (re)calc vmcb02 intercepts from nested_vmcb02_prepare_control()
  KVM: nSVM: Use intuitive local variables in nested_vmcb02_recalc_intercepts()
  KVM: nSVM: Use vmcb12_is_intercept() in nested_sync_control_from_vmcb02()
Re: [PATCH 0/3] nSVM: Minor cleanups for intercepts code
Posted by Yosry Ahmed 3 days, 8 hours ago
On Wed, Feb 04, 2026 at 09:47:34AM -0800, Sean Christopherson wrote:
> On Mon, Jan 12, 2026, Yosry Ahmed wrote:
> > A few minor cleanups for nested intercepts code, namely making
> > recalc_intercepts() more readable and renaming it, and using
> > vmcb12_is_intercept() instead of open-coding it.
> 
> I'll send a v2.  Fixing the vmcb_mark_dirty() bug yields a fairly different
> overall sequence:

Sounds great to me :)

> 
>   KVM: SVM: Explicitly mark vmcb01 dirty after modifying VMCB intercepts
>   KVM: SVM: Separate recalc_intercepts() into nested vs. non-nested parts
>   KVM: nSVM: WARN and abort vmcb02 intercepts recalc if vmcb02 isn't active
>   KVM: nSVM: Directly (re)calc vmcb02 intercepts from nested_vmcb02_prepare_control()
>   KVM: nSVM: Use intuitive local variables in nested_vmcb02_recalc_intercepts()
>   KVM: nSVM: Use vmcb12_is_intercept() in nested_sync_control_from_vmcb02()