[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xen: remove nr_irqs_gsi from generic code


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Thu, 20 Dec 2012 16:11:20 +0000
  • Delivery-date: Thu, 20 Dec 2012 16:11:25 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1355933089 0
# Node ID 581215737128936dcf92eb23efa02d2859946751
# Parent  613d9705544416f80ade81a773aa25b581348a00
xen: remove nr_irqs_gsi from generic code

The concept is X86 specific.

AFAICT the generic concept here is the number of static physical IRQs
which the current hardware has, so call this nr_static_irqs.

Also using "defined NR_IRQS" as a standin for x86 might have made
sense at one point but its just cleaner to push the necessary
definitions into asm/irq.h.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 613d97055444 -r 581215737128 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S      Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/arch/arm/dummy.S      Wed Dec 19 16:04:49 2012 +0000
@@ -6,5 +6,3 @@ x:      .word 0xe7f000f0 /* Undefined instruc
        .globl x; \
 x:     mov pc, lr
        
-/* PIRQ support */
-DUMMY(nr_irqs_gsi);
diff -r 613d97055444 -r 581215737128 xen/common/domain.c
--- a/xen/common/domain.c       Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/common/domain.c       Wed Dec 19 16:04:49 2012 +0000
@@ -259,9 +259,9 @@ struct domain *domain_create(
         atomic_inc(&d->pause_count);
 
         if ( domid )
-            d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
+            d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
         else
-            d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
+            d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
         if ( d->nr_pirqs > nr_irqs )
             d->nr_pirqs = nr_irqs;
 
diff -r 613d97055444 -r 581215737128 xen/include/asm-arm/irq.h
--- a/xen/include/asm-arm/irq.h Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/asm-arm/irq.h Wed Dec 19 16:04:49 2012 +0000
@@ -21,6 +21,9 @@ struct irq_cfg {
 #define NR_IRQS                1024
 #define nr_irqs NR_IRQS
 
+#define nr_irqs NR_IRQS
+#define nr_static_irqs NR_IRQS
+
 struct irq_desc;
 
 struct irq_desc *__irq_to_desc(int irq);
diff -r 613d97055444 -r 581215737128 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/asm-x86/irq.h Wed Dec 19 16:04:49 2012 +0000
@@ -11,6 +11,10 @@
 #include <irq_vectors.h>
 #include <asm/percpu.h>
 
+extern unsigned int nr_irqs_gsi;
+extern unsigned int nr_irqs;
+#define nr_static_irqs nr_irqs_gsi
+
 #define IO_APIC_IRQ(irq)    (platform_legacy_irq(irq) ?    \
                             (1 << (irq)) & io_apic_irqs : \
                             (irq) < nr_irqs_gsi)
diff -r 613d97055444 -r 581215737128 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/xen/irq.h     Wed Dec 19 16:04:49 2012 +0000
@@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type h
 
 #include <asm/irq.h>
 
-#ifdef NR_IRQS
-# define nr_irqs NR_IRQS
-# define nr_irqs_gsi NR_IRQS
-#else
-extern unsigned int nr_irqs_gsi;
-extern unsigned int nr_irqs;
-#endif
-
 struct msi_desc;
 /*
  * This is the "IRQ descriptor", which contains various information
diff -r 613d97055444 -r 581215737128 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c     Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/xsm/flask/hooks.c     Wed Dec 19 16:04:49 2012 +0000
@@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid
     struct irq_desc *desc = irq_to_desc(irq);
     if ( irq >= nr_irqs || irq < 0 )
         return -EINVAL;
-    if ( irq < nr_irqs_gsi ) {
+    if ( irq < nr_static_irqs ) {
         if (ad) {
             AVC_AUDIT_DATA_INIT(ad, IRQ);
             ad->irq = irq;
@@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct
     if ( rc )
         return rc;
 
-    if ( irq >= nr_irqs_gsi && msi ) {
+    if ( irq >= nr_static_irqs && msi ) {
         u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
         AVC_AUDIT_DATA_INIT(&ad, DEV);
         ad.device = machine_bdf;

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.