diff options
author | Maciej S. Szmigiero <maciej.szmigiero@oracle.com> | 2025-08-25 18:44:28 +0200 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2025-09-10 12:04:16 -0700 |
commit | d02e48830e3fce9701265f6c5a58d9bdaf906a76 (patch) | |
tree | be80d4ce2c3f006ad69ca49b95b29cf95303387c /scripts/documentation-file-ref-check | |
parent | 42a0305ab114975dbad3fe9efea06976dd62d381 (diff) |
KVM: SVM: Sync TPR from LAPIC into VMCB::V_TPR even if AVIC is active
Commit 3bbf3565f48c ("svm: Do not intercept CR8 when enable AVIC")
inhibited pre-VMRUN sync of TPR from LAPIC into VMCB::V_TPR in
sync_lapic_to_cr8() when AVIC is active.
AVIC does automatically sync between these two fields, however it does
so only on explicit guest writes to one of these fields, not on a bare
VMRUN.
This meant that when AVIC is enabled host changes to TPR in the LAPIC
state might not get automatically copied into the V_TPR field of VMCB.
This is especially true when it is the userspace setting LAPIC state via
KVM_SET_LAPIC ioctl() since userspace does not have access to the guest
VMCB.
Practice shows that it is the V_TPR that is actually used by the AVIC to
decide whether to issue pending interrupts to the CPU (not TPR in TASKPRI),
so any leftover value in V_TPR will cause serious interrupt delivery issues
in the guest when AVIC is enabled.
Fix this issue by doing pre-VMRUN TPR sync from LAPIC into VMCB::V_TPR
even when AVIC is enabled.
Fixes: 3bbf3565f48c ("svm: Do not intercept CR8 when enable AVIC")
Cc: stable@vger.kernel.org
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Reviewed-by: Naveen N Rao (AMD) <naveen@kernel.org>
Link: https://lore.kernel.org/r/c231be64280b1461e854e1ce3595d70cde3a2e9d.1756139678.git.maciej.szmigiero@oracle.com
[sean: tag for stable@]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'scripts/documentation-file-ref-check')
0 files changed, 0 insertions, 0 deletions