From: "Jan Beulich" Subject: [PATCH 07/11] x86: IO-APIC cleanup Date: Wed, 09 Mar 2011 12:28:45 +0000 Message-ID: <4D77808D0200007800035822@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4D617A6D.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. --=__Part4D617A6D.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Remove unused and pointless bits from IO-APIC handling code. Move whatever possible into .init.*, and some data items into .data.read_mostly. Adjust some types. Signed-off-by: Jan Beulich --- 2011-03-09.orig/xen/arch/x86/apic.c +++ 2011-03-09/xen/arch/x86/apic.c @@ -355,7 +355,6 @@ void disable_local_APIC(void) } } =20 -extern int ioapic_ack_new; /* * This is to verify that we're looking at a real local APIC. * Check these against your board if the CPUs aren't getting --- 2011-03-09.orig/xen/arch/x86/i8259.c +++ 2011-03-09/xen/arch/x86/i8259.c @@ -129,7 +129,7 @@ static unsigned int cached_irq_mask =3D 0x * this 'mixed mode' IRQ handling costs nothing because it's only used * at IRQ setup time. */ -unsigned long io_apic_irqs; +unsigned int __read_mostly io_apic_irqs; =20 void disable_8259A_irq(unsigned int irq) { --- 2011-03-09.orig/xen/arch/x86/io_apic.c +++ 2011-03-09/xen/arch/x86/io_apic.c @@ -44,13 +44,14 @@ static struct { int pin, apic; } ioapic_ static DEFINE_SPINLOCK(ioapic_lock); =20 bool_t __read_mostly skip_ioapic_setup; +bool_t __read_mostly ioapic_ack_new =3D 1; =20 #ifndef sis_apic_bug /* * Is the SiS APIC rmw bug present? * -1 =3D don't know, 0 =3D no, 1 =3D yes */ -int sis_apic_bug =3D -1; +s8 __read_mostly sis_apic_bug =3D -1; #endif =20 /* @@ -76,7 +77,7 @@ int __read_mostly nr_ioapics; static struct irq_pin_list { int apic, pin; unsigned int next; -} *irq_2_pin; +} *__read_mostly irq_2_pin; =20 static unsigned int irq_2_pin_free_entry; =20 @@ -1191,7 +1192,7 @@ static void /*__init*/ __print_IO_APIC(v return; } =20 -void print_IO_APIC(void) +static void __init print_IO_APIC(void) { if (apic_verbosity !=3D APIC_QUIET) __print_IO_APIC(); @@ -1321,7 +1322,6 @@ void disable_IO_APIC(void) * by Matt Domsch Tue Dec 21 12:25:05 CST 1999 */ =20 -#ifndef CONFIG_X86_NUMAQ static void __init setup_ioapic_ids_from_mpc(void) { union IO_APIC_reg_00 reg_00; @@ -1428,9 +1428,6 @@ static void __init setup_ioapic_ids_from apic_printk(APIC_VERBOSE, " ok.\n"); } } -#else -static void __init setup_ioapic_ids_from_mpc(void) { } -#endif =20 /* * There is a nasty bug in some older SMP boards, their mptable lies @@ -1546,8 +1543,7 @@ static unsigned int startup_level_ioapic return 0; /* don't check for pending */ } =20 -int __read_mostly ioapic_ack_new =3D 1; -static void setup_ioapic_ack(char *s) +static void __init setup_ioapic_ack(char *s) { if ( !strcmp(s, "old") ) ioapic_ack_new =3D 0; @@ -1716,9 +1712,7 @@ static void disable_edge_ioapic_irq(unsi { } =20 -static void end_edge_ioapic_irq(unsigned int irq) - { - } +#define end_edge_ioapic_irq disable_edge_ioapic_irq =20 /* * Level and edge triggered IO-APIC interrupts need different handling, @@ -1820,7 +1814,7 @@ static void ack_lapic_irq(unsigned int i ack_APIC_irq(); } =20 -static void end_lapic_irq(unsigned int irq) { /* nothing */ } +#define end_lapic_irq end_edge_ioapic_irq =20 static hw_irq_controller lapic_irq_type =3D { .typename =3D "local-APIC-edge", --- 2011-03-09.orig/xen/arch/x86/irq.c +++ 2011-03-09/xen/arch/x86/irq.c @@ -1092,7 +1092,6 @@ int pirq_guest_unmask(struct domain *d) return 0; } =20 -extern int ioapic_ack_new; static int pirq_acktype(struct domain *d, int pirq) { struct irq_desc *desc; --- 2011-03-09.orig/xen/include/asm-x86/io_apic.h +++ 2011-03-09/xen/include/asm-x86/io_apic.h @@ -169,7 +169,7 @@ static inline void io_apic_eoi(unsigned=20 * Older SiS APIC requires we rewrite the index regiser */ #ifdef __i386__ -extern int sis_apic_bug; +extern s8 sis_apic_bug; #else #define sis_apic_bug 0 #endif @@ -184,6 +184,7 @@ static inline void io_apic_modify(unsign =20 /* 1 if "noapic" boot option passed */ extern bool_t skip_ioapic_setup; +extern s8 ioapic_ack_new; =20 #ifdef CONFIG_ACPI_BOOT extern int io_apic_get_unique_id (int ioapic, int apic_id); --- 2011-03-09.orig/xen/include/asm-x86/irq.h +++ 2011-03-09/xen/include/asm-x86/irq.h @@ -99,10 +99,9 @@ int i8259A_resume(void); =20 void setup_IO_APIC(void); void disable_IO_APIC(void); -void print_IO_APIC(void); void setup_ioapic_dest(void); =20 -extern unsigned long io_apic_irqs; +extern unsigned int io_apic_irqs; =20 DECLARE_PER_CPU(unsigned int, irq_count); =20 --=__Part4D617A6D.0__= Content-Type: text/plain; name="x86-ioapic-cleanup.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-ioapic-cleanup.patch" Remove unused and pointless bits from IO-APIC handling code. Move=0Awhateve= r possible into .init.*, and some data items into=0A.data.read_mostly. = Adjust some types.=0A=0ASigned-off-by: Jan Beulich =0A= =0A--- 2011-03-09.orig/xen/arch/x86/apic.c=0A+++ 2011-03-09/xen/arch/x86/ap= ic.c=0A@@ -355,7 +355,6 @@ void disable_local_APIC(void)=0A }=0A }=0A = =0A-extern int ioapic_ack_new;=0A /*=0A * This is to verify that we're = looking at a real local APIC.=0A * Check these against your board if the = CPUs aren't getting=0A--- 2011-03-09.orig/xen/arch/x86/i8259.c=0A+++ = 2011-03-09/xen/arch/x86/i8259.c=0A@@ -129,7 +129,7 @@ static unsigned int = cached_irq_mask =3D 0x=0A * this 'mixed mode' IRQ handling costs nothing = because it's only used=0A * at IRQ setup time.=0A */=0A-unsigned long = io_apic_irqs;=0A+unsigned int __read_mostly io_apic_irqs;=0A =0A void = disable_8259A_irq(unsigned int irq)=0A {=0A--- 2011-03-09.orig/xen/arch/x86= /io_apic.c=0A+++ 2011-03-09/xen/arch/x86/io_apic.c=0A@@ -44,13 +44,14 @@ = static struct { int pin, apic; } ioapic_=0A static DEFINE_SPINLOCK(ioapic_l= ock);=0A =0A bool_t __read_mostly skip_ioapic_setup;=0A+bool_t __read_mostl= y ioapic_ack_new =3D 1;=0A =0A #ifndef sis_apic_bug=0A /*=0A * Is the SiS = APIC rmw bug present?=0A * -1 =3D don't know, 0 =3D no, 1 =3D yes=0A = */=0A-int sis_apic_bug =3D -1;=0A+s8 __read_mostly sis_apic_bug =3D -1;=0A = #endif=0A =0A /*=0A@@ -76,7 +77,7 @@ int __read_mostly nr_ioapics;=0A = static struct irq_pin_list {=0A int apic, pin;=0A unsigned int = next;=0A-} *irq_2_pin;=0A+} *__read_mostly irq_2_pin;=0A =0A static = unsigned int irq_2_pin_free_entry;=0A =0A@@ -1191,7 +1192,7 @@ static void = /*__init*/ __print_IO_APIC(v=0A return;=0A }=0A =0A-void print_IO_APIC(= void)=0A+static void __init print_IO_APIC(void)=0A {=0A if (apic_verbos= ity !=3D APIC_QUIET)=0A __print_IO_APIC();=0A@@ -1321,7 +1322,6 @@ = void disable_IO_APIC(void)=0A * by Matt Domsch = Tue Dec 21 12:25:05 CST 1999=0A */=0A =0A-#ifndef CONFIG_X86_NUMAQ=0A = static void __init setup_ioapic_ids_from_mpc(void)=0A {=0A union = IO_APIC_reg_00 reg_00;=0A@@ -1428,9 +1428,6 @@ static void __init = setup_ioapic_ids_from=0A apic_printk(APIC_VERBOSE, " = ok.\n");=0A }=0A }=0A-#else=0A-static void __init setup_ioapic_ids_from= _mpc(void) { }=0A-#endif=0A =0A /*=0A * There is a nasty bug in some = older SMP boards, their mptable lies=0A@@ -1546,8 +1543,7 @@ static = unsigned int startup_level_ioapic=0A return 0; /* don't check for = pending */=0A }=0A =0A-int __read_mostly ioapic_ack_new =3D 1;=0A-static = void setup_ioapic_ack(char *s)=0A+static void __init setup_ioapic_ack(char = *s)=0A {=0A if ( !strcmp(s, "old") )=0A ioapic_ack_new =3D = 0;=0A@@ -1716,9 +1712,7 @@ static void disable_edge_ioapic_irq(unsi=0A = {=0A }=0A =0A-static void end_edge_ioapic_irq(unsigned int irq)=0A- {=0A- = }=0A+#define end_edge_ioapic_irq disable_edge_ioapic_irq=0A =0A /*=0A * = Level and edge triggered IO-APIC interrupts need different handling,=0A@@ = -1820,7 +1814,7 @@ static void ack_lapic_irq(unsigned int i=0A = ack_APIC_irq();=0A }=0A =0A-static void end_lapic_irq(unsigned int irq) { = /* nothing */ }=0A+#define end_lapic_irq end_edge_ioapic_irq=0A =0A static = hw_irq_controller lapic_irq_type =3D {=0A .typename =3D = "local-APIC-edge",=0A--- 2011-03-09.orig/xen/arch/x86/irq.c=0A+++ = 2011-03-09/xen/arch/x86/irq.c=0A@@ -1092,7 +1092,6 @@ int pirq_guest_unmask= (struct domain *d)=0A return 0;=0A }=0A =0A-extern int ioapic_ack_new;= =0A static int pirq_acktype(struct domain *d, int pirq)=0A {=0A struct = irq_desc *desc;=0A--- 2011-03-09.orig/xen/include/asm-x86/io_apic.h=0A+++ = 2011-03-09/xen/include/asm-x86/io_apic.h=0A@@ -169,7 +169,7 @@ static = inline void io_apic_eoi(unsigned =0A * Older SiS APIC requires we rewrite = the index regiser=0A */=0A #ifdef __i386__=0A-extern int sis_apic_bug;=0A+= extern s8 sis_apic_bug;=0A #else=0A #define sis_apic_bug 0=0A #endif=0A@@ = -184,6 +184,7 @@ static inline void io_apic_modify(unsign=0A =0A /* 1 if = "noapic" boot option passed */=0A extern bool_t skip_ioapic_setup;=0A+exter= n s8 ioapic_ack_new;=0A =0A #ifdef CONFIG_ACPI_BOOT=0A extern int = io_apic_get_unique_id (int ioapic, int apic_id);=0A--- 2011-03-09.orig/xen/= include/asm-x86/irq.h=0A+++ 2011-03-09/xen/include/asm-x86/irq.h=0A@@ = -99,10 +99,9 @@ int i8259A_resume(void);=0A =0A void setup_IO_APIC(void);= =0A void disable_IO_APIC(void);=0A-void print_IO_APIC(void);=0A void = setup_ioapic_dest(void);=0A =0A-extern unsigned long io_apic_irqs;=0A+exter= n unsigned int io_apic_irqs;=0A =0A DECLARE_PER_CPU(unsigned int, = irq_count);=0A =0A --=__Part4D617A6D.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 --=__Part4D617A6D.0__=--