aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-07-26 03:00:45 -0400
committerAvi Kivity <avi@redhat.com>2012-07-26 05:19:06 -0400
commitaea218f3cbbcaac249b6b2c98930a00d6d931f1e (patch)
treea21917407b485a5cbd21741e0d7a42dd6bf4a578
parentbdc0077af574800d24318b6945cf2344e8dbb050 (diff)
KVM: PIC: call ack notifiers for irqs that are dropped form irr
After commit 242ec97c358256 PIT interrupts are no longer delivered after PIC reset. It happens because PIT injects interrupt only if previous one was acked, but since on PIC reset it is dropped from irr it will never be delivered and hence acknowledged. Fix that by calling ack notifier on PIC reset. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/x86/kvm/i8259.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 1df8fb9e1d5d..e498b18f010c 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -316,6 +316,11 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
316 addr &= 1; 316 addr &= 1;
317 if (addr == 0) { 317 if (addr == 0) {
318 if (val & 0x10) { 318 if (val & 0x10) {
319 u8 edge_irr = s->irr & ~s->elcr;
320 int i;
321 bool found;
322 struct kvm_vcpu *vcpu;
323
319 s->init4 = val & 1; 324 s->init4 = val & 1;
320 s->last_irr = 0; 325 s->last_irr = 0;
321 s->irr &= s->elcr; 326 s->irr &= s->elcr;
@@ -333,6 +338,18 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
333 if (val & 0x08) 338 if (val & 0x08)
334 pr_pic_unimpl( 339 pr_pic_unimpl(
335 "level sensitive irq not supported"); 340 "level sensitive irq not supported");
341
342 kvm_for_each_vcpu(i, vcpu, s->pics_state->kvm)
343 if (kvm_apic_accept_pic_intr(vcpu)) {
344 found = true;
345 break;
346 }
347
348
349 if (found)
350 for (irq = 0; irq < PIC_NUM_PINS/2; irq++)
351 if (edge_irr & (1 << irq))
352 pic_clear_isr(s, irq);
336 } else if (val & 0x08) { 353 } else if (val & 0x08) {
337 if (val & 0x04) 354 if (val & 0x04)
338 s->poll = 1; 355 s->poll = 1;