* [PATCH] Call mask notifiers from pic.
@ 2010-07-14 16:28 Gleb Natapov
2010-07-14 17:11 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Gleb Natapov @ 2010-07-14 16:28 UTC (permalink / raw)
To: mtosatti, avi; +Cc: kvm
If pit delivers interrupt while pic is masking it OS will never do EOI
and ack notifier will not be called so when pit will be unmasked no pit
interrupts will be delivered any more. Calling mask notifiers solves this
issue.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 819b748..80d98cd 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -363,10 +363,18 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
}
} else
switch (s->init_state) {
- case 0: /* normal mode */
+ case 0: { /* normal mode */
+ u8 imr_diff = s->imr ^ val;
s->imr = val;
+ for (irq = 0; irq < PIC_NUM_PINS/2; irq++)
+ if (imr_diff & (1 << irq))
+ kvm_fire_mask_notifiers(
+ s->pics_state->kvm,
+ SELECT_PIC(irq), irq,
+ !!(s->imr & (1 << irq)));
pic_update_irq(s->pics_state);
break;
+ }
case 1:
s->irq_base = val & 0xf8;
s->init_state = 2;
--
Gleb.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Call mask notifiers from pic.
2010-07-14 16:28 [PATCH] Call mask notifiers from pic Gleb Natapov
@ 2010-07-14 17:11 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2010-07-14 17:11 UTC (permalink / raw)
To: Gleb Natapov; +Cc: avi, kvm
On Wed, Jul 14, 2010 at 07:28:31PM +0300, Gleb Natapov wrote:
> If pit delivers interrupt while pic is masking it OS will never do EOI
> and ack notifier will not be called so when pit will be unmasked no pit
> interrupts will be delivered any more. Calling mask notifiers solves this
> issue.
>
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
> index 819b748..80d98cd 100644
> --- a/arch/x86/kvm/i8259.c
> +++ b/arch/x86/kvm/i8259.c
> @@ -363,10 +363,18 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
> }
> } else
> switch (s->init_state) {
> - case 0: /* normal mode */
> + case 0: { /* normal mode */
> + u8 imr_diff = s->imr ^ val;
> s->imr = val;
> + for (irq = 0; irq < PIC_NUM_PINS/2; irq++)
> + if (imr_diff & (1 << irq))
> + kvm_fire_mask_notifiers(
> + s->pics_state->kvm,
> + SELECT_PIC(irq), irq,
> + !!(s->imr & (1 << irq)));
irqchip/pin parameters are wrong for PIC_SLAVE.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-14 17:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-14 16:28 [PATCH] Call mask notifiers from pic Gleb Natapov
2010-07-14 17:11 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox