diff options
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/i386/kernel/alternative.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/apic.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/apm.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/crash.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/efi.c | 12 | ||||
-rw-r--r-- | arch/i386/kernel/i8259.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/io_apic.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/ioport.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/kprobes.c | 27 | ||||
-rw-r--r-- | arch/i386/kernel/ldt.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/legacy_serial.c | 67 | ||||
-rw-r--r-- | arch/i386/kernel/mpparse.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/msr.c | 106 | ||||
-rw-r--r-- | arch/i386/kernel/nmi.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/pci-dma.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/ptrace.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/signal.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/smp.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/smpboot.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/sys_i386.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/syscall_table.S | 1 | ||||
-rw-r--r-- | arch/i386/kernel/traps.c | 21 | ||||
-rw-r--r-- | arch/i386/kernel/vm86.c | 1 |
25 files changed, 101 insertions, 160 deletions
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 4f98516b9f94..91cff8dc9e1a 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -34,6 +34,7 @@ obj-y += sysenter.o vsyscall.o obj-$(CONFIG_ACPI_SRAT) += srat.o obj-$(CONFIG_EFI) += efi.o efi_stub.o obj-$(CONFIG_DOUBLEFAULT) += doublefault.o +obj-$(CONFIG_SERIAL_8250) += legacy_serial.o obj-$(CONFIG_VM86) += vm86.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_HPET_TIMER) += hpet.o diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c index e5cec6685cc5..d8cda14fff8b 100644 --- a/arch/i386/kernel/alternative.c +++ b/arch/i386/kernel/alternative.c @@ -390,8 +390,8 @@ void __init alternative_instructions(void) _text, _etext); } free_init_pages("SMP alternatives", - __pa_symbol(&__smp_locks), - __pa_symbol(&__smp_locks_end)); + (unsigned long)__smp_locks, + (unsigned long)__smp_locks_end); } else { alternatives_smp_module_add(NULL, "core kernel", __smp_locks, __smp_locks_end, diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index aca054cc0552..67824f3bb974 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -19,7 +19,6 @@ #include <linux/mm.h> #include <linux/delay.h> #include <linux/bootmem.h> -#include <linux/smp_lock.h> #include <linux/interrupt.h> #include <linux/mc146818rtc.h> #include <linux/kernel_stat.h> diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 367ff1d930cb..4112afe712b9 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -223,7 +223,6 @@ #include <linux/device.h> #include <linux/kernel.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/dmi.h> #include <linux/suspend.h> #include <linux/kthread.h> @@ -1173,7 +1172,7 @@ static void reinit_timer(void) unsigned long flags; spin_lock_irqsave(&i8253_lock, flags); - /* set the clock to 100 Hz */ + /* set the clock to HZ */ outb_p(0x34, PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */ udelay(10); outb_p(LATCH & 0xff, PIT_CH0); /* LSB */ diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c index a5e0e990ea95..53589d1b1a05 100644 --- a/arch/i386/kernel/crash.c +++ b/arch/i386/kernel/crash.c @@ -22,7 +22,7 @@ #include <asm/nmi.h> #include <asm/hw_irq.h> #include <asm/apic.h> -#include <asm/kdebug.h> +#include <linux/kdebug.h> #include <asm/smp.h> #include <mach_ipi.h> diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c index dd9e7faafa7c..a1808022ea19 100644 --- a/arch/i386/kernel/efi.c +++ b/arch/i386/kernel/efi.c @@ -347,14 +347,12 @@ void __init efi_init(void) printk(KERN_ERR PFX "Woah! Couldn't map the EFI system table.\n"); if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) printk(KERN_ERR PFX "Woah! EFI system table signature incorrect\n"); - if ((efi.systab->hdr.revision ^ EFI_SYSTEM_TABLE_REVISION) >> 16 != 0) - printk(KERN_ERR PFX - "Warning: EFI system table major version mismatch: " - "got %d.%02d, expected %d.%02d\n", + if ((efi.systab->hdr.revision >> 16) == 0) + printk(KERN_ERR PFX "Warning: EFI system table version " + "%d.%02d, expected 1.00 or greater\n", efi.systab->hdr.revision >> 16, - efi.systab->hdr.revision & 0xffff, - EFI_SYSTEM_TABLE_REVISION >> 16, - EFI_SYSTEM_TABLE_REVISION & 0xffff); + efi.systab->hdr.revision & 0xffff); + /* * Grab some details from the system table */ diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index 03abfdb1a6e4..0499cbe9871a 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c @@ -5,7 +5,6 @@ #include <linux/interrupt.h> #include <linux/slab.h> #include <linux/random.h> -#include <linux/smp_lock.h> #include <linux/init.h> #include <linux/kernel_stat.h> #include <linux/sysdev.h> diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 1b623cda3a64..7f8b7af2b95f 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -25,7 +25,6 @@ #include <linux/init.h> #include <linux/delay.h> #include <linux/sched.h> -#include <linux/smp_lock.h> #include <linux/mc146818rtc.h> #include <linux/compiler.h> #include <linux/acpi.h> diff --git a/arch/i386/kernel/ioport.c b/arch/i386/kernel/ioport.c index d1e42e0dbe67..3d310a946d76 100644 --- a/arch/i386/kernel/ioport.c +++ b/arch/i386/kernel/ioport.c @@ -12,7 +12,6 @@ #include <linux/types.h> #include <linux/ioport.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/stddef.h> #include <linux/slab.h> #include <linux/thread_info.h> diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c index b545bc746fce..dde828a333c3 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/i386/kernel/kprobes.c @@ -31,8 +31,8 @@ #include <linux/kprobes.h> #include <linux/ptrace.h> #include <linux/preempt.h> +#include <linux/kdebug.h> #include <asm/cacheflush.h> -#include <asm/kdebug.h> #include <asm/desc.h> #include <asm/uaccess.h> @@ -226,24 +226,15 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) } /* Called with kretprobe_lock held */ -void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, +void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs) { unsigned long *sara = (unsigned long *)®s->esp; - struct kretprobe_instance *ri; + ri->ret_addr = (kprobe_opcode_t *) *sara; - if ((ri = get_free_rp_inst(rp)) != NULL) { - ri->rp = rp; - ri->task = current; - ri->ret_addr = (kprobe_opcode_t *) *sara; - - /* Replace the return addr with trampoline addr */ - *sara = (unsigned long) &kretprobe_trampoline; - add_rp_inst(ri); - } else { - rp->nmissed++; - } + /* Replace the return addr with trampoline addr */ + *sara = (unsigned long) &kretprobe_trampoline; } /* @@ -449,8 +440,7 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs) break; } - BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address)); - + kretprobe_assert(ri, orig_ret_address, trampoline_address); spin_unlock_irqrestore(&kretprobe_lock, flags); hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { @@ -753,6 +743,11 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) return 0; } +int __kprobes arch_trampoline_kprobe(struct kprobe *p) +{ + return 0; +} + int __init arch_init_kprobes(void) { return 0; diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c index b410e5fb034f..e0b2d17f4f10 100644 --- a/arch/i386/kernel/ldt.c +++ b/arch/i386/kernel/ldt.c @@ -10,7 +10,6 @@ #include <linux/string.h> #include <linux/mm.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/vmalloc.h> #include <linux/slab.h> diff --git a/arch/i386/kernel/legacy_serial.c b/arch/i386/kernel/legacy_serial.c new file mode 100644 index 000000000000..21510118544e --- /dev/null +++ b/arch/i386/kernel/legacy_serial.c @@ -0,0 +1,67 @@ +/* + * Legacy COM port devices for x86 platforms without PNPBIOS or ACPI. + * Data taken from include/asm-i386/serial.h. + * + * (c) Copyright 2007 Hewlett-Packard Development Company, L.P. + * Bjorn Helgaas <bjorn.helgaas@hp.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include <linux/module.h> +#include <linux/init.h> +#include <linux/pnp.h> +#include <linux/serial_8250.h> + +/* Standard COM flags (except for COM4, because of the 8514 problem) */ +#ifdef CONFIG_SERIAL_DETECT_IRQ +#define COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ) +#define COM4_FLAGS (UPF_BOOT_AUTOCONF | UPF_AUTO_IRQ) +#else +#define COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST) +#define COM4_FLAGS UPF_BOOT_AUTOCONF +#endif + +#define PORT(_base,_irq,_flags) \ + { \ + .iobase = _base, \ + .irq = _irq, \ + .uartclk = 1843200, \ + .iotype = UPIO_PORT, \ + .flags = _flags, \ + } + +static struct plat_serial8250_port x86_com_data[] = { + PORT(0x3F8, 4, COM_FLAGS), + PORT(0x2F8, 3, COM_FLAGS), + PORT(0x3E8, 4, COM_FLAGS), + PORT(0x2E8, 3, COM4_FLAGS), + { }, +}; + +static struct platform_device x86_com_device = { + .name = "serial8250", + .id = PLAT8250_DEV_PLATFORM, + .dev = { + .platform_data = x86_com_data, + }, +}; + +static int force_legacy_probe; +module_param_named(force, force_legacy_probe, bool, 0); +MODULE_PARM_DESC(force, "Force legacy serial port probe"); + +static int __init serial8250_x86_com_init(void) +{ + if (pnp_platform_devices && !force_legacy_probe) + return -ENODEV; + + return platform_device_register(&x86_com_device); +} + +module_init(serial8250_x86_com_init); + +MODULE_AUTHOR("Bjorn Helgaas"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Generic 8250/16x50 legacy probe module"); diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c index 0952eccd8f28..13abb4ebfb79 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/i386/kernel/mpparse.c @@ -18,7 +18,6 @@ #include <linux/acpi.h> #include <linux/delay.h> #include <linux/bootmem.h> -#include <linux/smp_lock.h> #include <linux/kernel_stat.h> #include <linux/mc146818rtc.h> #include <linux/bitops.h> diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index bcaa6e9b6197..8cd0a91ce107 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c @@ -45,104 +45,6 @@ static struct class *msr_class; -static inline int wrmsr_eio(u32 reg, u32 eax, u32 edx) -{ - int err; - - err = wrmsr_safe(reg, eax, edx); - if (err) - err = -EIO; - return err; -} - -static inline int rdmsr_eio(u32 reg, u32 *eax, u32 *edx) -{ - int err; - - err = rdmsr_safe(reg, eax, edx); - if (err) - err = -EIO; - return err; -} - -#ifdef CONFIG_SMP - -struct msr_command { - int err; - u32 reg; - u32 data[2]; -}; - -static void msr_smp_wrmsr(void *cmd_block) -{ - struct msr_command *cmd = (struct msr_command *)cmd_block; - - cmd->err = wrmsr_eio(cmd->reg, cmd->data[0], cmd->data[1]); -} - -static void msr_smp_rdmsr(void *cmd_block) -{ - struct msr_command *cmd = (struct msr_command *)cmd_block; - - cmd->err = rdmsr_eio(cmd->reg, &cmd->data[0], &cmd->data[1]); -} - -static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) -{ - struct msr_command cmd; - int ret; - - preempt_disable(); - if (cpu == smp_processor_id()) { - ret = wrmsr_eio(reg, eax, edx); - } else { - cmd.reg = reg; - cmd.data[0] = eax; - cmd.data[1] = edx; - - smp_call_function_single(cpu, msr_smp_wrmsr, &cmd, 1, 1); - ret = cmd.err; - } - preempt_enable(); - return ret; -} - -static inline int do_rdmsr(int cpu, u32 reg, u32 * eax, u32 * edx) -{ - struct msr_command cmd; - int ret; - - preempt_disable(); - if (cpu == smp_processor_id()) { - ret = rdmsr_eio(reg, eax, edx); - } else { - cmd.reg = reg; - - smp_call_function_single(cpu, msr_smp_rdmsr, &cmd, 1, 1); - - *eax = cmd.data[0]; - *edx = cmd.data[1]; - - ret = cmd.err; - } - preempt_enable(); - return ret; -} - -#else /* ! CONFIG_SMP */ - -static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) -{ - return wrmsr_eio(reg, eax, edx); -} - -static inline int do_rdmsr(int cpu, u32 reg, u32 *eax, u32 *edx) -{ - return rdmsr_eio(reg, eax, edx); -} - -#endif /* ! CONFIG_SMP */ - static loff_t msr_seek(struct file *file, loff_t offset, int orig) { loff_t ret = -EINVAL; @@ -174,9 +76,9 @@ static ssize_t msr_read(struct file *file, char __user * buf, return -EINVAL; /* Invalid chunk size */ for (; count; count -= 8) { - err = do_rdmsr(cpu, reg, &data[0], &data[1]); + err = rdmsr_safe_on_cpu(cpu, reg, &data[0], &data[1]); if (err) - return err; + return -EIO; if (copy_to_user(tmp, &data, 8)) return -EFAULT; tmp += 2; @@ -200,9 +102,9 @@ static ssize_t msr_write(struct file *file, const char __user *buf, for (; count; count -= 8) { if (copy_from_user(&data, tmp, 8)) return -EFAULT; - err = do_wrmsr(cpu, reg, data[0], data[1]); + err = wrmsr_safe_on_cpu(cpu, reg, data[0], data[1]); if (err) - return err; + return -EIO; tmp += 2; } diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index 33cf2f3c444f..fba121f7973f 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c @@ -23,10 +23,10 @@ #include <linux/kprobes.h> #include <linux/cpumask.h> #include <linux/kernel_stat.h> +#include <linux/kdebug.h> #include <asm/smp.h> #include <asm/nmi.h> -#include <asm/kdebug.h> #include "mach_traps.h" diff --git a/arch/i386/kernel/pci-dma.c b/arch/i386/kernel/pci-dma.c index 3ebcea033623..30b754f7cbec 100644 --- a/arch/i386/kernel/pci-dma.c +++ b/arch/i386/kernel/pci-dma.c @@ -77,7 +77,7 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, { void __iomem *mem_base = NULL; int pages = size >> PAGE_SHIFT; - int bitmap_size = (pages + 31)/32; + int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0) goto out; diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 61999479b7a4..d76d9bc33b30 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c @@ -21,7 +21,6 @@ #include <linux/mm.h> #include <linux/elfcore.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/stddef.h> #include <linux/slab.h> #include <linux/vmalloc.h> diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c index 4a8f8a259723..0c0ceec5de00 100644 --- a/arch/i386/kernel/ptrace.c +++ b/arch/i386/kernel/ptrace.c @@ -9,7 +9,6 @@ #include <linux/sched.h> #include <linux/mm.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/errno.h> #include <linux/ptrace.h> #include <linux/user.h> diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c index 4f99e870c986..d574e38f0f77 100644 --- a/arch/i386/kernel/signal.c +++ b/arch/i386/kernel/signal.c @@ -10,7 +10,6 @@ #include <linux/sched.h> #include <linux/mm.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/kernel.h> #include <linux/signal.h> #include <linux/errno.h> diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index 89a45a9ddcd4..93f202a855fa 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -13,7 +13,6 @@ #include <linux/mm.h> #include <linux/delay.h> #include <linux/spinlock.h> -#include <linux/smp_lock.h> #include <linux/kernel_stat.h> #include <linux/mc146818rtc.h> #include <linux/cache.h> diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index a4b7ad283f49..b92cc4e8b3bb 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -40,7 +40,6 @@ #include <linux/mm.h> #include <linux/sched.h> #include <linux/kernel_stat.h> -#include <linux/smp_lock.h> #include <linux/bootmem.h> #include <linux/notifier.h> #include <linux/cpu.h> diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c index 4048397f1740..e5dcb9379018 100644 --- a/arch/i386/kernel/sys_i386.c +++ b/arch/i386/kernel/sys_i386.c @@ -10,7 +10,6 @@ #include <linux/sched.h> #include <linux/mm.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/sem.h> #include <linux/msg.h> #include <linux/shm.h> diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S index 2697e9210e92..0772678ceecf 100644 --- a/arch/i386/kernel/syscall_table.S +++ b/arch/i386/kernel/syscall_table.S @@ -319,3 +319,4 @@ ENTRY(sys_call_table) .long sys_move_pages .long sys_getcpu .long sys_epoll_pwait + .long sys_utimensat /* 320 */ diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index f21b41e7770c..4bec0cbf407a 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -52,7 +52,7 @@ #include <asm/unwind.h> #include <asm/smp.h> #include <asm/arch_hooks.h> -#include <asm/kdebug.h> +#include <linux/kdebug.h> #include <asm/stacktrace.h> #include <linux/module.h> @@ -95,20 +95,6 @@ asmlinkage void machine_check(void); int kstack_depth_to_print = 24; static unsigned int code_bytes = 64; -ATOMIC_NOTIFIER_HEAD(i386die_chain); - -int register_die_notifier(struct notifier_block *nb) -{ - vmalloc_sync_all(); - return atomic_notifier_chain_register(&i386die_chain, nb); -} -EXPORT_SYMBOL(register_die_notifier); /* used modular by kdb */ - -int unregister_die_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&i386die_chain, nb); -} -EXPORT_SYMBOL(unregister_die_notifier); /* used modular by kdb */ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) { @@ -747,6 +733,11 @@ static __kprobes void default_do_nmi(struct pt_regs * regs) */ if (nmi_watchdog_tick(regs, reason)) return; +#endif + if (notify_die(DIE_NMI_POST, "nmi_post", regs, reason, 2, 0) + == NOTIFY_STOP) + return; +#ifdef CONFIG_X86_LOCAL_APIC if (!do_nmi_callback(regs, smp_processor_id())) #endif unknown_nmi_error(reason, regs); diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c index d1b8f2b7aea6..f2dcd1d27c0a 100644 --- a/arch/i386/kernel/vm86.c +++ b/arch/i386/kernel/vm86.c @@ -39,7 +39,6 @@ #include <linux/string.h> #include <linux/mm.h> #include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/highmem.h> #include <linux/ptrace.h> #include <linux/audit.h> |