From: Keir Fraser Subject: Re: [PATCH, resend] replacement for noirqdebug hack Date: Wed, 7 Jun 2006 16:57:46 +0100 Message-ID: <2d952ccdfba10b96dadf09495853dcdf@cl.cam.ac.uk> References: <448028CD.76E4.0078.0@novell.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: multipart/mixed; boundary=Apple-Mail-2--410025392 Return-path: In-Reply-To: <448028CD.76E4.0078.0@novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Apple-Mail-2--410025392 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2 Jun 2006, at 11:02, Jan Beulich wrote: > Instead of re-establishing the noirqdebug hack earlier present in the > i386 Linux code, communicate the information about > whether a particular IRQ is shared across domains from hypervisor to > kernel. > > Signed-off-by: Jan Beulich How about the following patch, which is a cleaner modification to Linux and does not affect shared_info layout? Note that it depends on a Xen patch that is currently in the staging tree (extends the irq info hypercall to inform about sharing status), and that the patch is against xen-unstable. The status check is much slower than reading from shared memory, but ought to be on a rare path (unless you have a high-rate interrupt line shared across guests, which is going to be rather suckful anyway). -- Keir --Apple-Mail-2--410025392 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0664; name="ignore_shared_irqs.patch" Content-Disposition: attachment; filename=ignore_shared_irqs.patch --- olinux-2.6.16.13/drivers/xen/Kconfig Wed Jun 7 14:51:56 2006 +++ nlinux-2.6.16.13/drivers/xen/Kconfig Wed Jun 7 16:11:05 2006 @@ -224,6 +224,10 @@ bool default y +config HAVE_IRQ_IGNORE_UNHANDLED + bool + default y + config NO_IDLE_HZ bool default y --- olinux-2.6.16.13/drivers/xen/core/evtchn.c Wed Jun 7 14:51:56 2006 +++ nlinux-2.6,16.13/drivers/xen/core/evtchn.c Wed Jun 7 16:11:05 2006 @@ -678,6 +678,13 @@ set_affinity_irq }; +int irq_ignore_unhandled(unsigned int irq) +{ + struct physdev_irq_status_query irq_status = { .irq = irq }; + (void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status); + return !!(irq_status.flags & XENIRQSTAT_shared); +} + void resend_irq_on_evtchn(struct hw_interrupt_type *h, unsigned int i) { int evtchn = evtchn_from_irq(i); --- olinux-2.6.16.13/include/linux/interrupt.h 2006-05-02 22:38:44.000000000 +0100 +++ nlinux-2.6.16.13/include/linux/interrupt.h 2006-06-07 16:05:04.000000000 +0100 @@ -58,6 +58,12 @@ extern void enable_irq(unsigned int irq); #endif +#ifdef CONFIG_HAVE_IRQ_IGNORE_UNHANDLED +int irq_ignore_unhandled(unsigned int irq); +#else +#define irq_ignore_unhandled(irq) 0 +#endif + #ifndef __ARCH_SET_SOFTIRQ_PENDING #define set_softirq_pending(x) (local_softirq_pending() = (x)) #define or_softirq_pending(x) (local_softirq_pending() |= (x)) --- olinux-2.6.16.13/kernel/irq/spurious.c 2006-05-02 22:38:44.000000000 +0100 +++ nlinux-2.6.16.13/kernel/irq/spurious.c 2006-06-07 16:01:39.000000000 +0100 @@ -137,7 +137,8 @@ struct pt_regs *regs) { if (action_ret != IRQ_HANDLED) { - desc->irqs_unhandled++; + if (!irq_ignore_unhandled(irq)) + desc->irqs_unhandled++; if (action_ret != IRQ_NONE) report_bad_irq(irq, desc, action_ret); } --Apple-Mail-2--410025392 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-2--410025392 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 --Apple-Mail-2--410025392--