From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Lalancette Subject: [PATCH]: Really disable pirq's Date: Wed, 14 Nov 2007 14:10:56 -0500 Message-ID: <473B4840.4080502@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000009000907010301090402" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000009000907010301090402 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit All, I have a laptop here that has some interrupt trouble, unrelated to Xen (I believe it's a bug in the ACPI tables, but I digress). On the bare-metal kernel, if 999,900 out of 100,000 interrupts go un-acknowledged to a particular interrupt line, the kernel disables that interrupt line. In the Xen kernel, the same logic applies. However, when the Xen kernel goes to disable the physical interrupt, it only masks out the event channel: static void disable_pirq(unsigned int irq) { int evtchn = evtchn_from_irq(irq); if (VALID_EVTCHN(evtchn)) mask_evtchn(evtchn); } And at this point, *all* interrupts on the affected machine seem to stop, not just this physical IRQ line. I believe the problem is that when we go to disable a PIRQ, we actually need to get the HV to mask it out on the IOAPIC. This patch does exactly that; on disable_pirq(), we actually just call out to shutdown_pirq(), which ends up hypercalling and getting the HV to mask out the interrupt. On the other side, I needed to modify enable_pirq() to call out to startup_pirq(), so that it would actually allocate the event channel. With this patch in place, the affected laptop no longer hangs up when the kernel decides to disable that particular interrupt line. Signed-off-by: Chris Lalancette --------------000009000907010301090402 Content-Type: text/x-patch; name="linux-2.6.18-evtchn-disable-pirq.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linux-2.6.18-evtchn-disable-pirq.patch" --- linux-2.6.18.noarch/drivers/xen/core/evtchn.c.orig +++ linux-2.6.18.noarch/drivers/xen/core/evtchn.c @@ -629,20 +629,12 @@ static void shutdown_pirq(unsigned int i static void enable_pirq(unsigned int irq) { - int evtchn = evtchn_from_irq(irq); - - if (VALID_EVTCHN(evtchn)) { - unmask_evtchn(evtchn); - pirq_unmask_notify(irq_to_pirq(irq)); - } + startup_pirq(irq); } static void disable_pirq(unsigned int irq) { - int evtchn = evtchn_from_irq(irq); - - if (VALID_EVTCHN(evtchn)) - mask_evtchn(evtchn); + shutdown_pirq(irq); } static void ack_pirq(unsigned int irq) --------------000009000907010301090402 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000009000907010301090402--