Skip to content

KVM: SVM: Fix CR8 intercpetion woes with AVIC

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Applied to kvm-x86 fixes, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 22 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: SVM: Initialize AVIC VMCB fields if AVIC is enabled with in-kernel APICarch/x86/kvm/svm/avic.c arch/x86/kvm/svm/svm.c+2 -25 replies
2/2KVM: SVM: Set/clear CR8 write interception when AVIC is (de)activatedarch/x86/kvm/svm/avic.c arch/x86/kvm/svm/svm.c+9 -616 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJim MattsonNaveen N Rao (AMD)
1/2R-b R-b
2/2R-b R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: SVM: Fix CR8 intercpetion woes with AVIC

Fix a bug (or rather, a class of bugs) where SVM leaves the CR8 write intercept enabled after AVIC is enabled. On its own, the dangling CR8 intercept is "just" a performance issue. But combined with the TPR sync bug fixed by commit d02e48830e3f ("KVM: SVM: Sync TPR from LAPIC into VMCB::V_TPR even if AVIC is active"), the danging intercept is fatal to Windows guests as the TPR seen by hardware gets wildly out of sync with reality.

Tagged for stable even though there shouldn't be functional issues so long as the TPR sync bug is fixed, because (a) write_cr8 exits can represent the overwhelming majority of exits (hence the quotes around "just" a performance issue), and (b) running with a bad/wrong configuration increases the chances of encountering other lurking TPR bugs (if there are any), i.e. of hitting bugs that would otherwise be rare edge (which is good for testing, but bad for production).

Sean Christopherson (2):
KVM: SVM: Initialize AVIC VMCB fields if AVIC is enabled with
in-kernel APIC
KVM: SVM: Set/clear CR8 write interception when AVIC is (de)activated

 arch/x86/kvm/svm/avic.c |  8 +++++---
 arch/x86/kvm/svm/svm.c  | 11 ++++++-----
 2 files changed, 11 insertions(+), 8 deletions(-)

base-commit: e944fe2c09f405a2e2d147145c9b470084bc4c9a

Signature · 1 line
2.53.0.rc2.204.g2597b5adb4-goog