From: Andrew Morton Repair some of the damage against various things. Cc: Ingo Molnar Signed-off-by: Andrew Morton --- arch/x86/kernel/acpi/boot.c | 11 +++++- arch/x86/kernel/cpu/intel_cacheinfo.c | 14 ++++---- arch/x86/kernel/entry_64.S | 2 - arch/x86/kernel/suspend_64.c | 5 +- arch/x86/kernel/traps_32.c | 41 ++---------------------- arch/x86/kernel/traps_64.c | 8 ++-- arch/x86/oprofile/nmi_int.c | 4 +- include/asm-x86/thread_info_64.h | 1 include/linux/acpi.h | 1 9 files changed, 35 insertions(+), 52 deletions(-) diff -puN arch/x86/kernel/acpi/boot.c~git-x86-fixup arch/x86/kernel/acpi/boot.c --- a/arch/x86/kernel/acpi/boot.c~git-x86-fixup +++ a/arch/x86/kernel/acpi/boot.c @@ -104,7 +104,6 @@ enum acpi_irq_model_id acpi_irq_model = #ifdef CONFIG_X86_64 -/* rely on all ACPI tables being in the direct mapping */ char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size) { if (!phys_addr || !size) @@ -113,7 +112,15 @@ char *__init __acpi_map_table(unsigned l if (phys_addr+size <= (end_pfn_map << PAGE_SHIFT) + PAGE_SIZE) return __va(phys_addr); - return NULL; + return early_ioremap(phys_addr, size); +} + +void __acpi_unmap_table(void * addr, unsigned long size) +{ + if (!addr || !size) + return; + + early_iounmap(addr, size); } #else diff -puN arch/x86/kernel/cpu/intel_cacheinfo.c~git-x86-fixup arch/x86/kernel/cpu/intel_cacheinfo.c --- a/arch/x86/kernel/cpu/intel_cacheinfo.c~git-x86-fixup +++ a/arch/x86/kernel/cpu/intel_cacheinfo.c @@ -734,8 +734,9 @@ static int __cpuinit cache_add_dev(struc if (unlikely(retval < 0)) return retval; - retval = kobject_init_and_add(cache_kobject[cpu], &ktype_percpu_entry, - &sys_dev->kobj, "%s", "cache"); + retval = kobject_init_and_add(per_cpu(cache_kobject, cpu), + &ktype_percpu_entry, &sys_dev->kobj, + "%s", "cache"); if (retval < 0) { cpuid4_cache_sysfs_exit(cpu); return retval; @@ -746,13 +747,14 @@ static int __cpuinit cache_add_dev(struc this_object->cpu = cpu; this_object->index = i; retval = kobject_init_and_add(&(this_object->kobj), - &ktype_cache, cache_kobject[cpu], + &ktype_cache, + per_cpu(cache_kobject, cpu), "index%1lu", i); if (unlikely(retval)) { for (j = 0; j < i; j++) { kobject_put(&(INDEX_KOBJECT_PTR(cpu,j)->kobj)); } - kobject_put(cache_kobject[cpu]); + kobject_put(per_cpu(cache_kobject, cpu)); cpuid4_cache_sysfs_exit(cpu); break; } @@ -761,7 +763,7 @@ static int __cpuinit cache_add_dev(struc if (!retval) cpu_set(cpu, cache_dev_map); - kobject_uevent(cache_kobject[cpu], KOBJ_ADD); + kobject_uevent(per_cpu(cache_kobject, cpu), KOBJ_ADD); return retval; } @@ -778,7 +780,7 @@ static void __cpuinit cache_remove_dev(s for (i = 0; i < num_cache_leaves; i++) kobject_put(&(INDEX_KOBJECT_PTR(cpu,i)->kobj)); - kobject_put(cache_kobject[cpu]); + kobject_put(per_cpu(cache_kobject, cpu)); cpuid4_cache_sysfs_exit(cpu); } diff -puN arch/x86/kernel/entry_64.S~git-x86-fixup arch/x86/kernel/entry_64.S --- a/arch/x86/kernel/entry_64.S~git-x86-fixup +++ a/arch/x86/kernel/entry_64.S @@ -295,7 +295,7 @@ sysret_careful: /* Handle a signal */ sysret_signal: TRACE_IRQS_ON - sti + ENABLE_INTERRUPTS(CLBR_NONE) testl $_TIF_DO_NOTIFY_MASK,%edx jz 1f diff -puN arch/x86/kernel/traps_32.c~git-x86-fixup arch/x86/kernel/traps_32.c --- a/arch/x86/kernel/traps_32.c~git-x86-fixup +++ a/arch/x86/kernel/traps_32.c @@ -416,45 +416,14 @@ void die(const char * str, struct pt_reg raw_local_irq_save(flags); if (++die.lock_owner_depth < 3) { - unsigned long esp; - unsigned short ss; - - report_bug(regs->eip, regs); - - printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, - ++die_counter); -#ifdef CONFIG_PREEMPT - printk("PREEMPT "); -#endif -#ifdef CONFIG_SMP - printk("SMP "); -#endif -#ifdef CONFIG_DEBUG_PAGEALLOC - printk("DEBUG_PAGEALLOC"); -#endif - printk("\n"); - sysfs_printk_last_file(); - if (notify_die(DIE_OOPS, str, regs, err, - current->thread.trap_no, SIGSEGV) != - NOTIFY_STOP) { - show_registers(regs); - /* Executive summary in case the oops scrolled away */ - esp = (unsigned long) (®s->esp); - savesegment(ss, ss); - if (user_mode(regs)) { - esp = regs->esp; - ss = regs->xss & 0xffff; - } - printk(KERN_EMERG "EIP: [<%08lx>] ", regs->eip); - print_symbol("%s", regs->eip); - printk(" SS:ESP %04x:%08lx\n", ss, esp); - } - else + report_bug(regs->ip, regs); + + if (__die(str, regs, err)) regs = NULL; - } else + } else { printk(KERN_EMERG "Recursive die() failure, output suppressed\n"); - + } bust_spinlocks(0); die.lock_owner = -1; add_taint(TAINT_DIE); diff -puN arch/x86/kernel/traps_64.c~git-x86-fixup arch/x86/kernel/traps_64.c --- a/arch/x86/kernel/traps_64.c~git-x86-fixup +++ a/arch/x86/kernel/traps_64.c @@ -577,15 +577,17 @@ int __kprobes __die(const char * str, st #endif printk("\n"); sysfs_printk_last_file(); - notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV); + if (notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) + return 1; show_registers(regs); add_taint(TAINT_DIE); /* Executive summary in case the oops scrolled away */ printk(KERN_ALERT "RIP "); - printk_address(regs->rip); - printk(" RSP <%016lx>\n", regs->rsp); + printk_address(regs->ip); + printk(" RSP <%016lx>\n", regs->sp); if (kexec_should_crash(current)) crash_kexec(regs); + return 0; } void die(const char * str, struct pt_regs * regs, long err) diff -puN arch/x86/oprofile/nmi_int.c~git-x86-fixup arch/x86/oprofile/nmi_int.c --- a/arch/x86/oprofile/nmi_int.c~git-x86-fixup +++ a/arch/x86/oprofile/nmi_int.c @@ -65,7 +65,9 @@ static struct sys_device device_oprofile static int __init init_sysfs(void) { int error; - if (!(error = sysdev_class_register(&oprofile_sysclass))) + + error = sysdev_class_register(&oprofile_sysclass); + if (!error) error = sysdev_register(&device_oprofile); return error; } diff -puN arch/x86/pci/init.c~git-x86-fixup arch/x86/pci/init.c diff -puN include/asm-x86/thread_info_64.h~git-x86-fixup include/asm-x86/thread_info_64.h --- a/include/asm-x86/thread_info_64.h~git-x86-fixup +++ a/include/asm-x86/thread_info_64.h @@ -113,7 +113,6 @@ static inline struct thread_info *stack_ #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ #define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */ #define TIF_HRTICK_RESCHED 11 /* reprogram hrtick timer */ -/* 16 free */ #define TIF_IA32 17 /* 32bit process */ #define TIF_FORK 18 /* ret_from_fork */ #define TIF_ABI_PENDING 19 diff -puN include/linux/acpi.h~git-x86-fixup include/linux/acpi.h --- a/include/linux/acpi.h~git-x86-fixup +++ a/include/linux/acpi.h @@ -78,6 +78,7 @@ typedef int (*acpi_table_handler) (struc typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); char * __acpi_map_table (unsigned long phys_addr, unsigned long size); +void __acpi_unmap_table (void * addr, unsigned long size); int acpi_boot_init (void); int acpi_boot_table_init (void); int acpi_numa_init (void); diff -puN arch/x86/kernel/suspend_64.c~git-x86-fixup arch/x86/kernel/suspend_64.c --- a/arch/x86/kernel/suspend_64.c~git-x86-fixup +++ a/arch/x86/kernel/suspend_64.c @@ -135,7 +135,7 @@ void restore_processor_state(void) __restore_processor_state(&saved_context); } -void fix_processor_context(void) +static void fix_processor_context(void) { int cpu = smp_processor_id(); struct tss_struct *t = &per_cpu(init_tss, cpu); @@ -147,7 +147,8 @@ void fix_processor_context(void) */ set_tss_desc(cpu, t); - cpu_gdt(cpu)[GDT_ENTRY_TSS].type = 9; + get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9; + syscall_init(); /* This sets MSR_*STAR and related */ load_TR_desc(); /* This does ltr */ _