public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] KVM:x86:Fix an interrupt injection logic error during PIC interrupt simulation
@ 2024-07-30 13:59 Liam Ni
  2024-08-07 10:38 ` Liam Ni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Liam Ni @ 2024-07-30 13:59 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen
  Cc: x86, H. Peter Anvin, kvm, linux-kernel

The input parameter level to the pic_irq_request function indicates
whether there are interrupts to be injected,
a level value of 1 indicates that there are interrupts to be injected,
and a level value of 0 indicates that there are no interrupts to be injected.
And the value of level will be assigned to s->output,
so we should set s->wakeup_needed to true when s->output is true.

Signed-off-by: Liam Ni <zhiguangni01@gmail.com>
---
 arch/x86/kvm/i8259.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 8dec646e764b..ec9d6ee7d33d 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -567,7 +567,7 @@ static void pic_irq_request(struct kvm *kvm, int level)
 {
    struct kvm_pic *s = kvm->arch.vpic;

-   if (!s->output)
+   if (!s->output && level)
        s->wakeup_needed = true;
    s->output = level;
 }
--
2.34.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-15  0:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 13:59 [PATCH V2] KVM:x86:Fix an interrupt injection logic error during PIC interrupt simulation Liam Ni
2024-08-07 10:38 ` Liam Ni
2025-02-14  0:40 ` Sean Christopherson
2025-02-15  0:50 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox