5/8 Move NUMA-Q support into subarch
PATCH 1/1 5/8 Move NUMA-Q support into subarch
Most of code originally by James Cleverdon.
More stuff reformed in the mpparse sections - this time not apic stuff, so we create mach_mpparse.h and stick it in there.
Abstracts out:mpc_oem_bus_info() - stores mappings between buses and nodes/quads. mpc_oem_pci_bus() - stores mappings between global and local pci bus numbers
Changes summit_check() into mps_oem_check() to generalise it.
arch/i386/kernel/mpparse.c +7 -21
@@ -32,6 +32,7 @@#include <asm/io_apic.h> #include <mach_apic.h> +#include <mach_mpparse.h> /* Have we found an MP table */ int smp_found_config;
@@ -191,28 +192,18 @@ void __init MP_processor_info (struct mpstatic void __init MP_bus_info (struct mpc_config_bus *m) {char str[7 ]; -int quad;memcpy (str, m->mpc_bustype,6 ); str[6 ] =0 ; - -if (clustered_apic_mode) { - quad = translation_table[mpc_record]->trans_quad; - mp_bus_id_to_node[m->mpc_busid] = quad; - mp_bus_id_to_local[m->mpc_busid] = translation_table[mpc_record]->trans_local; -printk ("Bus #%d is %s (node %d)\n" , m->mpc_busid, str, quad); - }else { -Dprintk ("Bus #%d is %s\n" , m->mpc_busid, str); - } + +mpc_oem_bus_info (m, str, translation_table[mpc_record]);if (strncmp (str,BUSTYPE_ISA ,sizeof (BUSTYPE_ISA )-1 ) ==0 ) { mp_bus_id_to_type[m->mpc_busid] =MP_BUS_ISA ; }else if (strncmp (str,BUSTYPE_EISA ,sizeof (BUSTYPE_EISA )-1 ) ==0 ) { mp_bus_id_to_type[m->mpc_busid] =MP_BUS_EISA ; }else if (strncmp (str,BUSTYPE_PCI ,sizeof (BUSTYPE_PCI )-1 ) ==0 ) { -if (clustered_apic_mode){ - quad_local_to_mp_bus_id[quad][translation_table[mpc_record]->trans_local] = m->mpc_busid; - } +mpc_oem_pci_bus (m, translation_table[mpc_record]); mp_bus_id_to_type[m->mpc_busid] =MP_BUS_PCI ; mp_bus_id_to_pci_bus[m->mpc_busid] = mp_current_pci_id; mp_current_pci_id++;
@@ -300,6 +291,7 @@ static void __init smp_read_mpc_oem(struint count =sizeof (*oemtable);/* the header size */ unsigned char *oemptr = ((unsigned char *)oemtable)+count; + mpc_record =0 ;printk ("Found an OEM MPC table at %8p - parsing it ... \n" , oemtable);if (memcmp (oemtable->oem_signature,MPC_OEM_SIGNATURE ,4 )) {
@@ -376,7 +368,7 @@ static int __init smp_read_mpc(struct mp str[12 ]=0 ;printk ("Product ID: %s " ,str); -summit_check (oem, str); +mps_oem_check (mpc, oem, str);printk ("APIC at: 0x%lX\n" ,mpc->mpc_lapic);
@@ -387,16 +379,10 @@ static int __init smp_read_mpc(struct mpif (!acpi_lapic) mp_lapic_addr = mpc->mpc_lapic; -if (clustered_apic_mode && mpc->mpc_oemptr) { -/* We need to process the oem mpc tables to tell us which quad things are in ... */ - mpc_record =0 ; -smp_read_mpc_oem ((struct mp_config_oemtable *) mpc->mpc_oemptr, mpc->mpc_oemsize); - mpc_record =0 ; - } -/* * Now process the configuration blocks. */ + mpc_record =0 ;while (count < mpc->mpc_length) {switch (*mpt) {case MP_PROCESSOR :
include/asm-i386/mach-default/mach_apic.h +0 -4
@@ -14,10 +14,6 @@#define APIC_BROADCAST_ID 0x0F#define check_apicid_used (bitmap, apicid) (bitmap & (1 << apicid)) -static inline void summit_check (char *oem,char *productid) -{ -} -static inline int apic_id_registered (void ) { return (test_bit(GET_APIC_ID(apic_read(APIC_ID)),
include/asm-i386/mach-default/mach_mpparse.h +20 -0
@@ -0,0 +1,20 @@ +#ifndef __ASM_MACH_MPPARSE_H +#define __ASM_MACH_MPPARSE_H + +static inline void mpc_oem_bus_info (struct mpc_config_bus *m,char *name, +struct mpc_config_translation *translation) +{ +Dprintk ("Bus #%d is %s\n" , m->mpc_busid, name); +} + +static inline void mpc_oem_pci_bus (struct mpc_config_bus *m, +struct mpc_config_translation *translation) +{ +} + +static inline void mps_oem_check (struct mp_config_table *mpc,char *oem, +char *productid) +{ +} + +#endif /* __ASM_MACH_MPPARSE_H */
include/asm-i386/mach-numaq/mach_apic.h +0 -4
@@ -10,10 +10,6 @@#define APIC_BROADCAST_ID 0x0F#define check_apicid_used (bitmap, apicid) (bitmap & (1 << apicid)) -static inline void summit_check (char *oem,char *productid) -{ -} -static inline int apic_id_registered (void ) {return (1 );
include/asm-i386/mach-numaq/mach_mpparse.h +37 -0
@@ -0,0 +1,37 @@ +#ifndef __ASM_MACH_MPPARSE_H +#define __ASM_MACH_MPPARSE_H + +static void __init smp_read_mpc_oem (struct mp_config_oemtable *oemtable, +unsigned short oemsize); + +static inline void mpc_oem_bus_info (struct mpc_config_bus *m,char *name, +struct mpc_config_translation *translation) +{ +int quad = translation->trans_quad; +int local = translation->trans_local; + + mp_bus_id_to_node[m->mpc_busid] = quad; + mp_bus_id_to_local[m->mpc_busid] = local; +printk ("Bus #%d is %s (node %d)\n" , m->mpc_busid, name, quad); +} + +static inline void mpc_oem_pci_bus (struct mpc_config_bus *m, +struct mpc_config_translation *translation) +{ +int quad = translation->trans_quad; +int local = translation->trans_local; + + quad_local_to_mp_bus_id[quad][local] = m->mpc_busid; +} + +static inline void mps_oem_check (struct mp_config_table *mpc,char *oem, +char *productid) +{ +if (strncmp (oem,"IBM NUMA" ,8 )) +printk ("Warning! May not be a NUMA-Q system!\n" ); +if (mpc->mpc_oemptr) +smp_read_mpc_oem ((struct mp_config_oemtable *) mpc->mpc_oemptr, + mpc->mpc_oemsize); +} + +#endif /* __ASM_MACH_MPPARSE_H */
include/asm-i386/mach-summit/mach_apic.h +0 -6
@@ -26,12 +26,6 @@ static inline unsigned long calculate_ld#define APIC_BROADCAST_ID (x86_summit ? 0xFF : 0x0F)#define check_apicid_used (bitmap, apicid) (0) -static inline void summit_check (char *oem,char *productid) -{ -if (!strncmp (oem,"IBM ENSW" ,8 ) && !strncmp (str,"VIGIL SMP" ,9 )) - x86_summit =1 ; -} -static inline void clustered_apic_check (void ) { printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
include/asm-i386/mach-summit/mach_mpparse.h +22 -0
@@ -0,0 +1,22 @@ +#ifndef __ASM_MACH_MPPARSE_H +#define __ASM_MACH_MPPARSE_H + +static inline void mpc_oem_bus_info (struct mpc_config_bus *m,char *name, +struct mpc_config_translation *translation) +{ +Dprintk ("Bus #%d is %s\n" , m->mpc_busid, name); +} + +static inline void mpc_oem_pci_bus (struct mpc_config_bus *m, +struct mpc_config_translation *translation) +{ +} + +static inline void mps_oem_check (struct mp_config_table *mpc,char *oem, +char *productid) +{ +if (!strncmp (oem,"IBM ENSW" ,8 ) && !strncmp (str,"VIGIL SMP" ,9 )) + x86_summit =1 ; +} + +#endif /* __ASM_MACH_MPPARSE_H */