From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@elte.hu" <mingo@elte.hu>
Cc: "linux-tip-commits@vger.kernel.org"
<linux-tip-commits@vger.kernel.org>,
"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [tip:irq/core] x86: xen: Sanitise sparse_irq handling
Date: Fri, 15 Oct 2010 17:15:06 -0700 [thread overview]
Message-ID: <4CB8EE8A.5020900@goop.org> (raw)
In-Reply-To: <tip-77dff1c755c3218691e95e7e38ee14323b35dbdb@git.kernel.org>
On 10/12/2010 01:29 PM, tip-bot for Thomas Gleixner wrote:
> Commit-ID: 77dff1c755c3218691e95e7e38ee14323b35dbdb
> Gitweb: http://git.kernel.org/tip/77dff1c755c3218691e95e7e38ee14323b35dbdb
> Author: Thomas Gleixner <tglx@linutronix.de>
> AuthorDate: Wed, 29 Sep 2010 17:37:10 +0200
> Committer: Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Tue, 12 Oct 2010 16:53:44 +0200
>
> x86: xen: Sanitise sparse_irq handling
>
> There seems to be more cleanups possible, but that's left to the xen
> experts :)
This causes the kernel to fail to boot under Xen. The WARN_ON(res !=
irq) triggers and nobody is very happy about the results.
It looks like the patch below might be sufficient, but then the system
fails due to block IO errors (not sure if that's related).
J
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 7d24b0d..a11fabb 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -338,31 +338,7 @@ static void unmask_evtchn(int port)
static int find_unbound_irq(void)
{
- struct irq_data *data;
- int irq, res;
-
- for (irq = 0; irq < nr_irqs; irq++) {
- data = irq_get_irq_data(irq);
- /* only 0->15 have init'd desc; handle irq > 16 */
- if (!data)
- break;
- if (data->chip == &no_irq_chip)
- break;
- if (data->chip != &xen_dynamic_chip)
- continue;
- if (irq_info[irq].type == IRQT_UNBOUND)
- return irq;
- }
-
- if (irq == nr_irqs)
- panic("No available IRQ to bind to: increase nr_irqs!\n");
-
- res = irq_alloc_desc_at(irq, 0);
-
- if (WARN_ON(res != irq))
- return -1;
-
- return irq;
+ return irq_alloc_descs(-1, 0, 1, 0);
}
int bind_evtchn_to_irq(unsigned int evtchn)
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Reviewed-by: Ingo Molnar <mingo@elte.hu>
> Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
> ---
> drivers/xen/events.c | 23 +++++++++++------------
> 1 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 13365ba..7d24b0d 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -338,30 +338,29 @@ static void unmask_evtchn(int port)
>
> static int find_unbound_irq(void)
> {
> - int irq;
> - struct irq_desc *desc;
> + struct irq_data *data;
> + int irq, res;
>
> for (irq = 0; irq < nr_irqs; irq++) {
> - desc = irq_to_desc(irq);
> + data = irq_get_irq_data(irq);
> /* only 0->15 have init'd desc; handle irq > 16 */
> - if (desc == NULL)
> + if (!data)
> break;
> - if (desc->chip == &no_irq_chip)
> + if (data->chip == &no_irq_chip)
> break;
> - if (desc->chip != &xen_dynamic_chip)
> + if (data->chip != &xen_dynamic_chip)
> continue;
> if (irq_info[irq].type == IRQT_UNBOUND)
> - break;
> + return irq;
> }
>
> if (irq == nr_irqs)
> panic("No available IRQ to bind to: increase nr_irqs!\n");
>
> - desc = irq_to_desc_alloc_node(irq, 0);
> - if (WARN_ON(desc == NULL))
> - return -1;
> + res = irq_alloc_desc_at(irq, 0);
>
> - dynamic_irq_init_keep_chip_data(irq);
> + if (WARN_ON(res != irq))
> + return -1;
>
> return irq;
> }
> @@ -495,7 +494,7 @@ static void unbind_from_irq(unsigned int irq)
> if (irq_info[irq].type != IRQT_UNBOUND) {
> irq_info[irq] = mk_unbound_info();
>
> - dynamic_irq_cleanup(irq);
> + irq_free_desc(irq);
> }
>
> spin_unlock(&irq_mapping_update_lock);
next parent reply other threads:[~2010-10-16 0:15 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tip-77dff1c755c3218691e95e7e38ee14323b35dbdb@git.kernel.org>
2010-10-16 0:15 ` Jeremy Fitzhardinge [this message]
2010-10-16 0:17 ` [Xen-devel] Re: [tip:irq/core] x86: xen: Sanitise sparse_irq handling Jeremy Fitzhardinge
2010-10-16 2:01 ` H. Peter Anvin
2010-10-25 16:22 ` [PATCH 00/05] xen: events: cleanups after irq core improvements (Was: Re: [Xen-devel] Re: [tip:irq/core] x86: xen: Sanitise sparse_irq handling) Ian Campbell
2010-10-25 16:23 ` [PATCH 1/5] xen: events: use irq_alloc_desc(_at) instead of open-coding an IRQ allocator Ian Campbell
2010-10-25 17:35 ` Konrad Rzeszutek Wilk
2010-10-25 18:02 ` Ian Campbell
2010-10-26 8:15 ` [Xen-devel] " Ian Campbell
2010-10-26 19:49 ` Stefano Stabellini
2010-10-26 20:20 ` Jeremy Fitzhardinge
2010-10-25 23:03 ` Jeremy Fitzhardinge
2010-10-25 23:05 ` H. Peter Anvin
2010-10-25 23:21 ` Jeremy Fitzhardinge
2010-10-26 14:17 ` [Xen-devel] " Konrad Rzeszutek Wilk
2010-10-26 16:44 ` Jeremy Fitzhardinge
2010-10-26 17:08 ` Konrad Rzeszutek Wilk
2010-10-28 12:43 ` Stefano Stabellini
2010-10-28 16:22 ` Jeremy Fitzhardinge
2010-10-25 16:23 ` [PATCH 2/5] xen: events: turn irq_info constructors into initialiser functions Ian Campbell
2010-10-25 16:23 ` [PATCH 3/5] xen: events: push setup of irq<->{evtchn,pirq} maps into irq_info init functions Ian Campbell
2010-10-26 14:31 ` Konrad Rzeszutek Wilk
2010-10-25 16:23 ` [PATCH 4/5] xen: events: dynamically allocate irq info structures Ian Campbell
2010-10-26 14:30 ` Konrad Rzeszutek Wilk
2010-10-26 16:37 ` Jeremy Fitzhardinge
2010-10-25 16:23 ` [PATCH 5/5] xen: events: use per-cpu variable for cpu_evtchn_mask Ian Campbell
2010-10-26 14:36 ` Konrad Rzeszutek Wilk
2010-10-26 14:50 ` Ian Campbell
2010-10-25 23:03 ` [PATCH 00/05] xen: events: cleanups after irq core improvements (Was: Re: [Xen-devel] Re: [tip:irq/core] x86: xen: Sanitise sparse_irq handling) Jeremy Fitzhardinge
2010-10-26 7:25 ` Ian Campbell
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=4CB8EE8A.5020900@goop.org \
--to=jeremy@goop.org \
--cc=Ian.Campbell@citrix.com \
--cc=Jeremy.Fitzhardinge@citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox