Re: [PATCH] KVM: SVM: Set V_IGN_TPR when enabling a dummy V_IRQ for an IRQ window
From: Yosry Ahmed
Date: Wed Nov 25 2026 - 14:44:10 EST
On Wed, Nov 18, 2026 at 3:37 PM Jim Mattson <jmattson@xxxxxxxxxx> wrote:
>
> Per the APM, the processor takes a virtual INTR interrupt only if
> V_INTR_PRIO is *strictly* greater than V_TPR, unless V_IGN_TPR is set to
> bypass the priority comparison.
>
> In svm_set_vintr(), KVM injects a dummy V_IRQ with V_INTR_PRIO=0xf to
> trigger #VMEXIT(VINTR) as soon as an interrupt window opens, but it does
> not set V_IGN_TPR. If V_TPR is 0xf when the window opens--e.g. when
> CR8=0xf (in L1, or in L2 with V_INTR_MASKING=0) while a TPR-independent
> ExtINT or userspace IRQ-window request is pending, or in L2 with
> V_INTR_MASKING=1, INTERCEPT_INTR=0, and vmcb12.int_ctl.V_TPR=0xf--the
> priority comparison (0xf > 0xf) fails, and hardware masks the dummy
> V_IRQ indefinitely (also stranding any VM-wide AVIC IRQ-window inhibit).
>
> Set V_IRQ_INJECTION_BITS_MASK (which includes V_IRQ_MASK,
> V_INTR_PRIO_MASK, and V_IGN_TPR_MASK) in svm_set_vintr(). Note that
> svm_clear_vintr() already clears and restores V_IRQ_INJECTION_BITS_MASK.
>
> Fixes: 649d68643ebf ("KVM: SVM: sync TPR value to V_TPR field in the VMCB")
> Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
Reviewed-by: Yosry Ahmed <yosry@xxxxxxxxxx>