Merge commit 'v2.6.29-rc4' into x86/cleanups
authorIngo Molnar <mingo@elte.hu>
Wed, 11 Feb 2009 10:38:55 +0000 (11:38 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 11 Feb 2009 10:38:55 +0000 (11:38 +0100)
1  2 
arch/x86/include/asm/io.h
arch/x86/kernel/io_apic.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/setup_percpu.c
arch/x86/mach-voyager/setup.c
arch/x86/mm/init_32.c

@@@ -99,13 -99,11 +99,12 @@@ extern void __iomem *ioremap_wc(unsigne
   * A boot-time mapping is currently limited to at most 16 pages.
   */
  extern void early_ioremap_init(void);
- extern void early_ioremap_clear(void);
  extern void early_ioremap_reset(void);
  extern void __iomem *early_ioremap(unsigned long offset, unsigned long size);
  extern void __iomem *early_memremap(unsigned long offset, unsigned long size);
  extern void early_iounmap(void __iomem *addr, unsigned long size);
  extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
  
 +#define IO_SPACE_LIMIT 0xffff
  
  #endif /* _ASM_X86_IO_H */
@@@ -46,7 -46,6 +46,7 @@@
  #include <asm/idle.h>
  #include <asm/io.h>
  #include <asm/smp.h>
 +#include <asm/cpu.h>
  #include <asm/desc.h>
  #include <asm/proto.h>
  #include <asm/acpi.h>
@@@ -83,11 -82,11 +83,11 @@@ static DEFINE_SPINLOCK(vector_lock)
  int nr_ioapic_registers[MAX_IO_APICS];
  
  /* I/O APIC entries */
 -struct mp_config_ioapic mp_ioapics[MAX_IO_APICS];
 +struct mpc_ioapic mp_ioapics[MAX_IO_APICS];
  int nr_ioapics;
  
  /* MP IRQ source entries */
 -struct mp_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
 +struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES];
  
  /* # of MP IRQ source entries */
  int mp_irq_entries;
@@@ -387,7 -386,7 +387,7 @@@ struct io_apic 
  static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
  {
        return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx)
 -              + (mp_ioapics[idx].mp_apicaddr & ~PAGE_MASK);
 +              + (mp_ioapics[idx].apicaddr & ~PAGE_MASK);
  }
  
  static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
@@@ -945,10 -944,10 +945,10 @@@ static int find_irq_entry(int apic, in
        int i;
  
        for (i = 0; i < mp_irq_entries; i++)
 -              if (mp_irqs[i].mp_irqtype == type &&
 -                  (mp_irqs[i].mp_dstapic == mp_ioapics[apic].mp_apicid ||
 -                   mp_irqs[i].mp_dstapic == MP_APIC_ALL) &&
 -                  mp_irqs[i].mp_dstirq == pin)
 +              if (mp_irqs[i].irqtype == type &&
 +                  (mp_irqs[i].dstapic == mp_ioapics[apic].apicid ||
 +                   mp_irqs[i].dstapic == MP_APIC_ALL) &&
 +                  mp_irqs[i].dstirq == pin)
                        return i;
  
        return -1;
@@@ -962,13 -961,13 +962,13 @@@ static int __init find_isa_irq_pin(int 
        int i;
  
        for (i = 0; i < mp_irq_entries; i++) {
 -              int lbus = mp_irqs[i].mp_srcbus;
 +              int lbus = mp_irqs[i].srcbus;
  
                if (test_bit(lbus, mp_bus_not_pci) &&
 -                  (mp_irqs[i].mp_irqtype == type) &&
 -                  (mp_irqs[i].mp_srcbusirq == irq))
 +                  (mp_irqs[i].irqtype == type) &&
 +                  (mp_irqs[i].srcbusirq == irq))
  
 -                      return mp_irqs[i].mp_dstirq;
 +                      return mp_irqs[i].dstirq;
        }
        return -1;
  }
@@@ -978,17 -977,17 +978,17 @@@ static int __init find_isa_irq_apic(in
        int i;
  
        for (i = 0; i < mp_irq_entries; i++) {
 -              int lbus = mp_irqs[i].mp_srcbus;
 +              int lbus = mp_irqs[i].srcbus;
  
                if (test_bit(lbus, mp_bus_not_pci) &&
 -                  (mp_irqs[i].mp_irqtype == type) &&
 -                  (mp_irqs[i].mp_srcbusirq == irq))
 +                  (mp_irqs[i].irqtype == type) &&
 +                  (mp_irqs[i].srcbusirq == irq))
                        break;
        }
        if (i < mp_irq_entries) {
                int apic;
                for(apic = 0; apic < nr_ioapics; apic++) {
 -                      if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic)
 +                      if (mp_ioapics[apic].apicid == mp_irqs[i].dstapic)
                                return apic;
                }
        }
@@@ -1013,23 -1012,23 +1013,23 @@@ int IO_APIC_get_PCI_irq_vector(int bus
                return -1;
        }
        for (i = 0; i < mp_irq_entries; i++) {
 -              int lbus = mp_irqs[i].mp_srcbus;
 +              int lbus = mp_irqs[i].srcbus;
  
                for (apic = 0; apic < nr_ioapics; apic++)
 -                      if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic ||
 -                          mp_irqs[i].mp_dstapic == MP_APIC_ALL)
 +                      if (mp_ioapics[apic].apicid == mp_irqs[i].dstapic ||
 +                          mp_irqs[i].dstapic == MP_APIC_ALL)
                                break;
  
                if (!test_bit(lbus, mp_bus_not_pci) &&
 -                  !mp_irqs[i].mp_irqtype &&
 +                  !mp_irqs[i].irqtype &&
                    (bus == lbus) &&
 -                  (slot == ((mp_irqs[i].mp_srcbusirq >> 2) & 0x1f))) {
 -                      int irq = pin_2_irq(i,apic,mp_irqs[i].mp_dstirq);
 +                  (slot == ((mp_irqs[i].srcbusirq >> 2) & 0x1f))) {
 +                      int irq = pin_2_irq(i, apic, mp_irqs[i].dstirq);
  
                        if (!(apic || IO_APIC_IRQ(irq)))
                                continue;
  
 -                      if (pin == (mp_irqs[i].mp_srcbusirq & 3))
 +                      if (pin == (mp_irqs[i].srcbusirq & 3))
                                return irq;
                        /*
                         * Use the first all-but-pin matching entry as a
@@@ -1072,7 -1071,7 +1072,7 @@@ static int EISA_ELCR(unsigned int irq
   * EISA conforming in the MP table, that means its trigger type must
   * be read in from the ELCR */
  
 -#define default_EISA_trigger(idx)     (EISA_ELCR(mp_irqs[idx].mp_srcbusirq))
 +#define default_EISA_trigger(idx)     (EISA_ELCR(mp_irqs[idx].srcbusirq))
  #define default_EISA_polarity(idx)    default_ISA_polarity(idx)
  
  /* PCI interrupts are always polarity one level triggered,
  
  static int MPBIOS_polarity(int idx)
  {
 -      int bus = mp_irqs[idx].mp_srcbus;
 +      int bus = mp_irqs[idx].srcbus;
        int polarity;
  
        /*
         * Determine IRQ line polarity (high active or low active):
         */
 -      switch (mp_irqs[idx].mp_irqflag & 3)
 +      switch (mp_irqs[idx].irqflag & 3)
        {
                case 0: /* conforms, ie. bus-type dependent polarity */
                        if (test_bit(bus, mp_bus_not_pci))
  
  static int MPBIOS_trigger(int idx)
  {
 -      int bus = mp_irqs[idx].mp_srcbus;
 +      int bus = mp_irqs[idx].srcbus;
        int trigger;
  
        /*
         * Determine IRQ trigger mode (edge or level sensitive):
         */
 -      switch ((mp_irqs[idx].mp_irqflag>>2) & 3)
 +      switch ((mp_irqs[idx].irqflag>>2) & 3)
        {
                case 0: /* conforms, ie. bus-type dependent */
                        if (test_bit(bus, mp_bus_not_pci))
@@@ -1215,16 -1214,16 +1215,16 @@@ int (*ioapic_renumber_irq)(int ioapic, 
  static int pin_2_irq(int idx, int apic, int pin)
  {
        int irq, i;
 -      int bus = mp_irqs[idx].mp_srcbus;
 +      int bus = mp_irqs[idx].srcbus;
  
        /*
         * Debugging check, we are in big trouble if this message pops up!
         */
 -      if (mp_irqs[idx].mp_dstirq != pin)
 +      if (mp_irqs[idx].dstirq != pin)
                printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n");
  
        if (test_bit(bus, mp_bus_not_pci)) {
 -              irq = mp_irqs[idx].mp_srcbusirq;
 +              irq = mp_irqs[idx].srcbusirq;
        } else {
                /*
                 * PCI IRQs are mapped in order
@@@ -1567,14 -1566,14 +1567,14 @@@ static void setup_IO_APIC_irq(int apic
        apic_printk(APIC_VERBOSE,KERN_DEBUG
                    "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
                    "IRQ %d Mode:%i Active:%i)\n",
 -                  apic, mp_ioapics[apic].mp_apicid, pin, cfg->vector,
 +                  apic, mp_ioapics[apic].apicid, pin, cfg->vector,
                    irq, trigger, polarity);
  
  
 -      if (setup_ioapic_entry(mp_ioapics[apic].mp_apicid, irq, &entry,
 +      if (setup_ioapic_entry(mp_ioapics[apic].apicid, irq, &entry,
                               dest, trigger, polarity, cfg->vector)) {
                printk("Failed to setup ioapic entry for ioapic  %d, pin %d\n",
 -                     mp_ioapics[apic].mp_apicid, pin);
 +                     mp_ioapics[apic].apicid, pin);
                __clear_irq_vector(irq, cfg);
                return;
        }
@@@ -1605,10 -1604,12 +1605,10 @@@ static void __init setup_IO_APIC_irqs(v
                                        notcon = 1;
                                        apic_printk(APIC_VERBOSE,
                                                KERN_DEBUG " %d-%d",
 -                                              mp_ioapics[apic].mp_apicid,
 -                                              pin);
 +                                              mp_ioapics[apic].apicid, pin);
                                } else
                                        apic_printk(APIC_VERBOSE, " %d-%d",
 -                                              mp_ioapics[apic].mp_apicid,
 -                                              pin);
 +                                              mp_ioapics[apic].apicid, pin);
                                continue;
                        }
                        if (notcon) {
@@@ -1698,7 -1699,7 +1698,7 @@@ __apicdebuginit(void) print_IO_APIC(voi
        printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
        for (i = 0; i < nr_ioapics; i++)
                printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
 -                     mp_ioapics[i].mp_apicid, nr_ioapic_registers[i]);
 +                     mp_ioapics[i].apicid, nr_ioapic_registers[i]);
  
        /*
         * We are a bit conservative about what we expect.  We have to
        spin_unlock_irqrestore(&ioapic_lock, flags);
  
        printk("\n");
 -      printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mp_apicid);
 +      printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].apicid);
        printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw);
        printk(KERN_DEBUG ".......    : physical APIC id: %02X\n", reg_00.bits.ID);
        printk(KERN_DEBUG ".......    : Delivery Type: %X\n", reg_00.bits.delivery_type);
@@@ -2120,14 -2121,14 +2120,14 @@@ static void __init setup_ioapic_ids_fro
                reg_00.raw = io_apic_read(apic, 0);
                spin_unlock_irqrestore(&ioapic_lock, flags);
  
 -              old_id = mp_ioapics[apic].mp_apicid;
 +              old_id = mp_ioapics[apic].apicid;
  
 -              if (mp_ioapics[apic].mp_apicid >= get_physical_broadcast()) {
 +              if (mp_ioapics[apic].apicid >= get_physical_broadcast()) {
                        printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
 -                              apic, mp_ioapics[apic].mp_apicid);
 +                              apic, mp_ioapics[apic].apicid);
                        printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
                                reg_00.bits.ID);
 -                      mp_ioapics[apic].mp_apicid = reg_00.bits.ID;
 +                      mp_ioapics[apic].apicid = reg_00.bits.ID;
                }
  
                /*
                 * 'stuck on smp_invalidate_needed IPI wait' messages.
                 */
                if (check_apicid_used(phys_id_present_map,
 -                                      mp_ioapics[apic].mp_apicid)) {
 +                                      mp_ioapics[apic].apicid)) {
                        printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
 -                              apic, mp_ioapics[apic].mp_apicid);
 +                              apic, mp_ioapics[apic].apicid);
                        for (i = 0; i < get_physical_broadcast(); i++)
                                if (!physid_isset(i, phys_id_present_map))
                                        break;
                        printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
                                i);
                        physid_set(i, phys_id_present_map);
 -                      mp_ioapics[apic].mp_apicid = i;
 +                      mp_ioapics[apic].apicid = i;
                } else {
                        physid_mask_t tmp;
 -                      tmp = apicid_to_cpu_present(mp_ioapics[apic].mp_apicid);
 +                      tmp = apicid_to_cpu_present(mp_ioapics[apic].apicid);
                        apic_printk(APIC_VERBOSE, "Setting %d in the "
                                        "phys_id_present_map\n",
 -                                      mp_ioapics[apic].mp_apicid);
 +                                      mp_ioapics[apic].apicid);
                        physids_or(phys_id_present_map, phys_id_present_map, tmp);
                }
  
                 * We need to adjust the IRQ routing table
                 * if the ID changed.
                 */
 -              if (old_id != mp_ioapics[apic].mp_apicid)
 +              if (old_id != mp_ioapics[apic].apicid)
                        for (i = 0; i < mp_irq_entries; i++)
 -                              if (mp_irqs[i].mp_dstapic == old_id)
 -                                      mp_irqs[i].mp_dstapic
 -                                              = mp_ioapics[apic].mp_apicid;
 +                              if (mp_irqs[i].dstapic == old_id)
 +                                      mp_irqs[i].dstapic
 +                                              = mp_ioapics[apic].apicid;
  
                /*
                 * Read the right value from the MPC table and
                 */
                apic_printk(APIC_VERBOSE, KERN_INFO
                        "...changing IO-APIC physical APIC ID to %d ...",
 -                      mp_ioapics[apic].mp_apicid);
 +                      mp_ioapics[apic].apicid);
  
 -              reg_00.bits.ID = mp_ioapics[apic].mp_apicid;
 +              reg_00.bits.ID = mp_ioapics[apic].apicid;
                spin_lock_irqsave(&ioapic_lock, flags);
                io_apic_write(apic, 0, reg_00.raw);
                spin_unlock_irqrestore(&ioapic_lock, flags);
                spin_lock_irqsave(&ioapic_lock, flags);
                reg_00.raw = io_apic_read(apic, 0);
                spin_unlock_irqrestore(&ioapic_lock, flags);
 -              if (reg_00.bits.ID != mp_ioapics[apic].mp_apicid)
 +              if (reg_00.bits.ID != mp_ioapics[apic].apicid)
                        printk("could not set ID!\n");
                else
                        apic_printk(APIC_VERBOSE, " ok.\n");
@@@ -2527,14 -2528,15 +2527,15 @@@ static void irq_complete_move(struct ir
  
        vector = ~get_irq_regs()->orig_ax;
        me = smp_processor_id();
+       if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) {
  #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
                *descp = desc = move_irq_desc(desc, me);
                /* get the new one */
                cfg = desc->chip_data;
  #endif
-       if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
                send_cleanup_vector(cfg);
+       }
  }
  #else
  static inline void irq_complete_move(struct irq_desc **descp) {}
@@@ -3116,8 -3118,8 +3117,8 @@@ static int ioapic_resume(struct sys_dev
  
        spin_lock_irqsave(&ioapic_lock, flags);
        reg_00.raw = io_apic_read(dev->id, 0);
 -      if (reg_00.bits.ID != mp_ioapics[dev->id].mp_apicid) {
 -              reg_00.bits.ID = mp_ioapics[dev->id].mp_apicid;
 +      if (reg_00.bits.ID != mp_ioapics[dev->id].apicid) {
 +              reg_00.bits.ID = mp_ioapics[dev->id].apicid;
                io_apic_write(dev->id, 0, reg_00.raw);
        }
        spin_unlock_irqrestore(&ioapic_lock, flags);
@@@ -3462,6 -3464,40 +3463,6 @@@ static int setup_msi_irq(struct pci_de
        return 0;
  }
  
 -int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc)
 -{
 -      unsigned int irq;
 -      int ret;
 -      unsigned int irq_want;
 -
 -      irq_want = nr_irqs_gsi;
 -      irq = create_irq_nr(irq_want);
 -      if (irq == 0)
 -              return -1;
 -
 -#ifdef CONFIG_INTR_REMAP
 -      if (!intr_remapping_enabled)
 -              goto no_ir;
 -
 -      ret = msi_alloc_irte(dev, irq, 1);
 -      if (ret < 0)
 -              goto error;
 -no_ir:
 -#endif
 -      ret = setup_msi_irq(dev, msidesc, irq);
 -      if (ret < 0) {
 -              destroy_irq(irq);
 -              return ret;
 -      }
 -      return 0;
 -
 -#ifdef CONFIG_INTR_REMAP
 -error:
 -      destroy_irq(irq);
 -      return ret;
 -#endif
 -}
 -
  int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
  {
        unsigned int irq;
@@@ -3949,8 -3985,8 +3950,8 @@@ int acpi_get_override_irq(int bus_irq, 
                return -1;
  
        for (i = 0; i < mp_irq_entries; i++)
 -              if (mp_irqs[i].mp_irqtype == mp_INT &&
 -                  mp_irqs[i].mp_srcbusirq == bus_irq)
 +              if (mp_irqs[i].irqtype == mp_INT &&
 +                  mp_irqs[i].srcbusirq == bus_irq)
                        break;
        if (i >= mp_irq_entries)
                return -1;
@@@ -4065,7 -4101,7 +4066,7 @@@ void __init ioapic_init_mappings(void
        ioapic_res = ioapic_setup_resources();
        for (i = 0; i < nr_ioapics; i++) {
                if (smp_found_config) {
 -                      ioapic_phys = mp_ioapics[i].mp_apicaddr;
 +                      ioapic_phys = mp_ioapics[i].apicaddr;
  #ifdef CONFIG_X86_32
                        if (!ioapic_phys) {
                                printk(KERN_ERR
@@@ -27,6 -27,7 +27,7 @@@
  #include <asm/e820.h>
  #include <asm/trampoline.h>
  #include <asm/setup.h>
+ #include <asm/smp.h>
  
  #include <mach_apic.h>
  #ifdef CONFIG_X86_32
@@@ -143,11 -144,11 +144,11 @@@ static void __init MP_ioapic_info(struc
        if (bad_ioapic(m->apicaddr))
                return;
  
 -      mp_ioapics[nr_ioapics].mp_apicaddr = m->apicaddr;
 -      mp_ioapics[nr_ioapics].mp_apicid = m->apicid;
 -      mp_ioapics[nr_ioapics].mp_type = m->type;
 -      mp_ioapics[nr_ioapics].mp_apicver = m->apicver;
 -      mp_ioapics[nr_ioapics].mp_flags = m->flags;
 +      mp_ioapics[nr_ioapics].apicaddr = m->apicaddr;
 +      mp_ioapics[nr_ioapics].apicid = m->apicid;
 +      mp_ioapics[nr_ioapics].type = m->type;
 +      mp_ioapics[nr_ioapics].apicver = m->apicver;
 +      mp_ioapics[nr_ioapics].flags = m->flags;
        nr_ioapics++;
  }
  
@@@ -159,55 -160,55 +160,55 @@@ static void print_MP_intsrc_info(struc
                m->srcbusirq, m->dstapic, m->dstirq);
  }
  
 -static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
 +static void __init print_mp_irq_info(struct mpc_intsrc *mp_irq)
  {
        apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
                " IRQ %02x, APIC ID %x, APIC INT %02x\n",
 -              mp_irq->mp_irqtype, mp_irq->mp_irqflag & 3,
 -              (mp_irq->mp_irqflag >> 2) & 3, mp_irq->mp_srcbus,
 -              mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq);
 +              mp_irq->irqtype, mp_irq->irqflag & 3,
 +              (mp_irq->irqflag >> 2) & 3, mp_irq->srcbus,
 +              mp_irq->srcbusirq, mp_irq->dstapic, mp_irq->dstirq);
  }
  
  static void __init assign_to_mp_irq(struct mpc_intsrc *m,
 -                                  struct mp_config_intsrc *mp_irq)
 +                                  struct mpc_intsrc *mp_irq)
  {
 -      mp_irq->mp_dstapic = m->dstapic;
 -      mp_irq->mp_type = m->type;
 -      mp_irq->mp_irqtype = m->irqtype;
 -      mp_irq->mp_irqflag = m->irqflag;
 -      mp_irq->mp_srcbus = m->srcbus;
 -      mp_irq->mp_srcbusirq = m->srcbusirq;
 -      mp_irq->mp_dstirq = m->dstirq;
 +      mp_irq->dstapic = m->dstapic;
 +      mp_irq->type = m->type;
 +      mp_irq->irqtype = m->irqtype;
 +      mp_irq->irqflag = m->irqflag;
 +      mp_irq->srcbus = m->srcbus;
 +      mp_irq->srcbusirq = m->srcbusirq;
 +      mp_irq->dstirq = m->dstirq;
  }
  
 -static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq,
 +static void __init assign_to_mpc_intsrc(struct mpc_intsrc *mp_irq,
                                        struct mpc_intsrc *m)
  {
 -      m->dstapic = mp_irq->mp_dstapic;
 -      m->type = mp_irq->mp_type;
 -      m->irqtype = mp_irq->mp_irqtype;
 -      m->irqflag = mp_irq->mp_irqflag;
 -      m->srcbus = mp_irq->mp_srcbus;
 -      m->srcbusirq = mp_irq->mp_srcbusirq;
 -      m->dstirq = mp_irq->mp_dstirq;
 +      m->dstapic = mp_irq->dstapic;
 +      m->type = mp_irq->type;
 +      m->irqtype = mp_irq->irqtype;
 +      m->irqflag = mp_irq->irqflag;
 +      m->srcbus = mp_irq->srcbus;
 +      m->srcbusirq = mp_irq->srcbusirq;
 +      m->dstirq = mp_irq->dstirq;
  }
  
 -static int __init mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq,
 +static int __init mp_irq_mpc_intsrc_cmp(struct mpc_intsrc *mp_irq,
                                        struct mpc_intsrc *m)
  {
 -      if (mp_irq->mp_dstapic != m->dstapic)
 +      if (mp_irq->dstapic != m->dstapic)
                return 1;
 -      if (mp_irq->mp_type != m->type)
 +      if (mp_irq->type != m->type)
                return 2;
 -      if (mp_irq->mp_irqtype != m->irqtype)
 +      if (mp_irq->irqtype != m->irqtype)
                return 3;
 -      if (mp_irq->mp_irqflag != m->irqflag)
 +      if (mp_irq->irqflag != m->irqflag)
                return 4;
 -      if (mp_irq->mp_srcbus != m->srcbus)
 +      if (mp_irq->srcbus != m->srcbus)
                return 5;
 -      if (mp_irq->mp_srcbusirq != m->srcbusirq)
 +      if (mp_irq->srcbusirq != m->srcbusirq)
                return 6;
 -      if (mp_irq->mp_dstirq != m->dstirq)
 +      if (mp_irq->dstirq != m->dstirq)
                return 7;
  
        return 0;
@@@ -416,7 -417,7 +417,7 @@@ static void __init construct_default_io
        intsrc.type = MP_INTSRC;
        intsrc.irqflag = 0;     /* conforming */
        intsrc.srcbus = 0;
 -      intsrc.dstapic = mp_ioapics[0].mp_apicid;
 +      intsrc.dstapic = mp_ioapics[0].apicid;
  
        intsrc.irqtype = mp_INT;
  
@@@ -569,14 -570,14 +570,14 @@@ static inline void __init construct_def
        }
  }
  
 -static struct intel_mp_floating *mpf_found;
 +static struct mpf_intel *mpf_found;
  
  /*
   * Scan the memory blocks for an SMP configuration block.
   */
  static void __init __get_smp_config(unsigned int early)
  {
 -      struct intel_mp_floating *mpf = mpf_found;
 +      struct mpf_intel *mpf = mpf_found;
  
        if (!mpf)
                return;
        }
  
        printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n",
 -             mpf->mpf_specification);
 +             mpf->specification);
  #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
 -      if (mpf->mpf_feature2 & (1 << 7)) {
 +      if (mpf->feature2 & (1 << 7)) {
                printk(KERN_INFO "    IMCR and PIC compatibility mode.\n");
                pic_mode = 1;
        } else {
        /*
         * Now see if we need to read further.
         */
 -      if (mpf->mpf_feature1 != 0) {
 +      if (mpf->feature1 != 0) {
                if (early) {
                        /*
                         * local APIC has default address
                }
  
                printk(KERN_INFO "Default MP configuration #%d\n",
 -                     mpf->mpf_feature1);
 -              construct_default_ISA_mptable(mpf->mpf_feature1);
 +                     mpf->feature1);
 +              construct_default_ISA_mptable(mpf->feature1);
  
 -      } else if (mpf->mpf_physptr) {
 +      } else if (mpf->physptr) {
  
                /*
                 * Read the physical hardware table.  Anything here will
                 * override the defaults.
                 */
 -              if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr), early)) {
 +              if (!smp_read_mpc(phys_to_virt(mpf->physptr), early)) {
  #ifdef CONFIG_X86_LOCAL_APIC
                        smp_found_config = 0;
  #endif
@@@ -687,19 -688,19 +688,19 @@@ static int __init smp_scan_config(unsig
                                  unsigned reserve)
  {
        unsigned int *bp = phys_to_virt(base);
 -      struct intel_mp_floating *mpf;
 +      struct mpf_intel *mpf;
  
        apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n",
                        bp, length);
        BUILD_BUG_ON(sizeof(*mpf) != 16);
  
        while (length > 0) {
 -              mpf = (struct intel_mp_floating *)bp;
 +              mpf = (struct mpf_intel *)bp;
                if ((*bp == SMP_MAGIC_IDENT) &&
 -                  (mpf->mpf_length == 1) &&
 +                  (mpf->length == 1) &&
                    !mpf_checksum((unsigned char *)bp, 16) &&
 -                  ((mpf->mpf_specification == 1)
 -                   || (mpf->mpf_specification == 4))) {
 +                  ((mpf->specification == 1)
 +                   || (mpf->specification == 4))) {
  #ifdef CONFIG_X86_LOCAL_APIC
                        smp_found_config = 1;
  #endif
                                return 1;
                        reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
                                        BOOTMEM_DEFAULT);
 -                      if (mpf->mpf_physptr) {
 +                      if (mpf->physptr) {
                                unsigned long size = PAGE_SIZE;
  #ifdef CONFIG_X86_32
                                /*
                                 * the bottom is mapped now.
                                 * PC-9800's MPC table places on the very last
                                 * of physical memory; so that simply reserving
 -                               * PAGE_SIZE from mpg->mpf_physptr yields BUG()
 +                               * PAGE_SIZE from mpf->physptr yields BUG()
                                 * in reserve_bootmem.
                                 */
                                unsigned long end = max_low_pfn * PAGE_SIZE;
 -                              if (mpf->mpf_physptr + size > end)
 -                                      size = end - mpf->mpf_physptr;
 +                              if (mpf->physptr + size > end)
 +                                      size = end - mpf->physptr;
  #endif
 -                              reserve_bootmem_generic(mpf->mpf_physptr, size,
 +                              reserve_bootmem_generic(mpf->physptr, size,
                                                BOOTMEM_DEFAULT);
                        }
  
@@@ -808,15 -809,15 +809,15 @@@ static int  __init get_MP_intsrc_index(
        /* not legacy */
  
        for (i = 0; i < mp_irq_entries; i++) {
 -              if (mp_irqs[i].mp_irqtype != mp_INT)
 +              if (mp_irqs[i].irqtype != mp_INT)
                        continue;
  
 -              if (mp_irqs[i].mp_irqflag != 0x0f)
 +              if (mp_irqs[i].irqflag != 0x0f)
                        continue;
  
 -              if (mp_irqs[i].mp_srcbus != m->srcbus)
 +              if (mp_irqs[i].srcbus != m->srcbus)
                        continue;
 -              if (mp_irqs[i].mp_srcbusirq != m->srcbusirq)
 +              if (mp_irqs[i].srcbusirq != m->srcbusirq)
                        continue;
                if (irq_used[i]) {
                        /* already claimed */
@@@ -921,10 -922,10 +922,10 @@@ static int  __init replace_intsrc_all(s
                if (irq_used[i])
                        continue;
  
 -              if (mp_irqs[i].mp_irqtype != mp_INT)
 +              if (mp_irqs[i].irqtype != mp_INT)
                        continue;
  
 -              if (mp_irqs[i].mp_irqflag != 0x0f)
 +              if (mp_irqs[i].irqflag != 0x0f)
                        continue;
  
                if (nr_m_spare > 0) {
@@@ -1000,7 -1001,7 +1001,7 @@@ static int __init update_mp_table(void
  {
        char str[16];
        char oem[10];
 -      struct intel_mp_floating *mpf;
 +      struct mpf_intel *mpf;
        struct mpc_table *mpc, *mpc_new;
  
        if (!enable_update_mptable)
        /*
         * Now see if we need to go further.
         */
 -      if (mpf->mpf_feature1 != 0)
 +      if (mpf->feature1 != 0)
                return 0;
  
 -      if (!mpf->mpf_physptr)
 +      if (!mpf->physptr)
                return 0;
  
 -      mpc = phys_to_virt(mpf->mpf_physptr);
 +      mpc = phys_to_virt(mpf->physptr);
  
        if (!smp_check_mpc(mpc, oem, str))
                return 0;
  
        printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf));
 -      printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr);
 +      printk(KERN_INFO "physptr: %x\n", mpf->physptr);
  
        if (mpc_new_phys && mpc->length > mpc_new_length) {
                mpc_new_phys = 0;
                }
                printk(KERN_INFO "use in-positon replacing\n");
        } else {
 -              mpf->mpf_physptr = mpc_new_phys;
 +              mpf->physptr = mpc_new_phys;
                mpc_new = phys_to_virt(mpc_new_phys);
                memcpy(mpc_new, mpc, mpc->length);
                mpc = mpc_new;
                /* check if we can modify that */
 -              if (mpc_new_phys - mpf->mpf_physptr) {
 -                      struct intel_mp_floating *mpf_new;
 +              if (mpc_new_phys - mpf->physptr) {
 +                      struct mpf_intel *mpf_new;
                        /* steal 16 bytes from [0, 1k) */
                        printk(KERN_INFO "mpf new: %x\n", 0x400 - 16);
                        mpf_new = phys_to_virt(0x400 - 16);
                        memcpy(mpf_new, mpf, 16);
                        mpf = mpf_new;
 -                      mpf->mpf_physptr = mpc_new_phys;
 +                      mpf->physptr = mpc_new_phys;
                }
 -              mpf->mpf_checksum = 0;
 -              mpf->mpf_checksum -= mpf_checksum((unsigned char *)mpf, 16);
 -              printk(KERN_INFO "mpf_physptr new: %x\n", mpf->mpf_physptr);
 +              mpf->checksum = 0;
 +              mpf->checksum -= mpf_checksum((unsigned char *)mpf, 16);
 +              printk(KERN_INFO "physptr new: %x\n", mpf->physptr);
        }
  
        /*
@@@ -13,7 -13,6 +13,7 @@@
  #include <asm/mpspec.h>
  #include <asm/apicdef.h>
  #include <asm/highmem.h>
 +#include <asm/cpumask.h>
  
  #ifdef CONFIG_X86_LOCAL_APIC
  unsigned int num_processors;
@@@ -137,7 -136,7 +137,7 @@@ static void __init setup_cpu_pda_map(vo
  #ifdef CONFIG_X86_64
  
  /* correctly size the local cpu masks */
- static void setup_cpu_local_masks(void)
+ static void __init setup_cpu_local_masks(void)
  {
        alloc_bootmem_cpumask_var(&cpu_initialized_mask);
        alloc_bootmem_cpumask_var(&cpu_callin_mask);
@@@ -9,7 -9,6 +9,7 @@@
  #include <asm/e820.h>
  #include <asm/io.h>
  #include <asm/setup.h>
 +#include <asm/cpu.h>
  
  void __init pre_intr_init_hook(void)
  {
@@@ -34,13 -33,23 +34,23 @@@ void __init intr_init_hook(void
        setup_irq(2, &irq2);
  }
  
void __init pre_setup_arch_hook(void)
static void voyager_disable_tsc(void)
  {
        /* Voyagers run their CPUs from independent clocks, so disable
         * the TSC code because we can't sync them */
        setup_clear_cpu_cap(X86_FEATURE_TSC);
  }
  
+ void __init pre_setup_arch_hook(void)
+ {
+       voyager_disable_tsc();
+ }
+ void __init pre_time_init_hook(void)
+ {
+       voyager_disable_tsc();
+ }
  void __init trap_init_hook(void)
  {
  }
diff --combined arch/x86/mm/init_32.c
@@@ -49,6 -49,7 +49,6 @@@
  #include <asm/paravirt.h>
  #include <asm/setup.h>
  #include <asm/cacheflush.h>
 -#include <asm/smp.h>
  
  unsigned int __VMALLOC_RESERVE = 128 << 20;
  
@@@ -137,6 -138,47 +137,47 @@@ static pte_t * __init one_page_table_in
        return pte_offset_kernel(pmd, 0);
  }
  
+ static pte_t *__init page_table_kmap_check(pte_t *pte, pmd_t *pmd,
+                                          unsigned long vaddr, pte_t *lastpte)
+ {
+ #ifdef CONFIG_HIGHMEM
+       /*
+        * Something (early fixmap) may already have put a pte
+        * page here, which causes the page table allocation
+        * to become nonlinear. Attempt to fix it, and if it
+        * is still nonlinear then we have to bug.
+        */
+       int pmd_idx_kmap_begin = fix_to_virt(FIX_KMAP_END) >> PMD_SHIFT;
+       int pmd_idx_kmap_end = fix_to_virt(FIX_KMAP_BEGIN) >> PMD_SHIFT;
+       if (pmd_idx_kmap_begin != pmd_idx_kmap_end
+           && (vaddr >> PMD_SHIFT) >= pmd_idx_kmap_begin
+           && (vaddr >> PMD_SHIFT) <= pmd_idx_kmap_end
+           && ((__pa(pte) >> PAGE_SHIFT) < table_start
+               || (__pa(pte) >> PAGE_SHIFT) >= table_end)) {
+               pte_t *newpte;
+               int i;
+               BUG_ON(after_init_bootmem);
+               newpte = alloc_low_page();
+               for (i = 0; i < PTRS_PER_PTE; i++)
+                       set_pte(newpte + i, pte[i]);
+               paravirt_alloc_pte(&init_mm, __pa(newpte) >> PAGE_SHIFT);
+               set_pmd(pmd, __pmd(__pa(newpte)|_PAGE_TABLE));
+               BUG_ON(newpte != pte_offset_kernel(pmd, 0));
+               __flush_tlb_all();
+               paravirt_release_pte(__pa(pte) >> PAGE_SHIFT);
+               pte = newpte;
+       }
+       BUG_ON(vaddr < fix_to_virt(FIX_KMAP_BEGIN - 1)
+              && vaddr > fix_to_virt(FIX_KMAP_END)
+              && lastpte && lastpte + PTRS_PER_PTE != pte);
+ #endif
+       return pte;
+ }
  /*
   * This function initializes a certain range of kernel virtual memory
   * with new bootmem page tables, everywhere page tables are missing in
@@@ -153,6 -195,7 +194,7 @@@ page_table_range_init(unsigned long sta
        unsigned long vaddr;
        pgd_t *pgd;
        pmd_t *pmd;
+       pte_t *pte = NULL;
  
        vaddr = start;
        pgd_idx = pgd_index(vaddr);
                pmd = pmd + pmd_index(vaddr);
                for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);
                                                        pmd++, pmd_idx++) {
-                       one_page_table_init(pmd);
+                       pte = page_table_kmap_check(one_page_table_init(pmd),
+                                                   pmd, vaddr, pte);
  
                        vaddr += PMD_SIZE;
                }
@@@ -507,7 -551,6 +550,6 @@@ static void __init early_ioremap_page_t
         * Fixed mappings, only the page table structure has to be
         * created - mappings will be set by set_fixmap():
         */
-       early_ioremap_clear();
        vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
        end = (FIXADDR_TOP + PMD_SIZE - 1) & PMD_MASK;
        page_table_range_init(vaddr, end, pgd_base);
@@@ -800,7 -843,7 +842,7 @@@ static void __init find_early_table_spa
        tables += PAGE_ALIGN(ptes * sizeof(pte_t));
  
        /* for fixmap */
-       tables += PAGE_SIZE * 2;
+       tables += PAGE_ALIGN(__end_of_fixed_addresses * sizeof(pte_t));
  
        /*
         * RED-PEN putting page tables only on node 0 could