Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 19 Oct 2007 22:06:00 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 19 Oct 2007 22:06:00 +0000 (15:06 -0700)
* ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86: (33 commits)
  x86: convert cpuinfo_x86 array to a per_cpu array
  x86: introduce frame_pointer() and stack_pointer()
  x86 & generic: change to __builtin_prefetch()
  i386: do not BUG_ON() when MSR is unknown
  x86: acpi use cpu_physical_id
  x86: convert cpu_llc_id to be a per cpu variable
  x86: convert cpu_to_apicid to be a per cpu variable
  i386: introduce "used_vectors" bitmap which can be used to reserve vectors.
  x86: use raw locks during oopses
  x86: honor _PAGE_PSE bit on page walks
  i386: do cpuid_device_create() in CPU_UP_PREPARE instead of CPU_ONLINE.
  x86: implement missing x86_64 function smp_call_function_mask()
  x86: use descriptor's functions instead of inline assembly
  i386: consolidate show_regs and show_registers for i386
  i386: make callgraph use dump_trace() on i386/x86_64
  x86: enable iommu_merge by default
  i386: i386 add AMD64 Barcelona PMU MSR definitions to msr.h
  x86: Unify i386 and x86-64 early quirks
  x86: enable HPET on ICH3 and ICH4
  x86: force enable HPET on VT8235/8237 chipsets
  ...

Manually fix trivial conflict with task pid container helper changes in
arch/x86/kernel/process_32.c

12 files changed:
1  2 
Documentation/kernel-parameters.txt
arch/i386/Kconfig
arch/x86/kernel/process_32.c
arch/x86/kernel/setup_32.c
arch/x86/kernel/setup_64.c
arch/x86/kernel/traps_32.c
arch/x86/mm/fault_32.c
arch/x86/mm/fault_64.c
arch/x86_64/Kconfig
drivers/acpi/processor_core.c
include/asm-x86/smp_32.h
include/asm-x86/topology_64.h

@@@ -431,8 -431,10 +431,10 @@@ and is between 256 and 4096 characters
                        over the 8254 in addition to over the IO-APIC. The
                        kernel tries to set a sensible default.
  
-       hpet=           [X86-32,HPET] option to disable HPET and use PIT.
-                       Format: disable
+       hpet=           [X86-32,HPET] option to control HPET usage
+                       Format: { enable (default) | disable | force }
+                       disable: disable HPET and use PIT instead
+                       force: allow force enabled of undocumented chips (ICH4, VIA)
  
        com20020=       [HW,NET] ARCnet - COM20020 chipset
                        Format:
                        [KNL] Reserve a chunk of physical memory to
                        hold a kernel to switch to with kexec on panic.
  
 +      crashkernel=range1:size1[,range2:size2,...][@offset]
 +                      [KNL] Same as above, but depends on the memory
 +                      in the running system. The syntax of range is
 +                      start-[end] where start and end are both
 +                      a memory unit (amount[KMG]). See also
 +                      Documentation/kdump/kdump.txt for a example.
 +
        cs4232=         [HW,OSS]
                        Format: <io>,<irq>,<dma>,<dma2>,<mpuio>,<mpuirq>
  
diff --combined arch/i386/Kconfig
@@@ -1080,10 -1080,8 +1080,10 @@@ config APM_REAL_MODE_POWER_OF
  
  endif # APM
  
- source "arch/x86/kernel/cpu/cpufreq/Kconfig"
+ source "arch/x86/kernel/cpu/cpufreq/Kconfig_32"
  
 +source "drivers/cpuidle/Kconfig"
 +
  endmenu
  
  menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
@@@ -1258,6 -1256,31 +1258,6 @@@ source "drivers/Kconfig
  
  source "fs/Kconfig"
  
 -menuconfig INSTRUMENTATION
 -      bool "Instrumentation Support"
 -      default y
 -      ---help---
 -        Say Y here to get to see options related to performance measurement,
 -        debugging, and testing. This option alone does not add any kernel code.
 -
 -        If you say N, all options in this submenu will be skipped and disabled.
 -
 -if INSTRUMENTATION
 -
 -source "arch/x86/oprofile/Kconfig"
 -
 -config KPROBES
 -      bool "Kprobes"
 -      depends on KALLSYMS && MODULES
 -      help
 -        Kprobes allows you to trap at almost any kernel address and
 -        execute a callback function.  register_kprobe() establishes
 -        a probepoint and specifies the callback.  Kprobes is useful
 -        for kernel debugging, non-intrusive instrumentation and testing.
 -        If in doubt, say "N".
 -
 -endif # INSTRUMENTATION
 -
  source "arch/i386/Kconfig.debug"
  
  source "security/Kconfig"
@@@ -295,34 -295,52 +295,52 @@@ static int __init idle_setup(char *str
  }
  early_param("idle", idle_setup);
  
- void show_regs(struct pt_regs * regs)
+ void __show_registers(struct pt_regs *regs, int all)
  {
        unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
        unsigned long d0, d1, d2, d3, d6, d7;
+       unsigned long esp;
+       unsigned short ss, gs;
+       if (user_mode_vm(regs)) {
+               esp = regs->esp;
+               ss = regs->xss & 0xffff;
+               savesegment(gs, gs);
+       } else {
+               esp = (unsigned long) (&regs->esp);
+               savesegment(ss, ss);
+               savesegment(gs, gs);
+       }
  
        printk("\n");
-       printk("Pid: %d, comm: %20s\n", task_pid_nr(current), current->comm);
-       printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id());
 -      printk("Pid: %d, comm: %.*s %s (%s %.*s)\n",
 -                      current->pid, TASK_COMM_LEN, current->comm,
++      printk("Pid: %d, comm: %s %s (%s %.*s)\n",
++                      task_pid_nr(current), current->comm,
+                       print_tainted(), init_utsname()->release,
+                       (int)strcspn(init_utsname()->version, " "),
+                       init_utsname()->version);
+       printk("EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n",
+                       0xffff & regs->xcs, regs->eip, regs->eflags,
+                       smp_processor_id());
        print_symbol("EIP is at %s\n", regs->eip);
  
-       if (user_mode_vm(regs))
-               printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
-       printk(" EFLAGS: %08lx    %s  (%s %.*s)\n",
-              regs->eflags, print_tainted(), init_utsname()->release,
-              (int)strcspn(init_utsname()->version, " "),
-              init_utsname()->version);
        printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
-               regs->eax,regs->ebx,regs->ecx,regs->edx);
-       printk("ESI: %08lx EDI: %08lx EBP: %08lx",
-               regs->esi, regs->edi, regs->ebp);
-       printk(" DS: %04x ES: %04x FS: %04x\n",
-              0xffff & regs->xds,0xffff & regs->xes, 0xffff & regs->xfs);
+               regs->eax, regs->ebx, regs->ecx, regs->edx);
+       printk("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n",
+               regs->esi, regs->edi, regs->ebp, esp);
+       printk(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n",
+              regs->xds & 0xffff, regs->xes & 0xffff,
+              regs->xfs & 0xffff, gs, ss);
+       if (!all)
+               return;
  
        cr0 = read_cr0();
        cr2 = read_cr2();
        cr3 = read_cr3();
        cr4 = read_cr4_safe();
-       printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4);
+       printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n",
+                       cr0, cr2, cr3, cr4);
  
        get_debugreg(d0, 0);
        get_debugreg(d1, 1);
        get_debugreg(d3, 3);
        printk("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
                        d0, d1, d2, d3);
        get_debugreg(d6, 6);
        get_debugreg(d7, 7);
-       printk("DR6: %08lx DR7: %08lx\n", d6, d7);
+       printk("DR6: %08lx DR7: %08lx\n",
+                       d6, d7);
+ }
  
+ void show_regs(struct pt_regs *regs)
+ {
+       __show_registers(regs, 1);
        show_trace(NULL, regs, &regs->esp);
  }
  
@@@ -378,49 -378,6 +378,49 @@@ extern unsigned long __init setup_memor
  extern void zone_sizes_init(void);
  #endif /* !CONFIG_NEED_MULTIPLE_NODES */
  
 +static inline unsigned long long get_total_mem(void)
 +{
 +      unsigned long long total;
 +
 +      total = max_low_pfn - min_low_pfn;
 +#ifdef CONFIG_HIGHMEM
 +      total += highend_pfn - highstart_pfn;
 +#endif
 +
 +      return total << PAGE_SHIFT;
 +}
 +
 +#ifdef CONFIG_KEXEC
 +static void __init reserve_crashkernel(void)
 +{
 +      unsigned long long total_mem;
 +      unsigned long long crash_size, crash_base;
 +      int ret;
 +
 +      total_mem = get_total_mem();
 +
 +      ret = parse_crashkernel(boot_command_line, total_mem,
 +                      &crash_size, &crash_base);
 +      if (ret == 0 && crash_size > 0) {
 +              if (crash_base > 0) {
 +                      printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
 +                                      "for crashkernel (System RAM: %ldMB)\n",
 +                                      (unsigned long)(crash_size >> 20),
 +                                      (unsigned long)(crash_base >> 20),
 +                                      (unsigned long)(total_mem >> 20));
 +                      crashk_res.start = crash_base;
 +                      crashk_res.end   = crash_base + crash_size - 1;
 +                      reserve_bootmem(crash_base, crash_size);
 +              } else
 +                      printk(KERN_INFO "crashkernel reservation failed - "
 +                                      "you have to specify a base address\n");
 +      }
 +}
 +#else
 +static inline void __init reserve_crashkernel(void)
 +{}
 +#endif
 +
  void __init setup_bootmem_allocator(void)
  {
        unsigned long bootmap_size;
                }
        }
  #endif
 -#ifdef CONFIG_KEXEC
 -      if (crashk_res.start != crashk_res.end)
 -              reserve_bootmem(crashk_res.start,
 -                      crashk_res.end - crashk_res.start + 1);
 -#endif
 +      reserve_crashkernel();
  }
  
  /*
@@@ -661,9 -622,7 +661,7 @@@ void __init setup_arch(char **cmdline_p
  #endif
  
  #ifdef CONFIG_PCI
- #ifdef CONFIG_X86_IO_APIC
-       check_acpi_pci();       /* Checks more than just ACPI actually */
- #endif
+       early_quirks();
  #endif
  
  #ifdef CONFIG_ACPI
@@@ -191,37 -191,6 +191,37 @@@ static inline void copy_edd(void
  }
  #endif
  
 +#ifdef CONFIG_KEXEC
 +static void __init reserve_crashkernel(void)
 +{
 +      unsigned long long free_mem;
 +      unsigned long long crash_size, crash_base;
 +      int ret;
 +
 +      free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT;
 +
 +      ret = parse_crashkernel(boot_command_line, free_mem,
 +                      &crash_size, &crash_base);
 +      if (ret == 0 && crash_size) {
 +              if (crash_base > 0) {
 +                      printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
 +                                      "for crashkernel (System RAM: %ldMB)\n",
 +                                      (unsigned long)(crash_size >> 20),
 +                                      (unsigned long)(crash_base >> 20),
 +                                      (unsigned long)(free_mem >> 20));
 +                      crashk_res.start = crash_base;
 +                      crashk_res.end   = crash_base + crash_size - 1;
 +                      reserve_bootmem(crash_base, crash_size);
 +              } else
 +                      printk(KERN_INFO "crashkernel reservation failed - "
 +                                      "you have to specify a base address\n");
 +      }
 +}
 +#else
 +static inline void __init reserve_crashkernel(void)
 +{}
 +#endif
 +
  #define EBDA_ADDR_POINTER 0x40E
  
  unsigned __initdata ebda_addr;
@@@ -302,6 -271,11 +302,11 @@@ void __init setup_arch(char **cmdline_p
  
        dmi_scan_machine();
  
+ #ifdef CONFIG_SMP
+       /* setup to use the static apicid table during kernel startup */
+       x86_cpu_to_apicid_ptr = (void *)&x86_cpu_to_apicid_init;
+ #endif
  #ifdef CONFIG_ACPI
        /*
         * Initialize the ACPI boot-time table parser (gets the RSDP and SDT).
                }
        }
  #endif
 -#ifdef CONFIG_KEXEC
 -      if (crashk_res.start != crashk_res.end) {
 -              reserve_bootmem_generic(crashk_res.start,
 -                      crashk_res.end - crashk_res.start + 1);
 -      }
 -#endif
 -
 +      reserve_crashkernel();
        paging_init();
  
  #ifdef CONFIG_PCI
@@@ -554,7 -534,7 +559,7 @@@ static void __init amd_detect_cmp(struc
                   but in the same order as the HT nodeids.
                   If that doesn't result in a usable node fall back to the
                   path for the previous case.  */
-               int ht_nodeid = apicid - (cpu_data[0].phys_proc_id << bits);
+               int ht_nodeid = apicid - (cpu_data(0).phys_proc_id << bits);
                if (ht_nodeid >= 0 &&
                    apicid_to_node[ht_nodeid] != NUMA_NO_NODE)
                        node = apicid_to_node[ht_nodeid];
@@@ -878,6 -858,7 +883,7 @@@ void __cpuinit early_identify_cpu(struc
  
  #ifdef CONFIG_SMP
        c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
+       c->cpu_index = 0;
  #endif
  }
  
@@@ -984,6 -965,7 +990,7 @@@ void __cpuinit print_cpu_info(struct cp
  static int show_cpuinfo(struct seq_file *m, void *v)
  {
        struct cpuinfo_x86 *c = v;
+       int cpu = 0;
  
        /* 
         * These flag bits must match the definitions in <asm/cpufeature.h>.
  
  
  #ifdef CONFIG_SMP
-       if (!cpu_online(c-cpu_data))
+       if (!cpu_online(c->cpu_index))
                return 0;
+       cpu = c->cpu_index;
  #endif
  
        seq_printf(m,"processor\t: %u\n"
                     "cpu family\t: %d\n"
                     "model\t\t: %d\n"
                     "model name\t: %s\n",
-                    (unsigned)(c-cpu_data),
+                    (unsigned)cpu,
                     c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown",
                     c->x86,
                     (int)c->x86_model,
                seq_printf(m, "stepping\t: unknown\n");
        
        if (cpu_has(c,X86_FEATURE_TSC)) {
-               unsigned int freq = cpufreq_quick_get((unsigned)(c-cpu_data));
+               unsigned int freq = cpufreq_quick_get((unsigned)cpu);
                if (!freq)
                        freq = cpu_khz;
                seq_printf(m, "cpu MHz\t\t: %u.%03u\n",
        
  #ifdef CONFIG_SMP
        if (smp_num_siblings * c->x86_max_cores > 1) {
-               int cpu = c - cpu_data;
                seq_printf(m, "physical id\t: %d\n", c->phys_proc_id);
                seq_printf(m, "siblings\t: %d\n",
                               cpus_weight(per_cpu(cpu_core_map, cpu)));
  
  static void *c_start(struct seq_file *m, loff_t *pos)
  {
-       return *pos < NR_CPUS ? cpu_data + *pos : NULL;
+       if (*pos == 0)  /* just in case, cpu 0 is not the first */
+               *pos = first_cpu(cpu_possible_map);
+       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               return &cpu_data(*pos);
+       return NULL;
  }
  
  static void *c_next(struct seq_file *m, void *v, loff_t *pos)
  {
-       ++*pos;
+       *pos = next_cpu(*pos, cpu_possible_map);
        return c_start(m, pos);
  }
  
@@@ -63,6 -63,9 +63,9 @@@
  
  int panic_on_unrecovered_nmi;
  
+ DECLARE_BITMAP(used_vectors, NR_VECTORS);
+ EXPORT_SYMBOL_GPL(used_vectors);
  asmlinkage int system_call(void);
  
  /* Do we ignore FPU interrupts ? */
@@@ -288,48 -291,24 +291,24 @@@ EXPORT_SYMBOL(dump_stack)
  void show_registers(struct pt_regs *regs)
  {
        int i;
-       int in_kernel = 1;
-       unsigned long esp;
-       unsigned short ss, gs;
-       esp = (unsigned long) (&regs->esp);
-       savesegment(ss, ss);
-       savesegment(gs, gs);
-       if (user_mode_vm(regs)) {
-               in_kernel = 0;
-               esp = regs->esp;
-               ss = regs->xss & 0xffff;
-       }
        print_modules();
-       printk(KERN_EMERG "CPU:    %d\n"
-               KERN_EMERG "EIP:    %04x:[<%08lx>]    %s VLI\n"
-               KERN_EMERG "EFLAGS: %08lx   (%s %.*s)\n",
-               smp_processor_id(), 0xffff & regs->xcs, regs->eip,
-               print_tainted(), regs->eflags, init_utsname()->release,
-               (int)strcspn(init_utsname()->version, " "),
-               init_utsname()->version);
-       print_symbol(KERN_EMERG "EIP is at %s\n", regs->eip);
-       printk(KERN_EMERG "eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
-               regs->eax, regs->ebx, regs->ecx, regs->edx);
-       printk(KERN_EMERG "esi: %08lx   edi: %08lx   ebp: %08lx   esp: %08lx\n",
-               regs->esi, regs->edi, regs->ebp, esp);
-       printk(KERN_EMERG "ds: %04x   es: %04x   fs: %04x  gs: %04x  ss: %04x\n",
-              regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss);
+       __show_registers(regs, 0);
        printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)",
 -              TASK_COMM_LEN, current->comm, current->pid,
 +              TASK_COMM_LEN, current->comm, task_pid_nr(current),
                current_thread_info(), current, task_thread_info(current));
        /*
         * When in-kernel, we also print out the stack and code at the
         * time of the fault..
         */
-       if (in_kernel) {
+       if (!user_mode_vm(regs)) {
                u8 *eip;
                unsigned int code_prologue = code_bytes * 43 / 64;
                unsigned int code_len = code_bytes;
                unsigned char c;
  
                printk("\n" KERN_EMERG "Stack: ");
-               show_stack_log_lvl(NULL, regs, (unsigned long *)esp, KERN_EMERG);
+               show_stack_log_lvl(NULL, regs, &regs->esp, KERN_EMERG);
  
                printk(KERN_EMERG "Code: ");
  
@@@ -374,11 -353,11 +353,11 @@@ int is_valid_bugaddr(unsigned long eip
  void die(const char * str, struct pt_regs * regs, long err)
  {
        static struct {
-               spinlock_t lock;
+               raw_spinlock_t lock;
                u32 lock_owner;
                int lock_owner_depth;
        } die = {
-               .lock =                 __SPIN_LOCK_UNLOCKED(die.lock),
+               .lock =                 __RAW_SPIN_LOCK_UNLOCKED,
                .lock_owner =           -1,
                .lock_owner_depth =     0
        };
  
        if (die.lock_owner != raw_smp_processor_id()) {
                console_verbose();
-               spin_lock_irqsave(&die.lock, flags);
+               __raw_spin_lock(&die.lock);
+               raw_local_save_flags(flags);
                die.lock_owner = smp_processor_id();
                die.lock_owner_depth = 0;
                bust_spinlocks(1);
        }
        else
-               local_save_flags(flags);
+               raw_local_save_flags(flags);
  
        if (++die.lock_owner_depth < 3) {
                unsigned long esp;
        bust_spinlocks(0);
        die.lock_owner = -1;
        add_taint(TAINT_DIE);
-       spin_unlock_irqrestore(&die.lock, flags);
+       __raw_spin_unlock(&die.lock);
+       raw_local_irq_restore(flags);
  
        if (!regs)
                return;
@@@ -622,7 -603,7 +603,7 @@@ fastcall void __kprobes do_general_prot
            printk_ratelimit())
                printk(KERN_INFO
                    "%s[%d] general protection eip:%lx esp:%lx error:%lx\n",
 -                  current->comm, current->pid,
 +                  current->comm, task_pid_nr(current),
                    regs->eip, regs->esp, error_code);
  
        force_sig(SIGSEGV, current);
@@@ -1142,6 -1123,8 +1123,8 @@@ static void __init set_task_gate(unsign
  
  void __init trap_init(void)
  {
+       int i;
  #ifdef CONFIG_EISA
        void __iomem *p = ioremap(0x0FFFD9, 4);
        if (readl(p) == 'E'+('I'<<8)+('S'<<16)+('A'<<24)) {
  
        set_system_gate(SYSCALL_VECTOR,&system_call);
  
+       /* Reserve all the builtin and the syscall vector. */
+       for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++)
+               set_bit(i, used_vectors);
+       set_bit(SYSCALL_VECTOR, used_vectors);
        /*
         * Should be a barrier for any external CPU state.
         */
diff --combined arch/x86/mm/fault_32.c
@@@ -471,8 -471,8 +471,8 @@@ bad_area_nosemaphore
                    printk_ratelimit()) {
                        printk("%s%s[%d]: segfault at %08lx eip %08lx "
                            "esp %08lx error %lx\n",
 -                          tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
 -                          tsk->comm, tsk->pid, address, regs->eip,
 +                          task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
 +                          tsk->comm, task_pid_nr(tsk), address, regs->eip,
                            regs->esp, error_code);
                }
                tsk->thread.cr2 = address;
@@@ -564,7 -564,8 +564,8 @@@ no_context
                 * it's allocated already.
                 */
                if ((page >> PAGE_SHIFT) < max_low_pfn
-                   && (page & _PAGE_PRESENT)) {
+                   && (page & _PAGE_PRESENT)
+                   && !(page & _PAGE_PSE)) {
                        page &= PAGE_MASK;
                        page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT)
                                                                 & (PTRS_PER_PTE - 1)];
   */
  out_of_memory:
        up_read(&mm->mmap_sem);
 -      if (is_init(tsk)) {
 +      if (is_global_init(tsk)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
diff --combined arch/x86/mm/fault_64.c
@@@ -169,7 -169,7 +169,7 @@@ void dump_pagetable(unsigned long addre
        pmd = pmd_offset(pud, address);
        if (bad_address(pmd)) goto bad;
        printk("PMD %lx ", pmd_val(*pmd));
-       if (!pmd_present(*pmd)) goto ret;        
+       if (!pmd_present(*pmd) || pmd_large(*pmd)) goto ret;
  
        pte = pte_offset_kernel(pmd, address);
        if (bad_address(pte)) goto bad;
@@@ -285,7 -285,6 +285,6 @@@ static int vmalloc_fault(unsigned long 
        return 0;
  }
  
- static int page_fault_trace;
  int show_unhandled_signals = 1;
  
  /*
@@@ -354,10 -353,6 +353,6 @@@ asmlinkage void __kprobes do_page_fault
        if (likely(regs->eflags & X86_EFLAGS_IF))
                local_irq_enable();
  
-       if (unlikely(page_fault_trace))
-               printk("pagefault rip:%lx rsp:%lx cs:%lu ss:%lu address %lx error %lx\n",
-                      regs->rip,regs->rsp,regs->cs,regs->ss,address,error_code); 
        if (unlikely(error_code & PF_RSVD))
                pgtable_bad(address, regs, error_code);
  
@@@ -488,7 -483,7 +483,7 @@@ bad_area_nosemaphore
                if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
                    printk_ratelimit()) {
                        printk(
-                      "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
+                      "%s%s[%d]: segfault at %lx rip %lx rsp %lx error %lx\n",
                                        tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
                                        tsk->comm, tsk->pid, address, regs->rip,
                                        regs->rsp, error_code);
@@@ -554,7 -549,7 +549,7 @@@ no_context
   */
  out_of_memory:
        up_read(&mm->mmap_sem);
 -      if (is_init(current)) {
 +      if (is_global_init(current)) {
                yield();
                goto again;
        }
@@@ -621,10 -616,3 +616,3 @@@ void vmalloc_sync_all(void
        BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) == 
                                (__START_KERNEL & PGDIR_MASK)));
  }
- static int __init enable_pagefaulttrace(char *str)
- {
-       page_fault_trace = 1;
-       return 1;
- }
- __setup("pagefaulttrace", enable_pagefaulttrace);
diff --combined arch/x86_64/Kconfig
@@@ -723,10 -723,8 +723,10 @@@ config ARCH_HIBERNATION_HEADE
  
  source "drivers/acpi/Kconfig"
  
- source "arch/x86/kernel/cpufreq/Kconfig"
+ source "arch/x86/kernel/cpu/cpufreq/Kconfig_64"
  
 +source "drivers/cpuidle/Kconfig"
 +
  endmenu
  
  menu "Bus options (PCI etc.)"
@@@ -768,9 -766,9 +768,9 @@@ source "fs/Kconfig.binfmt
  config IA32_EMULATION
        bool "IA32 Emulation"
        help
-         Include code to run 32-bit programs under a 64-bit kernel. You should likely
-         turn this on, unless you're 100% sure that you don't have any 32-bit programs
-         left.
+         Include code to run 32-bit programs under a 64-bit kernel. You should
+         likely turn this on, unless you're 100% sure that you don't have any
+         32-bit programs left.
  
  config IA32_AOUT
         tristate "IA32 a.out support"
@@@ -801,6 -799,21 +801,6 @@@ source "drivers/firmware/Kconfig
  
  source fs/Kconfig
  
 -menu "Instrumentation Support"
 -
 -source "arch/x86/oprofile/Kconfig"
 -
 -config KPROBES
 -      bool "Kprobes"
 -      depends on KALLSYMS && MODULES
 -      help
 -        Kprobes allows you to trap at almost any kernel address and
 -        execute a callback function.  register_kprobe() establishes
 -        a probepoint and specifies the callback.  Kprobes is useful
 -        for kernel debugging, non-intrusive instrumentation and testing.
 -        If in doubt, say "N".
 -endmenu
 -
  source "arch/x86_64/Kconfig.debug"
  
  source "security/Kconfig"
@@@ -44,7 -44,6 +44,7 @@@
  #include <linux/seq_file.h>
  #include <linux/dmi.h>
  #include <linux/moduleparam.h>
 +#include <linux/cpuidle.h>
  
  #include <asm/io.h>
  #include <asm/system.h>
@@@ -422,12 -421,6 +422,6 @@@ static int map_lsapic_id(struct acpi_su
        return 0;
  }
  
- #ifdef CONFIG_IA64
- #define arch_cpu_to_apicid    ia64_cpu_to_sapicid
- #else
- #define arch_cpu_to_apicid    x86_cpu_to_apicid
- #endif
  static int map_madt_entry(u32 acpi_id)
  {
        unsigned long madt_end, entry;
@@@ -501,7 -494,7 +495,7 @@@ static int get_cpu_id(acpi_handle handl
                return apic_id;
  
        for (i = 0; i < NR_CPUS; ++i) {
-               if (arch_cpu_to_apicid[i] == apic_id)
+               if (cpu_physical_id(i) == apic_id)
                        return i;
        }
        return -1;
@@@ -1050,13 -1043,11 +1044,13 @@@ static int __init acpi_processor_init(v
                return -ENOMEM;
        acpi_processor_dir->owner = THIS_MODULE;
  
 +      result = cpuidle_register_driver(&acpi_idle_driver);
 +      if (result < 0)
 +              goto out_proc;
 +
        result = acpi_bus_register_driver(&acpi_processor_driver);
 -      if (result < 0) {
 -              remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
 -              return result;
 -      }
 +      if (result < 0)
 +              goto out_cpuidle;
  
        acpi_processor_install_hotplug_notify();
  
        acpi_processor_ppc_init();
  
        return 0;
 +
 +out_cpuidle:
 +      cpuidle_unregister_driver(&acpi_idle_driver);
 +
 +out_proc:
 +      remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
 +
 +      return result;
  }
  
  static void __exit acpi_processor_exit(void)
  {
 -
        acpi_processor_ppc_exit();
  
        acpi_thermal_cpufreq_exit();
  
        acpi_bus_unregister_driver(&acpi_processor_driver);
  
 +      cpuidle_unregister_driver(&acpi_idle_driver);
 +
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
  
        return;
diff --combined include/asm-x86/smp_32.h
@@@ -11,7 -11,7 +11,7 @@@
  #endif
  
  #if defined(CONFIG_X86_LOCAL_APIC) && !defined(__ASSEMBLY__)
 -#include <asm/bitops.h>
 +#include <linux/bitops.h>
  #include <asm/mpspec.h>
  #include <asm/apic.h>
  #ifdef CONFIG_X86_IO_APIC
@@@ -39,9 -39,11 +39,11 @@@ extern void lock_ipi_call_lock(void)
  extern void unlock_ipi_call_lock(void);
  
  #define MAX_APICID 256
- extern u8 x86_cpu_to_apicid[];
+ extern u8 __initdata x86_cpu_to_apicid_init[];
+ extern void *x86_cpu_to_apicid_ptr;
+ DECLARE_PER_CPU(u8, x86_cpu_to_apicid);
  
- #define cpu_physical_id(cpu)  x86_cpu_to_apicid[cpu]
+ #define cpu_physical_id(cpu)  per_cpu(x86_cpu_to_apicid, cpu)
  
  extern void set_cpu_sibling_map(int cpu);
  
@@@ -5,7 -5,7 +5,7 @@@
  #ifdef CONFIG_NUMA
  
  #include <asm/mpspec.h>
 -#include <asm/bitops.h>
 +#include <linux/bitops.h>
  
  extern cpumask_t cpu_online_map;
  
@@@ -56,8 -56,8 +56,8 @@@ extern int __node_distance(int, int)
  #endif
  
  #ifdef CONFIG_SMP
- #define topology_physical_package_id(cpu)     (cpu_data[cpu].phys_proc_id)
- #define topology_core_id(cpu)                 (cpu_data[cpu].cpu_core_id)
+ #define topology_physical_package_id(cpu)     (cpu_data(cpu).phys_proc_id)
+ #define topology_core_id(cpu)                 (cpu_data(cpu).cpu_core_id)
  #define topology_core_siblings(cpu)           (per_cpu(cpu_core_map, cpu))
  #define topology_thread_siblings(cpu)         (per_cpu(cpu_sibling_map, cpu))
  #define mc_capable()                  (boot_cpu_data.x86_max_cores > 1)