[PATCH v2 0/2] KVM: SVM: Fix missing LAPIC TPR sync into VMCB::V_TPR with AVIC on

Maciej S. Szmigiero posted 2 patches 1 month, 1 week ago
arch/x86/kvm/svm/svm.c                        |   3 +-
.../testing/selftests/kvm/include/x86/apic.h  |   5 +
.../selftests/kvm/x86/xapic_state_test.c      | 265 +++++++++++++++++-
3 files changed, 268 insertions(+), 5 deletions(-)
[PATCH v2 0/2] KVM: SVM: Fix missing LAPIC TPR sync into VMCB::V_TPR with AVIC on
Posted by Maciej S. Szmigiero 1 month, 1 week ago
From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>

This is an updated v2 patch series of the v1 series located at:
https://lore.kernel.org/kvm/cover.1755609446.git.maciej.szmigiero@oracle.com/


Changes from v1:
Fix this issue by doing unconditional LAPIC -> V_TPR sync at each VMRUN
rather than by just patching the KVM_SET_LAPIC ioctl() code path
(and similar ones).


Maciej S. Szmigiero (2):
  KVM: SVM: Sync TPR from LAPIC into VMCB::V_TPR even if AVIC is active
  KVM: selftests: Test TPR / CR8 sync and interrupt masking

 arch/x86/kvm/svm/svm.c                        |   3 +-
 .../testing/selftests/kvm/include/x86/apic.h  |   5 +
 .../selftests/kvm/x86/xapic_state_test.c      | 265 +++++++++++++++++-
 3 files changed, 268 insertions(+), 5 deletions(-)
Re: [PATCH v2 0/2] KVM: SVM: Fix missing LAPIC TPR sync into VMCB::V_TPR with AVIC on
Posted by Sean Christopherson 2 weeks, 3 days ago
On Mon, 25 Aug 2025 18:44:27 +0200, Maciej S. Szmigiero wrote:
> From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
> 
> This is an updated v2 patch series of the v1 series located at:
> https://lore.kernel.org/kvm/cover.1755609446.git.maciej.szmigiero@oracle.com/
> 
> 
> Changes from v1:
> Fix this issue by doing unconditional LAPIC -> V_TPR sync at each VMRUN
> rather than by just patching the KVM_SET_LAPIC ioctl() code path
> (and similar ones).
> 
> [...]

Applied patch 1 to kvm-x86 fixes (will get a PULL request sent out shortly).

Thanks!

[1/2] KVM: SVM: Sync TPR from LAPIC into VMCB::V_TPR even if AVIC is active
      https://github.com/kvm-x86/linux/commit/d02e48830e3f

--
https://github.com/kvm-x86/linux/tree/next
Re: [PATCH v2 0/2] KVM: SVM: Fix missing LAPIC TPR sync into VMCB::V_TPR with AVIC on
Posted by Maciej S. Szmigiero 3 weeks, 4 days ago
On 25.08.2025 18:44, Maciej S. Szmigiero wrote:
> From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
> 
> This is an updated v2 patch series of the v1 series located at:
> https://lore.kernel.org/kvm/cover.1755609446.git.maciej.szmigiero@oracle.com/
> 
> 
> Changes from v1:
> Fix this issue by doing unconditional LAPIC -> V_TPR sync at each VMRUN
> rather than by just patching the KVM_SET_LAPIC ioctl() code path
> (and similar ones).
> 
> 
Any further comments there?

The fix itself is trivial, would be nice to have it merged even
if the reproducer/selftest is still under discussion.

Thanks,
Maciej
Re: [PATCH v2 0/2] KVM: SVM: Fix missing LAPIC TPR sync into VMCB::V_TPR with AVIC on
Posted by Sean Christopherson 3 weeks, 4 days ago
On Mon, Sep 08, 2025, Maciej S. Szmigiero wrote:
> On 25.08.2025 18:44, Maciej S. Szmigiero wrote:
> > From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
> > 
> > This is an updated v2 patch series of the v1 series located at:
> > https://lore.kernel.org/kvm/cover.1755609446.git.maciej.szmigiero@oracle.com/
> > 
> > 
> > Changes from v1:
> > Fix this issue by doing unconditional LAPIC -> V_TPR sync at each VMRUN
> > rather than by just patching the KVM_SET_LAPIC ioctl() code path
> > (and similar ones).
> > 
> > 
> Any further comments there?
> 
> The fix itself is trivial, would be nice to have it merged even
> if the reproducer/selftest is still under discussion.

I'll get the fix queued for 6.17 this, I didn't get much of anything done last
week due to KVM Forum.