WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: Continuing problems booting

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] Re: Continuing problems booting
From: Gerd Hoffmann <kraxel@xxxxxxxxxx>
Date: Tue, 10 Mar 2009 10:39:57 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, M A Young <m.a.young@xxxxxxxxxxxx>
Delivery-date: Tue, 10 Mar 2009 02:40:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49B542D5.1070601@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.GSO.2.00.0902201239010.757@xxxxxxxxxxxxxxxx> <alpine.GSO.2.00.0902201554500.757@xxxxxxxxxxxxxxxx> <alpine.LFD.2.00.0902211225540.14632@xxxxxxxxxxxxxxx> <49A0F68D.9070306@xxxxxxxx> <alpine.LFD.2.00.0902220922040.4149@xxxxxxxxxxxxxxx> <alpine.LFD.2.00.0902221449410.17196@xxxxxxxxxxxxxxx> <49A187B8.7000902@xxxxxxxx> <alpine.LFD.2.00.0902222257230.4472@xxxxxxxxxxxxxxx> <49A1DD80.1080903@xxxxxxxx> <alpine.LFD.2.00.0902222359090.4472@xxxxxxxxxxxxxxx> <49A241EC.3050300@xxxxxxxx> <alpine.LFD.2.00.0902242228550.12607@xxxxxxxxxxxxxxx> <alpine.LFD.2.00.0902272317030.17305@xxxxxxxxxxxxxxx> <49A890FF.4080803@xxxxxxxx> <49ABAF7C.6050906@xxxxxxxxxx> <49AF5FEB.4010508@xxxxxxxx> <49AF80C1.2060307@xxxxxxxxxx> <49AFB122.5040301@xxxxxxxxxx> <49B02069.5000207@xxxxxxxx> <49B12FE4.7050503@xxxxxxxxxx> <49B13F2F.1060100@xxxxxxxx> <49B1426E.3080901@xxxxxxxxxx> <49B14A87.1030504@xxxxxxxx> <49B51796.1050005@xxxxxxxxxx> <49B542D5.1070601@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (X11/20090105)
Jeremy Fitzhardinge wrote:
> 
> Yes, that's what I suspected.   Can you write up a proper patch?

I've two patches for you.  The first turns the silly "xen-pirq-pirq" in
/proc/interrupts into something useful.  The second does proper legacy
irq setup on top of that.

enjoy,
  Gerd

From 0b103dac4b001d301608a52574a32c8adf038d0d Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 9 Mar 2009 14:23:56 +0100
Subject: [PATCH 1/2] xen: set pirq name to something useful.

---
 arch/x86/xen/pci.c   |    2 +-
 drivers/xen/events.c |    4 ++--
 include/xen/events.h |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
index 502ff5f..dd45e76 100644
--- a/arch/x86/xen/pci.c
+++ b/arch/x86/xen/pci.c
@@ -48,7 +48,7 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
        printk(KERN_DEBUG "xen: registering gsi %u triggering %d polarity %d\n",
               gsi, triggering, polarity);
 
-       irq = xen_allocate_pirq(gsi);
+       irq = xen_allocate_pirq(gsi, (triggering == ACPI_EDGE_SENSITIVE) ? 
"edge" : "level");
 
        printk(KERN_DEBUG "xen: --> irq=%d\n", irq);
 
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 6098fca..3888e2c 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -533,7 +533,7 @@ static int find_irq_by_gsi(unsigned gsi)
  * event channel until the irq actually started up.  Return an
  * existing irq if we've already got one for the gsi.
  */
-int xen_allocate_pirq(unsigned gsi)
+int xen_allocate_pirq(unsigned gsi, char *name)
 {
        int irq;
        struct physdev_irq irq_op;
@@ -555,7 +555,7 @@ int xen_allocate_pirq(unsigned gsi)
                irq = find_unbound_irq();
 
        set_irq_chip_and_handler_name(irq, &xen_pirq_chip,
-                                     handle_level_irq, "pirq");
+                                     handle_level_irq, name);
 
        irq_op.irq = irq;
        if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op)) {
diff --git a/include/xen/events.h b/include/xen/events.h
index 2cdb0de..0814763 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -67,7 +67,7 @@ unsigned irq_from_evtchn(unsigned int evtchn);
 /* Allocate an irq for a physical interrupt, given a gsi.  "Legacy"
    GSIs are identity mapped; others are dynamically allocated as
    usual. */
-int xen_allocate_pirq(unsigned gsi);
+int xen_allocate_pirq(unsigned gsi, char *name);
 
 /* Return vector allocated to pirq */
 int xen_vector_from_irq(unsigned pirq);
-- 
1.6.1.3

From c41318ed610a4e7fc89529afe94f530bfaa94718 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Mar 2009 10:12:30 +0100
Subject: [PATCH 2/2] xen: fix legacy irq setup, make ioapic-less machines work.

---
 arch/x86/xen/pci.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
index dd45e76..c455b5d 100644
--- a/arch/x86/xen/pci.c
+++ b/arch/x86/xen/pci.c
@@ -64,13 +64,17 @@ void __init xen_setup_pirqs(void)
 {
        int irq;
 
+       if (0 == nr_ioapics) {
+               for (irq=0; irq < NR_IRQS_LEGACY; irq++)
+                       xen_allocate_pirq(irq, "legacy");
+               return;
+       }
+
        /* Pre-allocate legacy irqs */
        for (irq=0; irq < NR_IRQS_LEGACY; irq++) {
-               int trigger, polarity;
-
-               if (acpi_get_override_irq(irq, &trigger, &polarity) == -1)
-                       continue;
+               int trigger= 1, polarity = 0;
 
+               acpi_get_override_irq(irq, &trigger, &polarity);
                xen_register_gsi(irq,
                        trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE,
                        polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH);
-- 
1.6.1.3

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>