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 07/11] x86: IO-APIC cleanup

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 07/11] x86: IO-APIC cleanup
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Wed, 09 Mar 2011 12:28:45 +0000
Delivery-date: Wed, 09 Mar 2011 04:35:37 -0800
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
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 <jbeulich@xxxxxxxxxx>

--- 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)
     }
 }
 
-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 = 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;
 
 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);
 
 bool_t __read_mostly skip_ioapic_setup;
+bool_t __read_mostly ioapic_ack_new = 1;
 
 #ifndef sis_apic_bug
 /*
  * Is the SiS APIC rmw bug present?
  * -1 = don't know, 0 = no, 1 = yes
  */
-int sis_apic_bug = -1;
+s8 __read_mostly sis_apic_bug = -1;
 #endif
 
 /*
@@ -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;
 
 static unsigned int irq_2_pin_free_entry;
 
@@ -1191,7 +1192,7 @@ static void /*__init*/ __print_IO_APIC(v
     return;
 }
 
-void print_IO_APIC(void)
+static void __init print_IO_APIC(void)
 {
     if (apic_verbosity != APIC_QUIET)
         __print_IO_APIC();
@@ -1321,7 +1322,6 @@ void disable_IO_APIC(void)
  * by Matt Domsch <Matt_Domsch@xxxxxxxx>  Tue Dec 21 12:25:05 CST 1999
  */
 
-#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
 
 /*
  * 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 */
 }
 
-int __read_mostly ioapic_ack_new = 1;
-static void setup_ioapic_ack(char *s)
+static void __init setup_ioapic_ack(char *s)
 {
     if ( !strcmp(s, "old") )
         ioapic_ack_new = 0;
@@ -1716,9 +1712,7 @@ static void disable_edge_ioapic_irq(unsi
 {
 }
 
-static void end_edge_ioapic_irq(unsigned int irq)
- {
- }
+#define end_edge_ioapic_irq disable_edge_ioapic_irq
 
 /*
  * 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();
 }
 
-static void end_lapic_irq(unsigned int irq) { /* nothing */ }
+#define end_lapic_irq end_edge_ioapic_irq
 
 static hw_irq_controller lapic_irq_type = {
     .typename  = "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;
 }
 
-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 
  * 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
 
 /* 1 if "noapic" boot option passed */
 extern bool_t skip_ioapic_setup;
+extern s8 ioapic_ack_new;
 
 #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);
 
 void setup_IO_APIC(void);
 void disable_IO_APIC(void);
-void print_IO_APIC(void);
 void setup_ioapic_dest(void);
 
-extern unsigned long io_apic_irqs;
+extern unsigned int io_apic_irqs;
 
 DECLARE_PER_CPU(unsigned int, irq_count);
 


Attachment: x86-ioapic-cleanup.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 07/11] x86: IO-APIC cleanup, Jan Beulich <=