From: "Jan Beulich" Subject: [PATCH 04/11] x86: cleanup mpparse.c Date: Wed, 09 Mar 2011 12:26:27 +0000 Message-ID: <4D7780030200007800035816@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartC0ECF7E3.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. --=__PartC0ECF7E3.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Remove unused and pointless bits from mpparse.c (and other files where they are related to it). Of what remains, move whatever possible into .init.*, and some data items into .data.read_mostly. Signed-off-by: Jan Beulich --- 2011-03-09.orig/xen/arch/x86/acpi/boot.c +++ 2011-03-09/xen/arch/x86/acpi/boot.c @@ -177,7 +177,8 @@ acpi_parse_x2apic(struct acpi_subtable_h * when we use CPU hotplug. */ mp_register_lapic(processor->id, /* X2APIC ID */ - processor->flags.enabled); /* Enabled? */ + processor->flags.enabled, /* Enabled? */ + 0); =20 return 0; } @@ -206,7 +207,8 @@ acpi_parse_lapic(struct acpi_subtable_he * when we use CPU hotplug. */ mp_register_lapic(processor->id, /* APIC ID */ - processor->flags.enabled); /* Enabled? */ + processor->flags.enabled, /* Enabled? */ + 0); =20 return 0; } --- 2011-03-09.orig/xen/arch/x86/genapic/probe.c +++ 2011-03-09/xen/arch/x86/genapic/probe.c @@ -18,7 +18,6 @@ =20 extern const struct genapic apic_summit; extern const struct genapic apic_bigsmp; -extern const struct genapic apic_default; =20 const struct genapic *__read_mostly genapic; =20 --- 2011-03-09.orig/xen/arch/x86/io_apic.c +++ 2011-03-09/xen/arch/x86/io_apic.c @@ -2491,8 +2491,6 @@ void dump_ioapic_irq_info(void) } } =20 -unsigned highest_gsi(void); - static unsigned int __initdata max_gsi_irqs; integer_param("max_gsi_irqs", max_gsi_irqs); =20 --- 2011-03-09.orig/xen/arch/x86/mpparse.c +++ 2011-03-09/xen/arch/x86/mpparse.c @@ -21,7 +21,6 @@ #include #include =20 -#include #include #include #include @@ -34,36 +33,31 @@ #include =20 /* Have we found an MP table */ -int smp_found_config; -unsigned int __devinitdata maxcpus =3D NR_CPUS; +bool_t __initdata smp_found_config; =20 /* * Various Linux-internal data structures created from the * MP-table. */ -int apic_version [MAX_APICS]; -int mp_bus_id_to_type [MAX_MP_BUSSES]; -int mp_bus_id_to_node [MAX_MP_BUSSES]; -int mp_bus_id_to_local [MAX_MP_BUSSES]; -int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] =3D { [0 ... MAX_MP_BUSSES-1] = =3D -1 }; -static int mp_current_pci_id; +unsigned char __read_mostly apic_version[MAX_APICS]; +unsigned char __read_mostly mp_bus_id_to_type[MAX_MP_BUSSES]; =20 /* I/O APIC entries */ -struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; +struct mpc_config_ioapic __read_mostly mp_ioapics[MAX_IO_APICS]; =20 /* # of MP IRQ source entries */ -struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; +struct mpc_config_intsrc __read_mostly mp_irqs[MAX_IRQ_SOURCES]; =20 /* MP IRQ source entries */ -int mp_irq_entries; +int __read_mostly mp_irq_entries; =20 -int pic_mode; -unsigned long mp_lapic_addr; - -unsigned int def_to_bigsmp =3D 0; +bool_t __read_mostly pic_mode; +bool_t __read_mostly def_to_bigsmp =3D 0; +unsigned long __read_mostly mp_lapic_addr; =20 /* Processor that is doing the boot up */ -unsigned int boot_cpu_physical_apicid =3D -1U; +unsigned int __read_mostly boot_cpu_physical_apicid =3D BAD_APICID; + /* Internal processor count */ static unsigned int __devinitdata num_processors; =20 @@ -89,18 +83,9 @@ static int __init mpf_checksum(unsigned=20 return sum & 0xFF; } =20 -/* - * Have to match translation table entries to main table entries by = counter - * hence the mpc_record variable .... can't see a less disgusting way of - * doing this .... - */ - -static int mpc_record;=20 -static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] = __initdata; - /* Return xen's logical cpu_id of the new added cpu or <0 if error */ static int __devinit MP_processor_info_x(struct mpc_config_processor *m, - u32 apicidx) + u32 apicidx, bool_t hotplug) { int ver, apicid, cpu =3D 0; physid_mask_t phys_cpu; @@ -108,55 +93,7 @@ static int __devinit MP_processor_info_x if (!(m->mpc_cpuflag & CPU_ENABLED)) return -EINVAL; =20 - apicid =3D mpc_apic_id(m, apicidx, translation_table[mpc_record]); - - if (m->mpc_featureflag&(1<<0)) - Dprintk(" Floating point unit present.\n"); - if (m->mpc_featureflag&(1<<7)) - Dprintk(" Machine Exception supported.\n"); - if (m->mpc_featureflag&(1<<8)) - Dprintk(" 64 bit compare & exchange supported.\n"); - if (m->mpc_featureflag&(1<<9)) - Dprintk(" Internal APIC present.\n"); - if (m->mpc_featureflag&(1<<11)) - Dprintk(" SEP present.\n"); - if (m->mpc_featureflag&(1<<12)) - Dprintk(" MTRR present.\n"); - if (m->mpc_featureflag&(1<<13)) - Dprintk(" PGE present.\n"); - if (m->mpc_featureflag&(1<<14)) - Dprintk(" MCA present.\n"); - if (m->mpc_featureflag&(1<<15)) - Dprintk(" CMOV present.\n"); - if (m->mpc_featureflag&(1<<16)) - Dprintk(" PAT present.\n"); - if (m->mpc_featureflag&(1<<17)) - Dprintk(" PSE present.\n"); - if (m->mpc_featureflag&(1<<18)) - Dprintk(" PSN present.\n"); - if (m->mpc_featureflag&(1<<19)) - Dprintk(" Cache Line Flush Instruction present.\n"); - /* 20 Reserved */ - if (m->mpc_featureflag&(1<<21)) - Dprintk(" Debug Trace and EMON Store present.\n"); - if (m->mpc_featureflag&(1<<22)) - Dprintk(" ACPI Thermal Throttle Registers present.\n");= - if (m->mpc_featureflag&(1<<23)) - Dprintk(" MMX present.\n"); - if (m->mpc_featureflag&(1<<24)) - Dprintk(" FXSR present.\n"); - if (m->mpc_featureflag&(1<<25)) - Dprintk(" XMM present.\n"); - if (m->mpc_featureflag&(1<<26)) - Dprintk(" Willamette New Instructions present.\n"); - if (m->mpc_featureflag&(1<<27)) - Dprintk(" Self Snoop present.\n"); - if (m->mpc_featureflag&(1<<28)) - Dprintk(" HT present.\n"); - if (m->mpc_featureflag&(1<<29)) - Dprintk(" Thermal Monitor present.\n"); - /* 30, 31 Reserved */ - + apicid =3D mpc_apic_id(m, apicidx); =20 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { Dprintk(" Bootup CPU\n"); @@ -185,9 +122,9 @@ static int __devinit MP_processor_info_x return -ENOSPC; } =20 - if (num_processors >=3D maxcpus) { - printk(KERN_WARNING "WARNING: maxcpus limit of %i = reached." - " Processor ignored.\n", maxcpus); + if (num_processors >=3D 8 && hotplug && genapic =3D=3D &apic_defaul= t) { + printk(KERN_WARNING "WARNING: CPUs limit of 8 reached." + " Processor ignored.\n"); return -ENOSPC; } =20 @@ -216,7 +153,7 @@ static int __devinit MP_processor_info_x =20 static int __devinit MP_processor_info(struct mpc_config_processor *m) { - return MP_processor_info_x(m, m->mpc_apicid); + return MP_processor_info_x(m, m->mpc_apicid, 0); } =20 static void __init MP_bus_info (struct mpc_config_bus *m) @@ -226,8 +163,6 @@ static void __init MP_bus_info (struct m memcpy(str, m->mpc_bustype, 6); str[6] =3D 0; =20 - mpc_oem_bus_info(m, str, translation_table[mpc_record]); - #if 0 /* size of mpc_busid (8 bits) makes this check unnecessary */ if (m->mpc_busid >=3D MAX_MP_BUSSES) { printk(KERN_WARNING "MP table busid value (%d) for bustype = %s " @@ -242,10 +177,7 @@ static void __init MP_bus_info (struct m } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) = =3D=3D 0) { mp_bus_id_to_type[m->mpc_busid] =3D MP_BUS_EISA; } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI)-1) =3D=3D = 0) { - mpc_oem_pci_bus(m, translation_table[mpc_record]); mp_bus_id_to_type[m->mpc_busid] =3D MP_BUS_PCI; - mp_bus_id_to_pci_bus[m->mpc_busid] =3D mp_current_pci_id; - mp_current_pci_id++; } else if (strncmp(str, BUSTYPE_MCA, sizeof(BUSTYPE_MCA)-1) =3D=3D = 0) { mp_bus_id_to_type[m->mpc_busid] =3D MP_BUS_MCA; } else if (strncmp(str, BUSTYPE_NEC98, sizeof(BUSTYPE_NEC98)-1) = =3D=3D 0) { @@ -310,77 +242,6 @@ static void __init MP_lintsrc_info (stru BUG(); } =20 -#ifdef CONFIG_X86_NUMAQ -static void __init MP_translation_info (struct mpc_config_translation *m) -{ - printk(KERN_INFO "Translation: record %d, type %d, quad %d, global = %d, local %d\n", mpc_record, m->trans_type, m->trans_quad, m->trans_global,= m->trans_local); - - if (mpc_record >=3D MAX_MPC_ENTRY)=20 - printk(KERN_ERR "MAX_MPC_ENTRY exceeded!\n"); - else - translation_table[mpc_record] =3D m; /* stash this for = later */ - if (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad)) - node_set_online(m->trans_quad); -} - -/* - * Read/parse the MPC oem tables - */ - -static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, = \ - unsigned short oemsize) -{ - int count =3D sizeof (*oemtable); /* the header size */ - unsigned char *oemptr =3D ((unsigned char *)oemtable)+count; -=09 - mpc_record =3D 0; - printk(KERN_INFO "Found an OEM MPC table at %8p - parsing it ... = \n", oemtable); - if (memcmp(oemtable->oem_signature,MPC_OEM_SIGNATURE,4)) - { - printk(KERN_WARNING "SMP mpc oemtable: bad signature = [%c%c%c%c]!\n", - oemtable->oem_signature[0], - oemtable->oem_signature[1], - oemtable->oem_signature[2], - oemtable->oem_signature[3]); - return; - } - if (mpf_checksum((unsigned char *)oemtable,oemtable->oem_length)) - { - printk(KERN_WARNING "SMP oem mptable: checksum error!\n"); - return; - } - while (count < oemtable->oem_length) { - switch (*oemptr) { - case MP_TRANSLATION: - { - struct mpc_config_translation *m=3D - (struct mpc_config_translation = *)oemptr; - MP_translation_info(m); - oemptr +=3D sizeof(*m); - count +=3D sizeof(*m); - ++mpc_record; - break; - } - default: - { - printk(KERN_WARNING "Unrecognised OEM = table entry type! - %d\n", (int) *oemptr); - return; - } - } - } -} - -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_oem= ptr, - mpc->mpc_oemsize); -} -#endif /* CONFIG_X86_NUMAQ */ - /* * Read/parse the MPC */ @@ -432,7 +293,6 @@ static int __init smp_read_mpc(struct mp /* * Now process the configuration blocks. */ - mpc_record =3D 0; while (count < mpc->mpc_length) { switch(*mpt) { case MP_PROCESSOR: @@ -489,7 +349,6 @@ static int __init smp_read_mpc(struct mp break; } } - ++mpc_record; } clustered_apic_check(); if (!num_processors) @@ -655,7 +514,7 @@ static inline void __init construct_defa } } =20 -static struct intel_mp_floating *mpf_found; +static struct intel_mp_floating *__initdata mpf_found; =20 /* * Scan the memory blocks for an SMP configuration block. @@ -840,7 +699,8 @@ void __init mp_register_lapic_address ( =20 int __devinit mp_register_lapic ( u32 id, - u8 enabled) + bool_t enabled, + bool_t hotplug) { struct mpc_config_processor processor; int boot_cpu =3D 0; @@ -865,7 +725,7 @@ int __devinit mp_register_lapic ( processor.mpc_reserved[0] =3D 0; processor.mpc_reserved[1] =3D 0; =20 - return MP_processor_info_x(&processor, id); + return MP_processor_info_x(&processor, id, hotplug); } =20 void mp_unregister_lapic(uint32_t apic_id, uint32_t cpu) @@ -888,17 +748,16 @@ void mp_unregister_lapic(uint32_t apic_i #define MP_MAX_IOAPIC_PIN 127 =20 static struct mp_ioapic_routing { - int apic_id; - int gsi_base; - int gsi_end; - u32 pin_programmed[4]; + int gsi_base; + int gsi_end; + unsigned long pin_programmed[BITS_TO_LONGS(MP_MAX_IOAPIC_PIN + = 1)]; } mp_ioapic_routing[MAX_IO_APICS]; =20 =20 static int mp_find_ioapic ( int gsi) { - int i =3D 0; + unsigned int i; =20 /* Find the IOAPIC that manages this GSI. */ for (i =3D 0; i < nr_ioapics; i++) { @@ -955,7 +814,6 @@ void __init mp_register_ioapic ( * Build basic GSI lookup table to facilitate gsi->io_apic lookups * and to prevent reprogramming of IOAPIC pins (PCI GSIs). */ - mp_ioapic_routing[idx].apic_id =3D mp_ioapics[idx].mpc_apicid; mp_ioapic_routing[idx].gsi_base =3D gsi_base; mp_ioapic_routing[idx].gsi_end =3D gsi_base +=20 io_apic_get_redir_entries(idx); @@ -969,7 +827,7 @@ void __init mp_register_ioapic ( return; } =20 -unsigned highest_gsi(void) +unsigned __init highest_gsi(void) { unsigned x, res =3D 0; for (x =3D 0; x < nr_ioapics; x++) @@ -1096,9 +954,8 @@ void __init mp_config_acpi_legacy_irqs ( =20 int mp_register_gsi (u32 gsi, int triggering, int polarity) { - int ioapic =3D -1; - int ioapic_pin =3D 0; - int idx, bit =3D 0; + int ioapic; + int ioapic_pin; struct irq_desc * desc; unsigned long flags; =20 @@ -1135,22 +992,19 @@ int mp_register_gsi (u32 gsi, int trigge * with redundant pin->gsi mappings (but unique PCI devices); * we only program the IOAPIC on the first. */ - bit =3D ioapic_pin % 32; - idx =3D (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); - if (idx > 3) { + if (ioapic_pin > MP_MAX_IOAPIC_PIN) { printk(KERN_ERR "Invalid reference to IOAPIC pin " - "%d-%d\n", mp_ioapic_routing[ioapic].apic_id,=20 + "%d-%d\n", mp_ioapics[ioapic].mpc_apicid, ioapic_pin); return -EINVAL; } - if ((1<mpc_busid, name); -} - -static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,=20 - struct mpc_config_translation *translation)= -{ -} - int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid)= ; int acpi_madt_oem_check(char *oem_id, char *oem_table_id); =20 --- 2011-03-09.orig/xen/include/asm-x86/mpspec.h +++ 2011-03-09/xen/include/asm-x86/mpspec.h @@ -5,25 +5,22 @@ #include #include =20 -extern int mp_bus_id_to_type [MAX_MP_BUSSES]; -extern int mp_bus_id_to_node [MAX_MP_BUSSES]; -extern int mp_bus_id_to_local [MAX_MP_BUSSES]; -extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES]; +extern unsigned char mp_bus_id_to_type[MAX_MP_BUSSES]; =20 -extern unsigned int def_to_bigsmp; +extern bool_t def_to_bigsmp; extern unsigned int boot_cpu_physical_apicid; -extern int smp_found_config; +extern bool_t smp_found_config; extern void find_smp_config (void); extern void get_smp_config (void); -extern int apic_version [MAX_APICS]; +extern unsigned char apic_version [MAX_APICS]; extern int mp_irq_entries; extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES]; extern int mpc_default_type; extern unsigned long mp_lapic_addr; -extern int pic_mode; +extern bool_t pic_mode; =20 #ifdef CONFIG_ACPI -extern int mp_register_lapic (u32 id, u8 enabled); +extern int mp_register_lapic(u32 id, bool_t enabled, bool_t hotplug); extern void mp_unregister_lapic(uint32_t apic_id, uint32_t cpu); extern void mp_register_lapic_address (u64 address); extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base); --=__PartC0ECF7E3.0__= Content-Type: text/plain; name="x86-mpparse-cleanup.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-mpparse-cleanup.patch" Remove unused and pointless bits from mpparse.c (and other files where=0Ath= ey are related to it). Of what remains, move whatever possible into=0A.init= .*, and some data items into .data.read_mostly.=0A=0ASigned-off-by: Jan = Beulich =0A=0A--- 2011-03-09.orig/xen/arch/x86/acpi/bo= ot.c=0A+++ 2011-03-09/xen/arch/x86/acpi/boot.c=0A@@ -177,7 +177,8 @@ = acpi_parse_x2apic(struct acpi_subtable_h=0A * when we use CPU = hotplug.=0A */=0A mp_register_lapic(processor->id, /* X2APIC = ID */=0A- processor->flags.enabled); /* = Enabled? */=0A+ processor->flags.enabled, /* = Enabled? */=0A+ 0);=0A =0A return 0;=0A }=0A@@ -206,7 = +207,8 @@ acpi_parse_lapic(struct acpi_subtable_he=0A * when we use CPU = hotplug.=0A */=0A mp_register_lapic(processor->id, /* APIC ID = */=0A- processor->flags.enabled); /* Enabled? */=0A+ = processor->flags.enabled, /* Enabled? */=0A+ = 0);=0A =0A return 0;=0A }=0A--- 2011-03-09.orig/xen/arch/x86/g= enapic/probe.c=0A+++ 2011-03-09/xen/arch/x86/genapic/probe.c=0A@@ -18,7 = +18,6 @@=0A =0A extern const struct genapic apic_summit;=0A extern const = struct genapic apic_bigsmp;=0A-extern const struct genapic apic_default;=0A= =0A const struct genapic *__read_mostly genapic;=0A =0A--- 2011-03-09.orig= /xen/arch/x86/io_apic.c=0A+++ 2011-03-09/xen/arch/x86/io_apic.c=0A@@ = -2491,8 +2491,6 @@ void dump_ioapic_irq_info(void)=0A }=0A }=0A = =0A-unsigned highest_gsi(void);=0A-=0A static unsigned int __initdata = max_gsi_irqs;=0A integer_param("max_gsi_irqs", max_gsi_irqs);=0A =0A--- = 2011-03-09.orig/xen/arch/x86/mpparse.c=0A+++ 2011-03-09/xen/arch/x86/mppars= e.c=0A@@ -21,7 +21,6 @@=0A #include =0A #include = =0A =0A-#include =0A #include =0A = #include =0A #include =0A@@ -34,36 +33,31 @@=0A = #include =0A =0A /* Have we found an MP table */=0A-int = smp_found_config;=0A-unsigned int __devinitdata maxcpus =3D NR_CPUS;=0A+boo= l_t __initdata smp_found_config;=0A =0A /*=0A * Various Linux-internal = data structures created from the=0A * MP-table.=0A */=0A-int apic_version= [MAX_APICS];=0A-int mp_bus_id_to_type [MAX_MP_BUSSES];=0A-int mp_bus_id_to= _node [MAX_MP_BUSSES];=0A-int mp_bus_id_to_local [MAX_MP_BUSSES];=0A-int = mp_bus_id_to_pci_bus [MAX_MP_BUSSES] =3D { [0 ... MAX_MP_BUSSES-1] =3D -1 = };=0A-static int mp_current_pci_id;=0A+unsigned char __read_mostly = apic_version[MAX_APICS];=0A+unsigned char __read_mostly mp_bus_id_to_type[M= AX_MP_BUSSES];=0A =0A /* I/O APIC entries */=0A-struct mpc_config_ioapic = mp_ioapics[MAX_IO_APICS];=0A+struct mpc_config_ioapic __read_mostly = mp_ioapics[MAX_IO_APICS];=0A =0A /* # of MP IRQ source entries */=0A-struct= mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];=0A+struct mpc_config_intsrc = __read_mostly mp_irqs[MAX_IRQ_SOURCES];=0A =0A /* MP IRQ source entries = */=0A-int mp_irq_entries;=0A+int __read_mostly mp_irq_entries;=0A =0A-int = pic_mode;=0A-unsigned long mp_lapic_addr;=0A-=0A-unsigned int def_to_bigsmp= =3D 0;=0A+bool_t __read_mostly pic_mode;=0A+bool_t __read_mostly = def_to_bigsmp =3D 0;=0A+unsigned long __read_mostly mp_lapic_addr;=0A =0A = /* Processor that is doing the boot up */=0A-unsigned int boot_cpu_physical= _apicid =3D -1U;=0A+unsigned int __read_mostly boot_cpu_physical_apicid = =3D BAD_APICID;=0A+=0A /* Internal processor count */=0A static unsigned = int __devinitdata num_processors;=0A =0A@@ -89,18 +83,9 @@ static int = __init mpf_checksum(unsigned =0A return sum & 0xFF;=0A }=0A = =0A-/*=0A- * Have to match translation table entries to main table entries = by counter=0A- * hence the mpc_record variable .... can't see a less = disgusting way of=0A- * doing this ....=0A- */=0A-=0A-static int mpc_record= ; =0A-static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY= ] __initdata;=0A-=0A /* Return xen's logical cpu_id of the new added cpu = or <0 if error */=0A static int __devinit MP_processor_info_x(struct = mpc_config_processor *m,=0A- u32 = apicidx)=0A+ u32 apicidx, bool_t = hotplug)=0A {=0A int ver, apicid, cpu =3D 0;=0A physid_mask_t = phys_cpu;=0A@@ -108,55 +93,7 @@ static int __devinit MP_processor_info_x=0A= if (!(m->mpc_cpuflag & CPU_ENABLED))=0A return = -EINVAL;=0A =0A- apicid =3D mpc_apic_id(m, apicidx, translation_tabl= e[mpc_record]);=0A-=0A- if (m->mpc_featureflag&(1<<0))=0A- = Dprintk(" Floating point unit present.\n");=0A- if (m->mpc_featuref= lag&(1<<7))=0A- Dprintk(" Machine Exception supported.\n");=0A- = if (m->mpc_featureflag&(1<<8))=0A- Dprintk(" 64 bit = compare & exchange supported.\n");=0A- if (m->mpc_featureflag&(1<<9))=0A- = Dprintk(" Internal APIC present.\n");=0A- if (m->mpc_featuref= lag&(1<<11))=0A- Dprintk(" SEP present.\n");=0A- if = (m->mpc_featureflag&(1<<12))=0A- Dprintk(" MTRR = present.\n");=0A- if (m->mpc_featureflag&(1<<13))=0A- = Dprintk(" PGE present.\n");=0A- if (m->mpc_featureflag&(1<<14))=0A-= Dprintk(" MCA present.\n");=0A- if (m->mpc_featuref= lag&(1<<15))=0A- Dprintk(" CMOV present.\n");=0A- if = (m->mpc_featureflag&(1<<16))=0A- Dprintk(" PAT = present.\n");=0A- if (m->mpc_featureflag&(1<<17))=0A- = Dprintk(" PSE present.\n");=0A- if (m->mpc_featureflag&(1<<18))=0A-= Dprintk(" PSN present.\n");=0A- if (m->mpc_featuref= lag&(1<<19))=0A- Dprintk(" Cache Line Flush Instruction = present.\n");=0A- /* 20 Reserved */=0A- if (m->mpc_featureflag&(1<<= 21))=0A- Dprintk(" Debug Trace and EMON Store present.\n"= );=0A- if (m->mpc_featureflag&(1<<22))=0A- Dprintk(" ACPI = Thermal Throttle Registers present.\n");=0A- if (m->mpc_featureflag&(1<<= 23))=0A- Dprintk(" MMX present.\n");=0A- if = (m->mpc_featureflag&(1<<24))=0A- Dprintk(" FXSR = present.\n");=0A- if (m->mpc_featureflag&(1<<25))=0A- = Dprintk(" XMM present.\n");=0A- if (m->mpc_featureflag&(1<<26))=0A-= Dprintk(" Willamette New Instructions present.\n");=0A-= if (m->mpc_featureflag&(1<<27))=0A- Dprintk(" Self = Snoop present.\n");=0A- if (m->mpc_featureflag&(1<<28))=0A- = Dprintk(" HT present.\n");=0A- if (m->mpc_featureflag&(1<<29))=0A-= Dprintk(" Thermal Monitor present.\n");=0A- /* 30, 31 = Reserved */=0A-=0A+ apicid =3D mpc_apic_id(m, apicidx);=0A =0A if = (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {=0A Dprintk(" = Bootup CPU\n");=0A@@ -185,9 +122,9 @@ static int __devinit MP_processor_inf= o_x=0A return -ENOSPC;=0A }=0A =0A- if (num_processors = >=3D maxcpus) {=0A- printk(KERN_WARNING "WARNING: maxcpus = limit of %i reached."=0A- " Processor ignored.\n", = maxcpus);=0A+ if (num_processors >=3D 8 && hotplug && genapic =3D=3D = &apic_default) {=0A+ printk(KERN_WARNING "WARNING: CPUs limit = of 8 reached."=0A+ " Processor ignored.\n");=0A = return -ENOSPC;=0A }=0A =0A@@ -216,7 +153,7 @@ static int __devinit = MP_processor_info_x=0A =0A static int __devinit MP_processor_info(struct = mpc_config_processor *m)=0A {=0A- return MP_processor_info_x(m, = m->mpc_apicid);=0A+ return MP_processor_info_x(m, m->mpc_apicid, = 0);=0A }=0A =0A static void __init MP_bus_info (struct mpc_config_bus = *m)=0A@@ -226,8 +163,6 @@ static void __init MP_bus_info (struct m=0A = memcpy(str, m->mpc_bustype, 6);=0A str[6] =3D 0;=0A =0A- mpc_oem_bus= _info(m, str, translation_table[mpc_record]);=0A-=0A #if 0 /* size of = mpc_busid (8 bits) makes this check unnecessary */=0A if (m->mpc_busid = >=3D MAX_MP_BUSSES) {=0A printk(KERN_WARNING "MP table = busid value (%d) for bustype %s "=0A@@ -242,10 +177,7 @@ static void = __init MP_bus_info (struct m=0A } else if (strncmp(str, BUSTYPE_EIS= A, sizeof(BUSTYPE_EISA)-1) =3D=3D 0) {=0A mp_bus_id_to_type[m= ->mpc_busid] =3D MP_BUS_EISA;=0A } else if (strncmp(str, BUSTYPE_PCI= , sizeof(BUSTYPE_PCI)-1) =3D=3D 0) {=0A- mpc_oem_pci_bus(m, = translation_table[mpc_record]);=0A mp_bus_id_to_type[m->mpc_bu= sid] =3D MP_BUS_PCI;=0A- mp_bus_id_to_pci_bus[m->mpc_busid] = =3D mp_current_pci_id;=0A- mp_current_pci_id++;=0A } = else if (strncmp(str, BUSTYPE_MCA, sizeof(BUSTYPE_MCA)-1) =3D=3D 0) {=0A = mp_bus_id_to_type[m->mpc_busid] =3D MP_BUS_MCA;=0A } else if = (strncmp(str, BUSTYPE_NEC98, sizeof(BUSTYPE_NEC98)-1) =3D=3D 0) {=0A@@ = -310,77 +242,6 @@ static void __init MP_lintsrc_info (stru=0A = BUG();=0A }=0A =0A-#ifdef CONFIG_X86_NUMAQ=0A-static void __init MP_transla= tion_info (struct mpc_config_translation *m)=0A-{=0A- printk(KERN_INFO = "Translation: record %d, type %d, quad %d, global %d, local %d\n", = mpc_record, m->trans_type, m->trans_quad, m->trans_global, m->trans_local);= =0A-=0A- if (mpc_record >=3D MAX_MPC_ENTRY) =0A- printk(KERN= _ERR "MAX_MPC_ENTRY exceeded!\n");=0A- else=0A- translation= _table[mpc_record] =3D m; /* stash this for later */=0A- if = (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad))=0A- = node_set_online(m->trans_quad);=0A-}=0A-=0A-/*=0A- * Read/parse the MPC = oem tables=0A- */=0A-=0A-static void __init smp_read_mpc_oem(struct = mp_config_oemtable *oemtable, \=0A- unsigned short oemsize)=0A-{=0A- = int count =3D sizeof (*oemtable); /* the header size */=0A- unsigned = char *oemptr =3D ((unsigned char *)oemtable)+count;=0A- =0A- mpc_record = =3D 0;=0A- printk(KERN_INFO "Found an OEM MPC table at %8p - parsing = it ... \n", oemtable);=0A- if (memcmp(oemtable->oem_signature,MPC_OEM_= SIGNATURE,4))=0A- {=0A- printk(KERN_WARNING "SMP mpc = oemtable: bad signature [%c%c%c%c]!\n",=0A- oemtable->o= em_signature[0],=0A- oemtable->oem_signature[1],=0A- = oemtable->oem_signature[2],=0A- oemtable->oem_signa= ture[3]);=0A- return;=0A- }=0A- if (mpf_checksum((unsigned = char *)oemtable,oemtable->oem_length))=0A- {=0A- printk(KERN= _WARNING "SMP oem mptable: checksum error!\n");=0A- return;=0A-= }=0A- while (count < oemtable->oem_length) {=0A- = switch (*oemptr) {=0A- case MP_TRANSLATION:=0A- = {=0A- struct mpc_config_translation = *m=3D=0A- (struct mpc_config_translat= ion *)oemptr;=0A- MP_translation_info(m);=0A-= oemptr +=3D sizeof(*m);=0A- = count +=3D sizeof(*m);=0A- ++mpc_recor= d;=0A- break;=0A- }=0A- = default:=0A- {=0A- = printk(KERN_WARNING "Unrecognised OEM table entry type! - %d\n", (int) = *oemptr);=0A- return;=0A- = }=0A- }=0A- }=0A-}=0A-=0A-static inline void mps_oem_check(stru= ct mp_config_table *mpc, char *oem,=0A- char *productid)=0A-{=0A- = if (strncmp(oem, "IBM NUMA", 8))=0A- printk("Warning! May not = be a NUMA-Q system!\n");=0A- if (mpc->mpc_oemptr)=0A- = smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr,=0A- = mpc->mpc_oemsize);=0A-}=0A-#endif /* CONFIG_X86_NUMAQ= */=0A-=0A /*=0A * Read/parse the MPC=0A */=0A@@ -432,7 +293,6 @@ static = int __init smp_read_mpc(struct mp=0A /*=0A * Now process the = configuration blocks.=0A */=0A- mpc_record =3D 0;=0A while = (count < mpc->mpc_length) {=0A switch(*mpt) {=0A = case MP_PROCESSOR:=0A@@ -489,7 +349,6 @@ static int __init smp_read_mpc(str= uct mp=0A break;=0A = }=0A }=0A- ++mpc_record;=0A }=0A clustered_a= pic_check();=0A if (!num_processors)=0A@@ -655,7 +514,7 @@ static = inline void __init construct_defa=0A }=0A }=0A =0A-static struct = intel_mp_floating *mpf_found;=0A+static struct intel_mp_floating *__initdat= a mpf_found;=0A =0A /*=0A * Scan the memory blocks for an SMP configuratio= n block.=0A@@ -840,7 +699,8 @@ void __init mp_register_lapic_address (=0A = =0A int __devinit mp_register_lapic (=0A u32 = id,=0A- u8 enabled)=0A+ bool_t = enabled,=0A+ bool_t hotplug)=0A {=0A struct = mpc_config_processor processor;=0A int boot_cpu = =3D 0;=0A@@ -865,7 +725,7 @@ int __devinit mp_register_lapic (=0A = processor.mpc_reserved[0] =3D 0;=0A processor.mpc_reserved[1] =3D = 0;=0A =0A- return MP_processor_info_x(&processor, id);=0A+ return = MP_processor_info_x(&processor, id, hotplug);=0A }=0A =0A void mp_unregiste= r_lapic(uint32_t apic_id, uint32_t cpu)=0A@@ -888,17 +748,16 @@ void = mp_unregister_lapic(uint32_t apic_i=0A #define MP_MAX_IOAPIC_PIN = 127=0A =0A static struct mp_ioapic_routing {=0A- int = apic_id;=0A- int gsi_base;=0A- int = gsi_end;=0A- u32 pin_programmed[4];=0A+ int = gsi_base;=0A+ int gsi_end;=0A+ unsigned long pin_program= med[BITS_TO_LONGS(MP_MAX_IOAPIC_PIN + 1)];=0A } mp_ioapic_routing[MAX_IO_AP= ICS];=0A =0A =0A static int mp_find_ioapic (=0A int = gsi)=0A {=0A- int i =3D 0;=0A+ unsigned int = i;=0A =0A /* Find the IOAPIC that manages this GSI. */=0A = for (i =3D 0; i < nr_ioapics; i++) {=0A@@ -955,7 +814,6 @@ void __init = mp_register_ioapic (=0A * Build basic GSI lookup table to = facilitate gsi->io_apic lookups=0A * and to prevent reprogramming of = IOAPIC pins (PCI GSIs).=0A */=0A- mp_ioapic_routing[idx].apic_id =3D = mp_ioapics[idx].mpc_apicid;=0A mp_ioapic_routing[idx].gsi_base =3D = gsi_base;=0A mp_ioapic_routing[idx].gsi_end =3D gsi_base + =0A = io_apic_get_redir_entries(idx);=0A@@ -969,7 +827,7 @@ void __init = mp_register_ioapic (=0A return;=0A }=0A =0A-unsigned highest_gsi(vo= id)=0A+unsigned __init highest_gsi(void)=0A {=0A unsigned x, res = =3D 0;=0A for (x =3D 0; x < nr_ioapics; x++)=0A@@ -1096,9 +954,8 @@ = void __init mp_config_acpi_legacy_irqs (=0A =0A int mp_register_gsi (u32 = gsi, int triggering, int polarity)=0A {=0A- int = ioapic =3D -1;=0A- int ioapic_pin =3D 0;=0A- = int idx, bit =3D 0;=0A+ int = ioapic;=0A+ int ioapic_pin;=0A struct irq_desc * = desc;=0A unsigned long flags;=0A =0A@@ -1135,22 +992,19 = @@ int mp_register_gsi (u32 gsi, int trigge=0A * with redundant pin->gsi = mappings (but unique PCI devices);=0A * we only program the IOAPIC on = the first.=0A */=0A- bit =3D ioapic_pin % 32;=0A- idx =3D (ioapic_pin= < 32) ? 0 : (ioapic_pin / 32);=0A- if (idx > 3) {=0A+ if = (ioapic_pin > MP_MAX_IOAPIC_PIN) {=0A printk(KERN_ERR "Invalid = reference to IOAPIC pin "=0A- "%d-%d\n", mp_ioapic_routin= g[ioapic].apic_id, =0A+ "%d-%d\n", mp_ioapics[ioapic].mpc_a= picid,=0A ioapic_pin);=0A return = -EINVAL;=0A }=0A- if ((1<mpc_busid, name);=0A-= }=0A-=0A-static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, =0A- = struct mpc_config_translation *translation)=0A-{=0A= -}=0A-=0A int mps_oem_check(struct mp_config_table *mpc, char *oem, char = *productid);=0A int acpi_madt_oem_check(char *oem_id, char *oem_table_id);= =0A =0A--- 2011-03-09.orig/xen/include/asm-x86/mpspec.h=0A+++ 2011-03-09/xe= n/include/asm-x86/mpspec.h=0A@@ -5,25 +5,22 @@=0A #include =0A #include =0A =0A-extern int mp_bus_id_to_type = [MAX_MP_BUSSES];=0A-extern int mp_bus_id_to_node [MAX_MP_BUSSES];=0A-extern= int mp_bus_id_to_local [MAX_MP_BUSSES];=0A-extern int mp_bus_id_to_pci_bus= [MAX_MP_BUSSES];=0A+extern unsigned char mp_bus_id_to_type[MAX_MP_BUSSES];= =0A =0A-extern unsigned int def_to_bigsmp;=0A+extern bool_t def_to_bigsmp;= =0A extern unsigned int boot_cpu_physical_apicid;=0A-extern int smp_found_c= onfig;=0A+extern bool_t smp_found_config;=0A extern void find_smp_config = (void);=0A extern void get_smp_config (void);=0A-extern int apic_version = [MAX_APICS];=0A+extern unsigned char apic_version [MAX_APICS];=0A extern = int mp_irq_entries;=0A extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOU= RCES];=0A extern int mpc_default_type;=0A extern unsigned long mp_lapic_add= r;=0A-extern int pic_mode;=0A+extern bool_t pic_mode;=0A =0A #ifdef = CONFIG_ACPI=0A-extern int mp_register_lapic (u32 id, u8 enabled);=0A+extern= int mp_register_lapic(u32 id, bool_t enabled, bool_t hotplug);=0A extern = void mp_unregister_lapic(uint32_t apic_id, uint32_t cpu);=0A extern void = mp_register_lapic_address (u64 address);=0A extern void mp_register_ioapic = (u8 id, u32 address, u32 gsi_base);=0A --=__PartC0ECF7E3.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 --=__PartC0ECF7E3.0__=--