lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0788/1039] KVM: VMX: Dont unblock vCPU w/ Posted IRQ if IRQs are disabled in guest
    Date
    From: Paolo Bonzini <pbonzini@redhat.com>

    [ Upstream commit 1831fa44df743a7cdffdf1c12c799bf6f3c12b8c ]

    Don't configure the wakeup handler when a vCPU is blocking with IRQs
    disabled, in which case any IRQ, posted or otherwise, should not be
    recognized and thus should not wake the vCPU.

    Fixes: bf9f6ac8d749 ("KVM: Update Posted-Interrupts Descriptor when vCPU is blocked")
    Signed-off-by: Sean Christopherson <seanjc@google.com>
    Message-Id: <20211009021236.4122790-2-seanjc@google.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/x86/kvm/vmx/posted_intr.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/arch/x86/kvm/vmx/posted_intr.c b/arch/x86/kvm/vmx/posted_intr.c
    index 21ea58d25771f..696ad48ab5daa 100644
    --- a/arch/x86/kvm/vmx/posted_intr.c
    +++ b/arch/x86/kvm/vmx/posted_intr.c
    @@ -147,7 +147,8 @@ int pi_pre_block(struct kvm_vcpu *vcpu)
    struct pi_desc old, new;
    struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu);

    - if (!vmx_can_use_vtd_pi(vcpu->kvm))
    + if (!vmx_can_use_vtd_pi(vcpu->kvm) ||
    + vmx_interrupt_blocked(vcpu))
    return 0;

    WARN_ON(irqs_disabled());
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-01-25 00:11    [W:4.018 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site