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

[Xen-devel] [PATCH] x86: IO-APIC code has no dependency on PCI

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: IO-APIC code has no dependency on PCI
From: "Jan Beulich" <JBeulich@xxxxxxxx>
Date: Wed, 21 Sep 2011 12:01:58 +0100
Delivery-date: Wed, 21 Sep 2011 04:06:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The IRQ handling code requires pcidevs_lock to be held only for MSI
interrupts.

As the handling of which was now fully moved into msi.c (i.e. while
applying fine without, the patch needs to be applied after the one
titled "x86: split MSI IRQ chip"), io_apic.c now also doesn't need to
include PCI headers anymore.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -27,8 +27,6 @@
 #include <xen/delay.h>
 #include <xen/sched.h>
 #include <xen/acpi.h>
-#include <xen/pci.h>
-#include <xen/pci_regs.h>
 #include <xen/keyhandler.h>
 #include <asm/mc146818rtc.h>
 #include <asm/smp.h>
@@ -2493,12 +2491,10 @@ int ioapic_guest_write(unsigned long phy
 
         add_pin_to_irq(irq, apic, pin);
     }
-    spin_lock(&pcidevs_lock);
     spin_lock(&dom0->event_lock);
     ret = map_domain_pirq(dom0, pirq, irq,
             MAP_PIRQ_TYPE_GSI, NULL);
     spin_unlock(&dom0->event_lock);
-    spin_unlock(&pcidevs_lock);
     if ( ret < 0 )
         return ret;
 
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1661,10 +1661,7 @@ int map_domain_pirq(
     struct pirq *info;
     struct irq_desc *desc;
     unsigned long flags;
-    struct msi_desc *msi_desc;
-    struct pci_dev *pdev = NULL;
 
-    ASSERT(spin_is_locked(&pcidevs_lock));
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( !IS_PRIV(current->domain) &&
@@ -1707,6 +1704,10 @@ int map_domain_pirq(
     if ( type == MAP_PIRQ_TYPE_MSI )
     {
         struct msi_info *msi = (struct msi_info *)data;
+        struct msi_desc *msi_desc;
+        struct pci_dev *pdev;
+
+        ASSERT(spin_is_locked(&pcidevs_lock));
 
         ret = -ENODEV;
         if ( !cpu_has_apic )



Attachment: x86-ioapic-no-pci.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: IO-APIC code has no dependency on PCI, Jan Beulich <=