From: "Jan Beulich" Subject: [PATCH 6/6] eliminate remaining uses of struct irq_cfg Date: Mon, 07 Nov 2011 09:59:40 +0000 Message-ID: <4EB7BA1C020000780005F4C9@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part210ED51C.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part210ED51C.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2279,7 +2279,6 @@ int ioapic_guest_write(unsigned long phy int apic, pin, irq, ret, vector, pirq; struct IO_APIC_route_entry rte =3D { 0 }; unsigned long flags; - struct irq_cfg *cfg; struct irq_desc *desc; =20 if ( (apic =3D ioapic_physbase_to_id(physbase)) < 0 ) @@ -2321,7 +2320,6 @@ int ioapic_guest_write(unsigned long phy return irq; =20 desc =3D irq_to_desc(irq); - cfg =3D &desc->arch; =20 /* * Since PHYSDEVOP_alloc_irq_vector is dummy, rte.vector is the pirq @@ -2338,7 +2336,7 @@ int ioapic_guest_write(unsigned long phy spin_lock_irqsave(&ioapic_lock, flags); ret =3D io_apic_read(apic, 0x10 + 2 * pin); spin_unlock_irqrestore(&ioapic_lock, flags); - rte.vector =3D cfg->vector; + rte.vector =3D desc->arch.vector; if ( *(u32*)&rte !=3D ret ) WARN_BOGUS_WRITE("old_entry=3D%08x pirq=3D%d\n%s: " "Attempt to modify IO-APIC pin for in-use = IRQ!\n", @@ -2346,7 +2344,7 @@ int ioapic_guest_write(unsigned long phy return 0; } =20 - if ( cfg->vector <=3D 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) { + if ( desc->arch.vector <=3D 0 || desc->arch.vector > LAST_DYNAMIC_VECT= OR ) { vector =3D assign_irq_vector(irq); if ( vector < 0 ) return vector; @@ -2370,7 +2368,7 @@ int ioapic_guest_write(unsigned long phy /* Mask iff level triggered. */ rte.mask =3D rte.trigger; /* Set the vector field to the real vector! */ - rte.vector =3D cfg->vector; + rte.vector =3D desc->arch.vector; =20 SET_DEST(rte.dest.dest32, rte.dest.logical.logical_dest, cpu_mask_to_apicid(desc->arch.cpu_mask)); --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -285,16 +285,14 @@ void destroy_irq(unsigned int irq) int irq_to_vector(int irq) { int vector =3D -1; - struct irq_cfg *cfg; =20 BUG_ON(irq >=3D nr_irqs || irq < 0); =20 if (IO_APIC_IRQ(irq)) vector =3D irq_vector[irq]; - else if(MSI_IRQ(irq)) { - cfg =3D irq_cfg(irq); - vector =3D cfg->vector; - } else + else if (MSI_IRQ(irq)) + vector =3D irq_to_desc(irq)->arch.vector; + else vector =3D LEGACY_VECTOR(irq); =20 return vector; --- a/xen/include/asm-ia64/linux-xen/asm/irq.h +++ b/xen/include/asm-ia64/linux-xen/asm/irq.h @@ -15,8 +15,7 @@ #define NR_IRQS 256 =20 #ifdef XEN -struct irq_cfg { -#define arch_irq_desc irq_cfg +struct arch_irq_desc { int vector; cpumask_var_t cpu_mask; }; @@ -63,9 +62,6 @@ extern int request_irq_vector(unsigned i #define create_irq(x) assign_irq_vector(AUTO_ASSIGN_IRQ) #define destroy_irq(x) free_irq_vector(x) =20 -#define irq_cfg(x) (&irq_desc[x].arch) -#define irq_to_desc(x) (&irq_desc[x] - #define irq_complete_move(x) do {} \ while(!x) =20 --- a/xen/include/asm-x86/irq.h +++ b/xen/include/asm-x86/irq.h @@ -20,17 +20,13 @@ =20 #define LEGACY_VECTOR(irq) ((irq) + FIRST_LEGACY_VECTOR) =20 -#define irq_to_desc(irq) (&irq_desc[irq]) -#define irq_cfg(irq) (&irq_desc[irq].arch) - typedef struct { DECLARE_BITMAP(_bits,NR_VECTORS); } vmask_t; =20 struct irq_desc; =20 -struct irq_cfg { -#define arch_irq_desc irq_cfg +struct arch_irq_desc { s16 vector; /* vector itself is only 8 bits, */ s16 old_vector; /* but we use -1 for unassigned */ cpumask_var_t cpu_mask; @@ -42,7 +38,7 @@ struct irq_cfg { s8 used; }; =20 -/* For use with irq_cfg.used */ +/* For use with irq_desc.arch.used */ #define IRQ_UNUSED (0) #define IRQ_USED (1) #define IRQ_RESERVED (-1) --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -84,6 +84,8 @@ typedef struct irq_desc { struct list_head rl_link; } __cacheline_aligned irq_desc_t; =20 +#define irq_to_desc(irq) (&irq_desc[irq]) + int init_one_irq_desc(struct irq_desc *); int arch_init_one_irq_desc(struct irq_desc *); =20 --=__Part210ED51C.0__= Content-Type: text/plain; name="eliminate-irq_cfg.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="eliminate-irq_cfg.patch" eliminate remaining uses of struct irq_cfg=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/arch/x86/io_apic.c=0A+++ b/xen/arch/x86/= io_apic.c=0A@@ -2279,7 +2279,6 @@ int ioapic_guest_write(unsigned long = phy=0A int apic, pin, irq, ret, vector, pirq;=0A struct IO_APIC_rou= te_entry rte =3D { 0 };=0A unsigned long flags;=0A- struct irq_cfg = *cfg;=0A struct irq_desc *desc;=0A =0A if ( (apic =3D ioapic_physba= se_to_id(physbase)) < 0 )=0A@@ -2321,7 +2320,6 @@ int ioapic_guest_write(un= signed long phy=0A return irq;=0A =0A desc =3D irq_to_desc(irq)= ;=0A- cfg =3D &desc->arch;=0A =0A /*=0A * Since PHYSDEVOP_alloc= _irq_vector is dummy, rte.vector is the pirq=0A@@ -2338,7 +2336,7 @@ int = ioapic_guest_write(unsigned long phy=0A spin_lock_irqsave(&ioapic_l= ock, flags);=0A ret =3D io_apic_read(apic, 0x10 + 2 * pin);=0A = spin_unlock_irqrestore(&ioapic_lock, flags);=0A- rte.vector =3D = cfg->vector;=0A+ rte.vector =3D desc->arch.vector;=0A if ( = *(u32*)&rte !=3D ret )=0A WARN_BOGUS_WRITE("old_entry=3D%08x = pirq=3D%d\n%s: "=0A "Attempt to modify = IO-APIC pin for in-use IRQ!\n",=0A@@ -2346,7 +2344,7 @@ int ioapic_guest_wr= ite(unsigned long phy=0A return 0;=0A }=0A =0A- if ( = cfg->vector <=3D 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {=0A+ if ( = desc->arch.vector <=3D 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ) {=0A = vector =3D assign_irq_vector(irq);=0A if ( vector < 0 )=0A = return vector;=0A@@ -2370,7 +2368,7 @@ int ioapic_guest_write(u= nsigned long phy=0A /* Mask iff level triggered. */=0A rte.mask = =3D rte.trigger;=0A /* Set the vector field to the real vector! */=0A- = rte.vector =3D cfg->vector;=0A+ rte.vector =3D desc->arch.vector;=0A = =0A SET_DEST(rte.dest.dest32, rte.dest.logical.logical_dest,=0A = cpu_mask_to_apicid(desc->arch.cpu_mask));=0A--- a/xen/arch/x86/irq.c= =0A+++ b/xen/arch/x86/irq.c=0A@@ -285,16 +285,14 @@ void destroy_irq(unsign= ed int irq)=0A int irq_to_vector(int irq)=0A {=0A int vector =3D = -1;=0A- struct irq_cfg *cfg;=0A =0A BUG_ON(irq >=3D nr_irqs || irq = < 0);=0A =0A if (IO_APIC_IRQ(irq))=0A vector =3D irq_vector[irq= ];=0A- else if(MSI_IRQ(irq)) {=0A- cfg =3D irq_cfg(irq);=0A- = vector =3D cfg->vector;=0A- } else=0A+ else if (MSI_IRQ(irq))=0A+ = vector =3D irq_to_desc(irq)->arch.vector;=0A+ else=0A = vector =3D LEGACY_VECTOR(irq);=0A =0A return vector;=0A--- a/xen/includ= e/asm-ia64/linux-xen/asm/irq.h=0A+++ b/xen/include/asm-ia64/linux-xen/asm/i= rq.h=0A@@ -15,8 +15,7 @@=0A #define NR_IRQS 256=0A =0A #ifdef = XEN=0A-struct irq_cfg {=0A-#define arch_irq_desc irq_cfg=0A+struct = arch_irq_desc {=0A int vector;=0A cpumask_var_t = cpu_mask;=0A };=0A@@ -63,9 +62,6 @@ extern int request_irq_vector(unsigned = i=0A #define create_irq(x) assign_irq_vector(AUTO_ASSIGN_IRQ)=0A #define = destroy_irq(x) free_irq_vector(x)=0A =0A-#define irq_cfg(x) = (&irq_desc[x].arch)=0A-#define irq_to_desc(x) (&irq_desc[x]=0A-=0A = #define irq_complete_move(x) do {} \=0A while(!x)=0A =0A--- a/xen/inclu= de/asm-x86/irq.h=0A+++ b/xen/include/asm-x86/irq.h=0A@@ -20,17 +20,13 = @@=0A =0A #define LEGACY_VECTOR(irq) ((irq) + FIRST_LEGACY_VECTOR)= =0A =0A-#define irq_to_desc(irq) (&irq_desc[irq])=0A-#define irq_cfg(irq= ) (&irq_desc[irq].arch)=0A-=0A typedef struct {=0A DECLARE_BITMA= P(_bits,NR_VECTORS);=0A } vmask_t;=0A =0A struct irq_desc;=0A =0A-struct = irq_cfg {=0A-#define arch_irq_desc irq_cfg=0A+struct arch_irq_desc {=0A = s16 vector; /* vector itself is only 8 bits, */=0A = s16 old_vector; /* but we use -1 for unassigned */=0A = cpumask_var_t cpu_mask;=0A@@ -42,7 +38,7 @@ struct irq_cfg {=0A = s8 used;=0A };=0A =0A-/* For use with irq_cfg.used */=0A+/* For use = with irq_desc.arch.used */=0A #define IRQ_UNUSED (0)=0A #define = IRQ_USED (1)=0A #define IRQ_RESERVED (-1)=0A--- a/xen/include/xen= /irq.h=0A+++ b/xen/include/xen/irq.h=0A@@ -84,6 +84,8 @@ typedef struct = irq_desc {=0A struct list_head rl_link;=0A } __cacheline_aligned = irq_desc_t;=0A =0A+#define irq_to_desc(irq) (&irq_desc[irq])=0A+=0A int = init_one_irq_desc(struct irq_desc *);=0A int arch_init_one_irq_desc(struct = irq_desc *);=0A =0A --=__Part210ED51C.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part210ED51C.0__=--