All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
To: Jan Beulich <jbeulich@novell.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH, resend] replacement for noirqdebug hack
Date: Wed, 7 Jun 2006 16:57:46 +0100	[thread overview]
Message-ID: <2d952ccdfba10b96dadf09495853dcdf@cl.cam.ac.uk> (raw)
In-Reply-To: <448028CD.76E4.0078.0@novell.com>

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]


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 <jbeulich@novell.com>

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


[-- Attachment #2: ignore_shared_irqs.patch --]
[-- Type: application/octet-stream, Size: 1758 bytes --]

--- 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);
 	}

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2006-06-07 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-02 10:02 [PATCH, resend] replacement for noirqdebug hack Jan Beulich
2006-06-02 10:32 ` Keir Fraser
2006-06-02 11:01   ` Jan Beulich
2006-06-02 11:09     ` Keir Fraser
2006-06-07 15:57 ` Keir Fraser [this message]
2006-06-08  7:00   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d952ccdfba10b96dadf09495853dcdf@cl.cam.ac.uk \
    --to=keir.fraser@cl.cam.ac.uk \
    --cc=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.