xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 04/11] Fix find_unbound_irq in presence of ioapic irqs.
@ 2010-05-10 14:20 Stefano Stabellini
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2010-05-10 14:20 UTC (permalink / raw)
  To: xen-devel; +Cc: Stefano Stabellini

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 drivers/xen/events.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index bb04824..cd609f4 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -335,9 +335,18 @@ static int find_unbound_irq(void)
 	int irq;
 	struct irq_desc *desc;
 
-	for (irq = 0; irq < nr_irqs; irq++)
+	for (irq = 0; irq < nr_irqs; irq++) {
+		desc = irq_to_desc(irq);
+		/* only 0->15 have init'd desc; handle irq > 16 */
+		if (desc == NULL)
+			break;
+		if (desc->chip == &no_irq_chip)
+			break;
+		if (desc->chip != &xen_dynamic_chip)
+			continue;
 		if (irq_info[irq].type == IRQT_UNBOUND)
 			break;
+	}
 
 	if (irq == nr_irqs)
 		panic("No available IRQ to bind to: increase nr_irqs!\n");
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 04/11] Fix find_unbound_irq in presence of ioapic irqs.
  2010-05-24 18:25 [PATCH 0 of 12] PV on HVM Xen Stefano Stabellini
@ 2010-05-24 18:27 ` Stefano Stabellini
  2010-05-26 18:26   ` [Xen-devel] " Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Stabellini @ 2010-05-24 18:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: xen-devel, Don Dutile, Stefano Stabellini, Jeremy Fitzhardinge,
	Stefano Stabellini

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 drivers/xen/events.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 8b68fc4..1356fa2 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -339,9 +339,18 @@ static int find_unbound_irq(void)
 	int irq;
 	struct irq_desc *desc;
 
-	for (irq = 0; irq < nr_irqs; irq++)
+	for (irq = 0; irq < nr_irqs; irq++) {
+		desc = irq_to_desc(irq);
+		/* only 0->15 have init'd desc; handle irq > 16 */
+		if (desc == NULL)
+			break;
+		if (desc->chip == &no_irq_chip)
+			break;
+		if (desc->chip != &xen_dynamic_chip)
+			continue;
 		if (irq_info[irq].type == IRQT_UNBOUND)
 			break;
+	}
 
 	if (irq == nr_irqs)
 		panic("No available IRQ to bind to: increase nr_irqs!\n");
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 04/11] Fix find_unbound_irq in presence of ioapic irqs.
  2010-05-27 14:49     ` Stefano Stabellini
@ 2010-05-27 15:36       ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-05-27 15:36 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: Jeremy Fitzhardinge, xen-devel@lists.xensource.com, Don Dutile,
	linux-kernel@vger.kernel.org

On Thu, May 27, 2010 at 03:49:12PM +0100, Stefano Stabellini wrote:
> On Wed, 26 May 2010, Konrad Rzeszutek Wilk wrote:
> > On Mon, May 24, 2010 at 07:27:30PM +0100, Stefano Stabellini wrote:
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > Can you provide a more detailed description of why this is needed?
> > 
> 
> We need it because we don't want to break the assumption that the first
> 16 irqs are ISA irqs, and among the other irqs we actually want to be
> sure they are available before using them.

Interesting. So with this commit: 482839e7 and bfbc226d
where we try our best to allocate IRQs for Xen starting from high and
then going down (so that when we are running in PV context with Xen PCI
passthrough we can allocate IRQs for physical devices above IRQ 16 and
not collide with Xen event channels), this would still work.

But we actually wouldn't test the availability of the first sixteen IRQ
for a long time (or never).

> 
> 
> > > ---
> > >  drivers/xen/events.c |   11 ++++++++++-
> > >  1 files changed, 10 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> > > index 8b68fc4..1356fa2 100644
> > > --- a/drivers/xen/events.c
> > > +++ b/drivers/xen/events.c
> > > @@ -339,9 +339,18 @@ static int find_unbound_irq(void)
> > >  	int irq;
> > >  	struct irq_desc *desc;
> > >  
> > > -	for (irq = 0; irq < nr_irqs; irq++)
> > > +	for (irq = 0; irq < nr_irqs; irq++) {
> > > +		desc = irq_to_desc(irq);
> > > +		/* only 0->15 have init'd desc; handle irq > 16 */
> > > +		if (desc == NULL)
> > > +			break;
> > > +		if (desc->chip == &no_irq_chip)
> > > +			break;
> > > +		if (desc->chip != &xen_dynamic_chip)
> > > +			continue;
> > >  		if (irq_info[irq].type == IRQT_UNBOUND)
> > >  			break;
> > > +	}
> > >  
> > >  	if (irq == nr_irqs)
> > >  		panic("No available IRQ to bind to: increase nr_irqs!\n");
> > > -- 
> > > 1.5.4.3
> > > 
> > > 
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.xensource.com
> > > http://lists.xensource.com/xen-devel
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-27 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10 14:20 [PATCH 04/11] Fix find_unbound_irq in presence of ioapic irqs Stefano Stabellini
  -- strict thread matches above, loose matches on Subject: below --
2010-05-24 18:25 [PATCH 0 of 12] PV on HVM Xen Stefano Stabellini
2010-05-24 18:27 ` [PATCH 04/11] Fix find_unbound_irq in presence of ioapic irqs Stefano Stabellini
2010-05-26 18:26   ` [Xen-devel] " Konrad Rzeszutek Wilk
2010-05-27 14:49     ` Stefano Stabellini
2010-05-27 15:36       ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).