ia64/xen-unstable

changeset 12054:79a40acadb41

[PV-ON-HVM] Don't generate lots of spurious interrupts when using event
channel upcalls.

The issue here was that the Xen platform PCI interrupt is only updated
when you return from the hypervisor into guest context, and so remained
asserted for a short interval after the interrupt handler ran. If
it happened that the first subsequent trap to the hypervisor was
for unmasking the 8259 interrupt again, the unmasking caused the interrupt
to be reinjected. This caused an edge on the chaining interrupt from
the slave PIC to the master. The platform interrupt on the slave
would then be cleared as we returned to the guest, and so you
eventually end up injecting an interrupt on the master chained
interrupt with nothing pending on the slave, which shows up as
a spurious interrupt in the guest.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
author Steven Smith <ssmith@xensource.com>
date Tue Oct 31 11:38:55 2006 +0000 (2006-10-31)
parents b2371c9e05f5
children 159af40a1b37
files unmodified_drivers/linux-2.6/platform-pci/evtchn.c
line diff
     1.1 --- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Tue Oct 31 11:31:34 2006 +0000
     1.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Tue Oct 31 11:38:55 2006 +0000
     1.3 @@ -167,11 +167,17 @@ irqreturn_t evtchn_interrupt(int irq, vo
     1.4  			l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i];
     1.5  		}
     1.6  	}
     1.7 +
     1.8 +	/* Make sure the hypervisor has a chance to notice that the
     1.9 +	   upcall_pending condition has been cleared, so that we don't
    1.10 +	   try and reinject the interrupt again. */
    1.11 +        (void)HYPERVISOR_xen_version(0, NULL);
    1.12 +
    1.13  	return IRQ_HANDLED;
    1.14  }
    1.15  
    1.16  void force_evtchn_callback(void)
    1.17  {
    1.18 -	evtchn_interrupt(0, NULL, NULL);
    1.19 +        (void)HYPERVISOR_xen_version(0, NULL);
    1.20  }
    1.21  EXPORT_SYMBOL(force_evtchn_callback);