]> err.no Git - linux-2.6/commitdiff
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 22 Jul 2007 18:04:11 +0000 (11:04 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 22 Jul 2007 18:04:11 +0000 (11:04 -0700)
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (77 commits)
  ACPI: Populate /sys/firmware/acpi/tables/
  ACPI: create CONFIG_ACPI_DEBUG_FUNC_TRACE
  ACPI: update ACPI proc I/F removal schedule
  ACPI: update feature-removal-schedule.txt, /sys/firmware/acpi/namespace is gone
  ACPI: export ACPI events via acpi_mc_group multicast group
  ACPI: fix empty macros found by -Wextra
  ACPI: drivers/acpi/pci_link.c: lower printk severity
  sony-laptop: Fix event reading in sony-laptop
  sony-laptop: Add Vaio FE to the special init sequence
  sony-laptop: Make the driver use MSC_SCAN and a setkeycode and getkeycode key table.
  sony-laptop: Invoke _INI for SNC devices that provide it
  sony-laptop: Add support for recent Vaios Fn keys (C series for now)
  sony-laptop: map wireless switch events to KEY_WLAN
  sony-laptop: add new SNC handlers
  ACPI: thinkpad-acpi: add locking to brightness subdriver
  ACPI: thinkpad-acpi: bump up version to 0.15
  ACPI: thinkpad-acpi: make EC-based thermal readings non-experimental
  ACPI: thinkpad-acpi: make sure DSDT TMPx readings don't return +128
  ACPI: thinkpad-acpi: react to Lenovo ThinkPad differences in hot key
  ACPI: thinkpad-acpi: allow use of CMOS NVRAM for brightness control
  ...

52 files changed:
arch/i386/kernel/alternative.c
arch/i386/kernel/cpu/amd.c
arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
arch/i386/kernel/cpu/cyrix.c
arch/i386/kernel/cpu/mcheck/mce.c
arch/i386/kernel/cpu/mtrr/cyrix.c
arch/i386/kernel/cpu/mtrr/state.c
arch/i386/kernel/cpu/perfctr-watchdog.c
arch/i386/kernel/kprobes.c
arch/i386/kernel/nmi.c
arch/i386/kernel/paravirt.c
arch/i386/kernel/signal.c
arch/i386/kernel/smpboot.c
arch/i386/kernel/traps.c
arch/i386/mm/fault.c
arch/i386/mm/init.c
arch/powerpc/platforms/cell/spufs/file.c
arch/x86_64/boot/compressed/Makefile
arch/x86_64/kernel/head.S
arch/x86_64/kernel/hpet.c
arch/x86_64/kernel/kprobes.c
arch/x86_64/kernel/mce.c
arch/x86_64/kernel/nmi.c
arch/x86_64/kernel/process.c
arch/x86_64/kernel/setup.c
arch/x86_64/kernel/signal.c
arch/x86_64/kernel/suspend.c
arch/x86_64/kernel/traps.c
arch/x86_64/kernel/vmlinux.lds.S
arch/x86_64/mm/fault.c
arch/x86_64/mm/init.c
arch/x86_64/mm/pageattr.c
include/asm-i386/alternative.h
include/asm-i386/cmpxchg.h
include/asm-i386/mce.h
include/asm-i386/nmi.h
include/asm-i386/processor-cyrix.h [new file with mode: 0644]
include/asm-i386/processor.h
include/asm-x86_64/alternative.h
include/asm-x86_64/cmpxchg.h
include/asm-x86_64/hypertransport.h
include/asm-x86_64/mce.h
include/asm-x86_64/msidef.h
include/asm-x86_64/nmi.h
include/asm-x86_64/pgtable.h
include/asm-x86_64/processor.h
include/asm-x86_64/proto.h
include/asm-x86_64/system.h
include/linux/signal.h
kernel/signal.c
kernel/sysctl.c
mm/sparse.c

index 0695be538de53cb88f56e6d068feabbe733d16ae..c3750c2c41137a694be9570443f59b379cc4cc4d 100644 (file)
@@ -2,8 +2,14 @@
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
+#include <linux/kprobes.h>
+#include <linux/mm.h>
+#include <linux/vmalloc.h>
 #include <asm/alternative.h>
 #include <asm/sections.h>
+#include <asm/pgtable.h>
+#include <asm/mce.h>
+#include <asm/nmi.h>
 
 #ifdef CONFIG_HOTPLUG_CPU
 static int smp_alt_once;
@@ -150,7 +156,7 @@ static void nop_out(void *insns, unsigned int len)
                unsigned int noplen = len;
                if (noplen > ASM_NOP_MAX)
                        noplen = ASM_NOP_MAX;
-               memcpy(insns, noptable[noplen], noplen);
+               text_poke(insns, noptable[noplen], noplen);
                insns += noplen;
                len -= noplen;
        }
@@ -202,7 +208,7 @@ static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end)
                        continue;
                if (*ptr > text_end)
                        continue;
-               **ptr = 0xf0; /* lock prefix */
+               text_poke(*ptr, ((unsigned char []){0xf0}), 1); /* add lock prefix */
        };
 }
 
@@ -360,10 +366,6 @@ void apply_paravirt(struct paravirt_patch_site *start,
                /* Pad the rest with nops */
                nop_out(p->instr + used, p->len - used);
        }
-
-       /* Sync to be conservative, in case we patched following
-        * instructions */
-       sync_core();
 }
 extern struct paravirt_patch_site __start_parainstructions[],
        __stop_parainstructions[];
@@ -373,6 +375,14 @@ void __init alternative_instructions(void)
 {
        unsigned long flags;
 
+       /* The patching is not fully atomic, so try to avoid local interruptions
+          that might execute the to be patched code.
+          Other CPUs are not running. */
+       stop_nmi();
+#ifdef CONFIG_MCE
+       stop_mce();
+#endif
+
        local_irq_save(flags);
        apply_alternatives(__alt_instructions, __alt_instructions_end);
 
@@ -405,4 +415,37 @@ void __init alternative_instructions(void)
 #endif
        apply_paravirt(__parainstructions, __parainstructions_end);
        local_irq_restore(flags);
+
+       restart_nmi();
+#ifdef CONFIG_MCE
+       restart_mce();
+#endif
+}
+
+/*
+ * Warning:
+ * When you use this code to patch more than one byte of an instruction
+ * you need to make sure that other CPUs cannot execute this code in parallel.
+ * Also no thread must be currently preempted in the middle of these instructions.
+ * And on the local CPU you need to be protected again NMI or MCE handlers
+ * seeing an inconsistent instruction while you patch.
+ */
+void __kprobes text_poke(void *oaddr, unsigned char *opcode, int len)
+{
+        u8 *addr = oaddr;
+       if (!pte_write(*lookup_address((unsigned long)addr))) {
+               struct page *p[2] = { virt_to_page(addr), virt_to_page(addr+PAGE_SIZE) };
+               addr = vmap(p, 2, VM_MAP, PAGE_KERNEL);
+               if (!addr)
+                       return;
+               addr += ((unsigned long)oaddr) % PAGE_SIZE;
+       }
+       memcpy(addr, opcode, len);
+       sync_core();
+       /* Not strictly needed, but can speed CPU recovery up. Ignore cross cacheline
+          case. */
+       if (cpu_has_clflush)
+               asm("clflush (%0) " :: "r" (oaddr) : "memory");
+       if (addr != oaddr)
+               vunmap(addr);
 }
index 815a5f0aa47416530cdf61658fbd91458b92f5e4..c7ba455d5ac77d97747f1c13a4f5ac6737bfb48d 100644 (file)
@@ -231,6 +231,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 
        switch (c->x86) {
        case 15:
+       /* Use K8 tuning for Fam10h and Fam11h */
+       case 0x10:
+       case 0x11:
                set_bit(X86_FEATURE_K8, c->x86_capability);
                break;
        case 6:
index 194144539a6f34ccddd67e4e7f3393b68e5fecba..461dabc4e4959d23a7b5411d109b1a239a8c3872 100644 (file)
@@ -79,7 +79,7 @@
 #include <linux/smp.h>
 #include <linux/cpufreq.h>
 #include <linux/pci.h>
-#include <asm/processor.h>
+#include <asm/processor-cyrix.h>
 #include <asm/errno.h>
 
 /* PCI config registers, all at F0 */
index e88d2fba156b89d49ea24b9abba1d3b0cd41e5b4..122d2d75aa9f9bbce77211038240686ebf2dc7e8 100644 (file)
@@ -4,7 +4,7 @@
 #include <linux/pci.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <asm/processor.h>
+#include <asm/processor-cyrix.h>
 #include <asm/timer.h>
 #include <asm/pci-direct.h>
 #include <asm/tsc.h>
index 56cd485b127ce59b2da500e9f176b83bb755b7b7..34c781eddee4cdc6fce3419366b63329965655a5 100644 (file)
@@ -60,6 +60,20 @@ void mcheck_init(struct cpuinfo_x86 *c)
        }
 }
 
+static unsigned long old_cr4 __initdata;
+
+void __init stop_mce(void)
+{
+       old_cr4 = read_cr4();
+       clear_in_cr4(X86_CR4_MCE);
+}
+
+void __init restart_mce(void)
+{
+       if (old_cr4 & X86_CR4_MCE)
+               set_in_cr4(X86_CR4_MCE);
+}
+
 static int __init mcheck_disable(char *str)
 {
        mce_disabled = 1;
index 1001f1e0fe6d7dee0ae39147e054881fe5373736..2287d4863a8a01f7b060c39ffcebfe05dc33a94e 100644 (file)
@@ -3,6 +3,7 @@
 #include <asm/mtrr.h>
 #include <asm/msr.h>
 #include <asm/io.h>
+#include <asm/processor-cyrix.h>
 #include "mtrr.h"
 
 int arr3_protected;
index 7b39a2f954d9026c422862d522b5114ead35c242..c9014ca4a575d3bbd1766bf6a0873bd7e2953e1f 100644 (file)
@@ -3,6 +3,7 @@
 #include <asm/io.h>
 #include <asm/mtrr.h>
 #include <asm/msr.h>
+#include <asm-i386/processor-cyrix.h>
 #include "mtrr.h"
 
 
index 30b5e48aa76b84375fc408ce866305980d2eda22..4be488e73bee11760f9de2b9c8b8acd65e556a38 100644 (file)
@@ -325,7 +325,7 @@ static struct wd_ops k7_wd_ops = {
        .stop = single_msr_stop_watchdog,
        .perfctr = MSR_K7_PERFCTR0,
        .evntsel = MSR_K7_EVNTSEL0,
-       .checkbit = 1ULL<<63,
+       .checkbit = 1ULL<<47,
 };
 
 /* Intel Model 6 (PPro+,P2,P3,P-M,Core1) */
@@ -346,7 +346,9 @@ static int setup_p6_watchdog(unsigned nmi_hz)
        perfctr_msr = MSR_P6_PERFCTR0;
        evntsel_msr = MSR_P6_EVNTSEL0;
 
-       wrmsrl(perfctr_msr, 0UL);
+       /* KVM doesn't implement this MSR */
+       if (wrmsr_safe(perfctr_msr, 0, 0) < 0)
+               return 0;
 
        evntsel = P6_EVNTSEL_INT
                | P6_EVNTSEL_OS
index dde828a333c3e8355e49d0a3ed8d562b3071d4f9..448a50b1324c94636d1a2b71f672f901991eedc6 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/cacheflush.h>
 #include <asm/desc.h>
 #include <asm/uaccess.h>
+#include <asm/alternative.h>
 
 void jprobe_return_end(void);
 
@@ -169,16 +170,12 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
 
 void __kprobes arch_arm_kprobe(struct kprobe *p)
 {
-       *p->addr = BREAKPOINT_INSTRUCTION;
-       flush_icache_range((unsigned long) p->addr,
-                          (unsigned long) p->addr + sizeof(kprobe_opcode_t));
+       text_poke(p->addr, ((unsigned char []){BREAKPOINT_INSTRUCTION}), 1);
 }
 
 void __kprobes arch_disarm_kprobe(struct kprobe *p)
 {
-       *p->addr = p->opcode;
-       flush_icache_range((unsigned long) p->addr,
-                          (unsigned long) p->addr + sizeof(kprobe_opcode_t));
+       text_poke(p->addr, &p->opcode, 1);
 }
 
 void __kprobes arch_remove_kprobe(struct kprobe *p)
index 03b7f5584d713b60216c25d5ad73df7dbf363e39..99beac7f96ceb4df737c9c02c304ba9d9999710f 100644 (file)
@@ -353,7 +353,7 @@ __kprobes int nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
         * Take the local apic timer and PIT/HPET into account. We don't
         * know which one is active, when we have highres/dyntick on
         */
-       sum = per_cpu(irq_stat, cpu).apic_timer_irqs + kstat_irqs(0);
+       sum = per_cpu(irq_stat, cpu).apic_timer_irqs + kstat_cpu(cpu).irqs[0];
 
        /* if the none of the timers isn't firing, this cpu isn't doing much */
        if (!touched && last_irq_sums[cpu] == sum) {
index 53f07a8275e3a9b39ba4581e8f8a03bb75e336ce..79c167fcaee9d97558c173bde5647bdd83445ebb 100644 (file)
@@ -124,20 +124,28 @@ unsigned paravirt_patch_ignore(unsigned len)
        return len;
 }
 
+struct branch {
+       unsigned char opcode;
+       u32 delta;
+} __attribute__((packed));
+
 unsigned paravirt_patch_call(void *target, u16 tgt_clobbers,
                             void *site, u16 site_clobbers,
                             unsigned len)
 {
        unsigned char *call = site;
        unsigned long delta = (unsigned long)target - (unsigned long)(call+5);
+       struct branch b;
 
        if (tgt_clobbers & ~site_clobbers)
                return len;     /* target would clobber too much for this site */
        if (len < 5)
                return len;     /* call too long for patch site */
 
-       *call++ = 0xe8;         /* call */
-       *(unsigned long *)call = delta;
+       b.opcode = 0xe8; /* call */
+       b.delta = delta;
+       BUILD_BUG_ON(sizeof(b) != 5);
+       text_poke(call, (unsigned char *)&b, 5);
 
        return 5;
 }
@@ -150,8 +158,9 @@ unsigned paravirt_patch_jmp(void *target, void *site, unsigned len)
        if (len < 5)
                return len;     /* call too long for patch site */
 
-       *jmp++ = 0xe9;          /* jmp */
-       *(unsigned long *)jmp = delta;
+       b.opcode = 0xe9;        /* jmp */
+       b.delta = delta;
+       text_poke(call, (unsigned char *)&b, 5);
 
        return 5;
 }
index d574e38f0f774e67896ad8cfbd8420faca9f9ec9..f5dd85656c1890eb93f8d25fc68fb2d97132e917 100644 (file)
@@ -199,6 +199,13 @@ asmlinkage int sys_sigreturn(unsigned long __unused)
        return eax;
 
 badframe:
+       if (show_unhandled_signals && printk_ratelimit())
+               printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx"
+                      " esp:%lx oeax:%lx\n",
+                   current->pid > 1 ? KERN_INFO : KERN_EMERG,
+                   current->comm, current->pid, frame, regs->eip,
+                   regs->esp, regs->orig_eax);
+
        force_sig(SIGSEGV, current);
        return 0;
 }      
index 5910d3fac561d5f33d26df53f63fad2ac0c8d2fe..e4f61d1c6248d8116810e122651f3fb109b5b78e 100644 (file)
@@ -308,7 +308,7 @@ cpumask_t cpu_coregroup_map(int cpu)
 /* representing cpus for which sibling maps can be computed */
 static cpumask_t cpu_sibling_setup_map;
 
-void set_cpu_sibling_map(int cpu)
+void __cpuinit set_cpu_sibling_map(int cpu)
 {
        int i;
        struct cpuinfo_x86 *c = cpu_data;
index 57772a18c39470061cdfcec35467cacb54948825..cfffe3dd9e838315089c9461a49b0fa2b6aef12b 100644 (file)
@@ -618,6 +618,13 @@ fastcall void __kprobes do_general_protection(struct pt_regs * regs,
 
        current->thread.error_code = error_code;
        current->thread.trap_no = 13;
+       if (show_unhandled_signals && unhandled_signal(current, SIGSEGV) &&
+           printk_ratelimit())
+               printk(KERN_INFO
+                   "%s[%d] general protection eip:%lx esp:%lx error:%lx\n",
+                   current->comm, current->pid,
+                   regs->eip, regs->esp, error_code);
+
        force_sig(SIGSEGV, current);
        return;
 
@@ -768,6 +775,8 @@ static __kprobes void default_do_nmi(struct pt_regs * regs)
        reassert_nmi();
 }
 
+static int ignore_nmis;
+
 fastcall __kprobes void do_nmi(struct pt_regs * regs, long error_code)
 {
        int cpu;
@@ -778,11 +787,24 @@ fastcall __kprobes void do_nmi(struct pt_regs * regs, long error_code)
 
        ++nmi_count(cpu);
 
-       default_do_nmi(regs);
+       if (!ignore_nmis)
+               default_do_nmi(regs);
 
        nmi_exit();
 }
 
+void stop_nmi(void)
+{
+       acpi_nmi_disable();
+       ignore_nmis++;
+}
+
+void restart_nmi(void)
+{
+       ignore_nmis--;
+       acpi_nmi_enable();
+}
+
 #ifdef CONFIG_KPROBES
 fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code)
 {
index e92a10124935c006a22a55775b0aee755b2b08c3..01ffdd4964f08e9bec86c5ae759da9f5cbe8270a 100644 (file)
@@ -283,6 +283,8 @@ static inline int vmalloc_fault(unsigned long address)
        return 0;
 }
 
+int show_unhandled_signals = 1;
+
 /*
  * This routine handles page faults.  It determines the address,
  * and the problem, and then passes it off to one of the appropriate
@@ -469,6 +471,14 @@ bad_area_nosemaphore:
                if (is_prefetch(regs, address, error_code))
                        return;
 
+               if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
+                   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,
+                           regs->esp, error_code);
+               }
                tsk->thread.cr2 = address;
                /* Kernel addresses are always protection faults */
                tsk->thread.error_code = error_code | (address >= TASK_SIZE);
index e1a9a805c445c58573e5e77dd1be682d52d9b5ee..c3b9905af2d5024b71451e796c052a2ad1813718 100644 (file)
@@ -800,17 +800,9 @@ void mark_rodata_ro(void)
        unsigned long start = PFN_ALIGN(_text);
        unsigned long size = PFN_ALIGN(_etext) - start;
 
-#ifndef CONFIG_KPROBES
-#ifdef CONFIG_HOTPLUG_CPU
-       /* It must still be possible to apply SMP alternatives. */
-       if (num_possible_cpus() <= 1)
-#endif
-       {
-               change_page_attr(virt_to_page(start),
-                                size >> PAGE_SHIFT, PAGE_KERNEL_RX);
-               printk("Write protecting the kernel text: %luk\n", size >> 10);
-       }
-#endif
+       change_page_attr(virt_to_page(start),
+                        size >> PAGE_SHIFT, PAGE_KERNEL_RX);
+       printk("Write protecting the kernel text: %luk\n", size >> 10);
        start += size;
        size = (unsigned long)__end_rodata - start;
        change_page_attr(virt_to_page(start),
index c2aaec5289dc2ce042333260bd81ff2974d7d75a..4100ddc52f0227fb0fcb300fb50da78bffa9b9d3 100644 (file)
@@ -941,13 +941,6 @@ static const struct file_operations spufs_signal1_nosched_fops = {
        .mmap = spufs_signal1_mmap,
 };
 
-static const struct file_operations spufs_signal1_nosched_fops = {
-       .open = spufs_signal1_open,
-       .release = spufs_signal1_release,
-       .write = spufs_signal1_write,
-       .mmap = spufs_signal1_mmap,
-};
-
 static int spufs_signal2_open(struct inode *inode, struct file *file)
 {
        struct spufs_inode_info *i = SPUFS_I(inode);
@@ -1083,13 +1076,6 @@ static const struct file_operations spufs_signal2_nosched_fops = {
        .mmap = spufs_signal2_mmap,
 };
 
-static const struct file_operations spufs_signal2_nosched_fops = {
-       .open = spufs_signal2_open,
-       .release = spufs_signal2_release,
-       .write = spufs_signal2_write,
-       .mmap = spufs_signal2_mmap,
-};
-
 static void spufs_signal1_type_set(void *data, u64 val)
 {
        struct spu_context *ctx = data;
index c9f2da7496c14d738b0c8453dd835dd70db9cf96..877c0bdbbc67006473a1ca9754721f186910bf61 100644 (file)
@@ -3,8 +3,6 @@
 #
 # create a compressed vmlinux image from the original vmlinux
 #
-# Note all the files here are compiled/linked as 32bit executables.
-#
 
 targets                := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
 
index 941c84baecc8da3fc4496d912216760a083e034a..e89abcdbdde8172e25d6dff0ddb8323471495c66 100644 (file)
@@ -25,7 +25,7 @@
  */
 
        .text
-       .section .bootstrap.text
+       .section .text.head
        .code64
        .globl startup_64
 startup_64:
@@ -243,10 +243,16 @@ ENTRY(secondary_startup_64)
        lretq
 
        /* SMP bootup changes these two */
+#ifndef CONFIG_HOTPLUG_CPU
+       .pushsection .init.data
+#endif
        .align  8
        .globl  initial_code
 initial_code:
        .quad   x86_64_start_kernel
+#ifndef CONFIG_HOTPLUG_CPU
+       .popsection
+#endif
        .globl init_rsp
 init_rsp:
        .quad  init_thread_union+THREAD_SIZE-8
index 636f4f9fc6bb185b8e77300662e006b7b72a37d3..e2d1b912e15469c1110553fa3ebc27c97fc3af9e 100644 (file)
@@ -133,7 +133,7 @@ struct clocksource clocksource_hpet = {
        .vread          = vread_hpet,
 };
 
-int hpet_arch_init(void)
+int __init hpet_arch_init(void)
 {
        unsigned int id;
        u64 tmp;
index d4a0d0ac99351a8fd1b67ca9f65fa6aa01861b9b..a30e004682e2dc60fe81a7e1caf007fbbcf314a7 100644 (file)
@@ -39,9 +39,9 @@
 #include <linux/module.h>
 #include <linux/kdebug.h>
 
-#include <asm/cacheflush.h>
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
+#include <asm/alternative.h>
 
 void jprobe_return_end(void);
 static void __kprobes arch_copy_kprobe(struct kprobe *p);
@@ -209,16 +209,12 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
 
 void __kprobes arch_arm_kprobe(struct kprobe *p)
 {
-       *p->addr = BREAKPOINT_INSTRUCTION;
-       flush_icache_range((unsigned long) p->addr,
-                          (unsigned long) p->addr + sizeof(kprobe_opcode_t));
+       text_poke(p->addr, ((unsigned char []){BREAKPOINT_INSTRUCTION}), 1);
 }
 
 void __kprobes arch_disarm_kprobe(struct kprobe *p)
 {
-       *p->addr = p->opcode;
-       flush_icache_range((unsigned long) p->addr,
-                          (unsigned long) p->addr + sizeof(kprobe_opcode_t));
+       text_poke(p->addr, &p->opcode, 1);
 }
 
 void __kprobes arch_remove_kprobe(struct kprobe *p)
index 4d8450ee3635e8ee587f5f639f7862b5a5155a74..a66d607f5b924e09d864120d1d656c3e1a1c2da0 100644 (file)
@@ -667,6 +667,20 @@ static struct miscdevice mce_log_device = {
        &mce_chrdev_ops,
 };
 
+static unsigned long old_cr4 __initdata;
+
+void __init stop_mce(void)
+{
+       old_cr4 = read_cr4();
+       clear_in_cr4(X86_CR4_MCE);
+}
+
+void __init restart_mce(void)
+{
+       if (old_cr4 & X86_CR4_MCE)
+               set_in_cr4(X86_CR4_MCE);
+}
+
 /* 
  * Old style boot options parsing. Only for compatibility. 
  */
index edbbc59b752334d570cb939c70ece3f43ca8ae42..cb8ee9d02f8682d4e52374aae1847a4daf03292a 100644 (file)
@@ -384,11 +384,14 @@ int __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
        return rc;
 }
 
+static unsigned ignore_nmis;
+
 asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code)
 {
        nmi_enter();
        add_pda(__nmi_count,1);
-       default_do_nmi(regs);
+       if (!ignore_nmis)
+               default_do_nmi(regs);
        nmi_exit();
 }
 
@@ -401,6 +404,18 @@ int do_nmi_callback(struct pt_regs * regs, int cpu)
        return 0;
 }
 
+void stop_nmi(void)
+{
+       acpi_nmi_disable();
+       ignore_nmis++;
+}
+
+void restart_nmi(void)
+{
+       ignore_nmis--;
+       acpi_nmi_enable();
+}
+
 #ifdef CONFIG_SYSCTL
 
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
index 92fade4a62cfb8aad73678fe2665830d5b87d280..e7ac629d4c4654ec97ddc387fc5ba71c0892e92a 100644 (file)
@@ -342,10 +342,10 @@ void __show_regs(struct pt_regs * regs)
        rdmsrl(MSR_GS_BASE, gs); 
        rdmsrl(MSR_KERNEL_GS_BASE, shadowgs); 
 
-       asm("movq %%cr0, %0": "=r" (cr0));
-       asm("movq %%cr2, %0": "=r" (cr2));
-       asm("movq %%cr3, %0": "=r" (cr3));
-       asm("movq %%cr4, %0": "=r" (cr4));
+       cr0 = read_cr0();
+       cr2 = read_cr2();
+       cr3 = read_cr3();
+       cr4 = read_cr4();
 
        printk("FS:  %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", 
               fs,fsindex,gs,gsindex,shadowgs); 
index 6fa0a302e2aa9b121daa487220b27efdbd88f570..af838f6b0b7fc9b7e3ed4de0ab12992e48cf9f18 100644 (file)
@@ -608,6 +608,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
        else
                num_cache_leaves = 3;
 
+       if (c->x86 == 0xf || c->x86 == 0x10 || c->x86 == 0x11)
+               set_bit(X86_FEATURE_K8, &c->x86_capability);
+
        /* RDTSC can be speculated around */
        clear_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
 
index 4886afcd628746c2f78b0516754de3e47eadad50..739175b01e06ee9553760729c5b8e6dbd6bf89cb 100644 (file)
@@ -487,7 +487,7 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
 void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
 { 
        struct task_struct *me = current; 
-       if (exception_trace)
+       if (show_unhandled_signals && printk_ratelimit())
                printk("%s[%d] bad frame in %s frame:%p rip:%lx rsp:%lx orax:%lx\n",
               me->comm,me->pid,where,frame,regs->rip,regs->rsp,regs->orig_rax); 
 
index 6a5a98f2a75c5aac97d543f116db736182b6e73c..ea83a9f91965d3217d1f9346fefa45679f69d62a 100644 (file)
@@ -55,11 +55,11 @@ void __save_processor_state(struct saved_context *ctxt)
         * control registers 
         */
        rdmsrl(MSR_EFER, ctxt->efer);
-       asm volatile ("movq %%cr0, %0" : "=r" (ctxt->cr0));
-       asm volatile ("movq %%cr2, %0" : "=r" (ctxt->cr2));
-       asm volatile ("movq %%cr3, %0" : "=r" (ctxt->cr3));
-       asm volatile ("movq %%cr4, %0" : "=r" (ctxt->cr4));
-       asm volatile ("movq %%cr8, %0" : "=r" (ctxt->cr8));
+       ctxt->cr0 = read_cr0();
+       ctxt->cr2 = read_cr2();
+       ctxt->cr3 = read_cr3();
+       ctxt->cr4 = read_cr4();
+       ctxt->cr8 = read_cr8();
 }
 
 void save_processor_state(void)
@@ -81,11 +81,11 @@ void __restore_processor_state(struct saved_context *ctxt)
         * control registers
         */
        wrmsrl(MSR_EFER, ctxt->efer);
-       asm volatile ("movq %0, %%cr8" :: "r" (ctxt->cr8));
-       asm volatile ("movq %0, %%cr4" :: "r" (ctxt->cr4));
-       asm volatile ("movq %0, %%cr3" :: "r" (ctxt->cr3));
-       asm volatile ("movq %0, %%cr2" :: "r" (ctxt->cr2));
-       asm volatile ("movq %0, %%cr0" :: "r" (ctxt->cr0));
+       write_cr8(ctxt->cr8);
+       write_cr4(ctxt->cr4);
+       write_cr3(ctxt->cr3);
+       write_cr2(ctxt->cr2);
+       write_cr0(ctxt->cr0);
 
        /*
         * now restore the descriptor tables to their proper values
index 8713ad4a4db14ca350a00a5eee55a9cc365a7373..03888420775d03320f0cea3c40989e100fea3e7c 100644 (file)
@@ -584,7 +584,8 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
                tsk->thread.error_code = error_code;
                tsk->thread.trap_no = trapnr;
 
-               if (exception_trace && unhandled_signal(tsk, signr))
+               if (show_unhandled_signals && unhandled_signal(tsk, signr) &&
+                   printk_ratelimit())
                        printk(KERN_INFO
                               "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
                               tsk->comm, tsk->pid, str,
@@ -688,7 +689,8 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
                tsk->thread.error_code = error_code;
                tsk->thread.trap_no = 13;
 
-               if (exception_trace && unhandled_signal(tsk, SIGSEGV))
+               if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
+                   printk_ratelimit())
                        printk(KERN_INFO
                       "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
                               tsk->comm, tsk->pid,
index e7a5eb6cd785a50e914566291d104ef47146754c..ba8ea97abd219359d6e7c68541e375dbe97f5c7a 100644 (file)
@@ -28,7 +28,7 @@ SECTIONS
   _text = .;                   /* Text and read-only data */
   .text :  AT(ADDR(.text) - LOAD_OFFSET) {
        /* First the code that has to be first for bootstrapping */
-       *(.bootstrap.text)
+       *(.text.head)
        _stext = .;
        /* Then the rest */
        TEXT_TEXT
index 2074bddd4f04eea21a6dd9d6a8b848bf95a22be2..327c9f2fa6269f3020f94f856cd8e0b8b36ab494 100644 (file)
@@ -159,7 +159,7 @@ void dump_pagetable(unsigned long address)
        pmd_t *pmd;
        pte_t *pte;
 
-       asm("movq %%cr3,%0" : "=r" (pgd));
+       pgd = (pgd_t *)read_cr3();
 
        pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK); 
        pgd += pgd_index(address);
@@ -221,16 +221,6 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
        return 0;
 } 
 
-int unhandled_signal(struct task_struct *tsk, int sig)
-{
-       if (is_init(tsk))
-               return 1;
-       if (tsk->ptrace & PT_PTRACED)
-               return 0;
-       return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
-               (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
-}
-
 static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs,
                                 unsigned long error_code)
 {
@@ -302,7 +292,7 @@ static int vmalloc_fault(unsigned long address)
 }
 
 static int page_fault_trace;
-int exception_trace = 1;
+int show_unhandled_signals = 1;
 
 /*
  * This routine handles page faults.  It determines the address,
@@ -326,7 +316,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
        prefetchw(&mm->mmap_sem);
 
        /* get the address */
-       __asm__("movq %%cr2,%0":"=r" (address));
+       address = read_cr2();
 
        info.si_code = SEGV_MAPERR;
 
@@ -494,7 +484,8 @@ bad_area_nosemaphore:
                    (address >> 32))
                        return;
 
-               if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
+               if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
+                   printk_ratelimit()) {
                        printk(
                       "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
                                        tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
index 381c2ecd407e3b08137b2f1d7cb4ac6afa1d62ce..38f5d63680060769a58b7ac607f9085b6acf19d3 100644 (file)
@@ -383,7 +383,7 @@ void __meminit init_memory_mapping(unsigned long start, unsigned long end)
        } 
 
        if (!after_bootmem)
-               asm volatile("movq %%cr4,%0" : "=r" (mmu_cr4_features));
+               mmu_cr4_features = read_cr4();
        __flush_tlb_all();
 }
 
@@ -600,16 +600,6 @@ void mark_rodata_ro(void)
 {
        unsigned long start = (unsigned long)_stext, end;
 
-#ifdef CONFIG_HOTPLUG_CPU
-       /* It must still be possible to apply SMP alternatives. */
-       if (num_possible_cpus() > 1)
-               start = (unsigned long)_etext;
-#endif
-
-#ifdef CONFIG_KPROBES
-       start = (unsigned long)__start_rodata;
-#endif
-       
        end = (unsigned long)__end_rodata;
        start = (start + PAGE_SIZE - 1) & PAGE_MASK;
        end &= PAGE_MASK;
@@ -697,39 +687,6 @@ int kern_addr_valid(unsigned long addr)
        return pfn_valid(pte_pfn(*pte));
 }
 
-#ifdef CONFIG_SYSCTL
-#include <linux/sysctl.h>
-
-static ctl_table debug_table2[] = {
-       {
-               .ctl_name       = 99,
-               .procname       = "exception-trace",
-               .data           = &exception_trace,
-               .maxlen         = sizeof(int),
-               .mode           = 0644,
-               .proc_handler   = proc_dointvec
-       },
-       {}
-}; 
-
-static ctl_table debug_root_table2[] = { 
-       {
-               .ctl_name = CTL_DEBUG,
-               .procname = "debug",
-               .mode = 0555,
-               .child = debug_table2
-       },
-       {}
-}; 
-
-static __init int x8664_sysctl_init(void)
-{ 
-       register_sysctl_table(debug_root_table2);
-       return 0;
-}
-__initcall(x8664_sysctl_init);
-#endif
-
 /* A pseudo VMA to allow ptrace access for the vsyscall page.  This only
    covers the 64bit vsyscall page now. 32bit has a real VMA now and does
    not need special handling anymore. */
@@ -767,7 +724,7 @@ int in_gate_area_no_task(unsigned long addr)
        return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
 }
 
-void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
+void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
 {
        return __alloc_bootmem_core(pgdat->bdata, size,
                        SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
index 36377b6b8efe9af1039104b753665edf96a80821..7e161c698af47cb98a766c8253c8596cfeeb4b74 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/tlbflush.h>
 #include <asm/io.h>
 
-static inline pte_t *lookup_address(unsigned long address) 
+pte_t *lookup_address(unsigned long address)
 { 
        pgd_t *pgd = pgd_offset_k(address);
        pud_t *pud;
index eb7da5402bfaa17623bb523bed36c171adc0c776..bda6c810c0f4e3ac48973f3af52fdd478862f05b 100644 (file)
@@ -149,4 +149,6 @@ apply_paravirt(struct paravirt_patch_site *start,
 #define __parainstructions_end NULL
 #endif
 
+extern void text_poke(void *addr, unsigned char *opcode, int len);
+
 #endif /* _I386_ALTERNATIVE_H */
index 64dcdf46117bf2c1dbaeba8e88fa36912fab67c2..f86ede28f6dc84750ab60250cc7d122534d9c74a 100644 (file)
@@ -34,7 +34,7 @@ static inline void __set_64bit (unsigned long long * ptr,
                "\n1:\t"
                "movl (%0), %%eax\n\t"
                "movl 4(%0), %%edx\n\t"
-               "lock cmpxchg8b (%0)\n\t"
+               LOCK_PREFIX "cmpxchg8b (%0)\n\t"
                "jnz 1b"
                : /* no outputs */
                :       "D"(ptr),
index b0a02ee34ffd74720747c295077720e86604933c..d56d89742e8fdcd0bfd96ccd1ff83292eea0bc99 100644 (file)
@@ -5,3 +5,7 @@ extern void mcheck_init(struct cpuinfo_x86 *c);
 #endif
 
 extern int mce_disabled;
+
+extern void stop_mce(void);
+extern void restart_mce(void);
+
index fb1e133efd9fecdc182d827ddd8c75841b8c6660..ff30c98f87b023290c8d1355f3873540e7d6c2ae 100644 (file)
@@ -57,5 +57,7 @@ unsigned lapic_adjust_nmi_hz(unsigned hz);
 int lapic_watchdog_ok(void);
 void disable_lapic_nmi_watchdog(void);
 void enable_lapic_nmi_watchdog(void);
+void stop_nmi(void);
+void restart_nmi(void);
 
 #endif /* ASM_NMI_H */
diff --git a/include/asm-i386/processor-cyrix.h b/include/asm-i386/processor-cyrix.h
new file mode 100644 (file)
index 0000000..97568ad
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * NSC/Cyrix CPU indexed register access. Must be inlined instead of
+ * macros to ensure correct access ordering
+ * Access order is always 0x22 (=offset), 0x23 (=value)
+ *
+ * When using the old macros a line like
+ *   setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
+ * gets expanded to:
+ *  do {
+ *    outb((CX86_CCR2), 0x22);
+ *    outb((({
+ *        outb((CX86_CCR2), 0x22);
+ *        inb(0x23);
+ *    }) | 0x88), 0x23);
+ *  } while (0);
+ *
+ * which in fact violates the access order (= 0x22, 0x22, 0x23, 0x23).
+ */
+
+static inline u8 getCx86(u8 reg)
+{
+       outb(reg, 0x22);
+       return inb(0x23);
+}
+
+static inline void setCx86(u8 reg, u8 data)
+{
+       outb(reg, 0x22);
+       outb(data, 0x23);
+}
index 48a7f69bb767a650c72000f9bad8b25ea7612dfb..3845fe72383e518d89075695c2eec4dd0a9f277c 100644 (file)
@@ -168,17 +168,6 @@ static inline void clear_in_cr4 (unsigned long mask)
        write_cr4(cr4);
 }
 
-/*
- *      NSC/Cyrix CPU indexed register access macros
- */
-
-#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
-
-#define setCx86(reg, data) do { \
-       outb((reg), 0x22); \
-       outb((data), 0x23); \
-} while (0)
-
 /* Stop speculative execution */
 static inline void sync_core(void)
 {
index eea7aecfac787cef93d9ae09b66745cb313dda06..ab161e810151aa2fbe9bed5f08fef5194b0f28c2 100644 (file)
@@ -154,4 +154,6 @@ apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end)
 #define __parainstructions_end NULL
 #endif
 
+extern void text_poke(void *addr, unsigned char *opcode, int len);
+
 #endif /* _X86_64_ALTERNATIVE_H */
index 09a6b6b6b74dac10a753cf605acd87949d8c3eb9..5e182062e6ec98ca49e75729cb93a29e3c1622b4 100644 (file)
@@ -128,7 +128,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
        ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
                                        (unsigned long)(n),sizeof(*(ptr))))
 #define cmpxchg_local(ptr,o,n)\
-       ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
+       ((__typeof__(*(ptr)))__cmpxchg_local((ptr),(unsigned long)(o),\
                                        (unsigned long)(n),sizeof(*(ptr))))
 
 #endif
index c16c6ff4bdd739f79a96d4c1e1ee46fcc7441509..5cbf9fa5e0b5e26c675f5bce99003dc470f1a704 100644 (file)
@@ -1,42 +1 @@
-#ifndef ASM_HYPERTRANSPORT_H
-#define ASM_HYPERTRANSPORT_H
-
-/*
- * Constants for x86 Hypertransport Interrupts.
- */
-
-#define HT_IRQ_LOW_BASE                        0xf8000000
-
-#define HT_IRQ_LOW_VECTOR_SHIFT                16
-#define  HT_IRQ_LOW_VECTOR_MASK                0x00ff0000
-#define  HT_IRQ_LOW_VECTOR(v)          (((v) << HT_IRQ_LOW_VECTOR_SHIFT) & HT_IRQ_LOW_VECTOR_MASK)
-
-#define HT_IRQ_LOW_DEST_ID_SHIFT       8
-#define  HT_IRQ_LOW_DEST_ID_MASK       0x0000ff00
-#define  HT_IRQ_LOW_DEST_ID(v)         (((v) << HT_IRQ_LOW_DEST_ID_SHIFT) & HT_IRQ_LOW_DEST_ID_MASK)
-
-#define HT_IRQ_LOW_DM_PHYSICAL         0x0000000
-#define HT_IRQ_LOW_DM_LOGICAL          0x0000040
-
-#define HT_IRQ_LOW_RQEOI_EDGE          0x0000000
-#define HT_IRQ_LOW_RQEOI_LEVEL         0x0000020
-
-
-#define HT_IRQ_LOW_MT_FIXED            0x0000000
-#define HT_IRQ_LOW_MT_ARBITRATED       0x0000004
-#define HT_IRQ_LOW_MT_SMI              0x0000008
-#define HT_IRQ_LOW_MT_NMI              0x000000c
-#define HT_IRQ_LOW_MT_INIT             0x0000010
-#define HT_IRQ_LOW_MT_STARTUP          0x0000014
-#define HT_IRQ_LOW_MT_EXTINT           0x0000018
-#define HT_IRQ_LOW_MT_LINT1            0x000008c
-#define HT_IRQ_LOW_MT_LINT0            0x0000098
-
-#define HT_IRQ_LOW_IRQ_MASKED          0x0000001
-
-
-#define HT_IRQ_HIGH_DEST_ID_SHIFT      0
-#define  HT_IRQ_HIGH_DEST_ID_MASK      0x00ffffff
-#define  HT_IRQ_HIGH_DEST_ID(v)                ((((v) >> 8) << HT_IRQ_HIGH_DEST_ID_SHIFT) & HT_IRQ_HIGH_DEST_ID_MASK)
-
-#endif /* ASM_HYPERTRANSPORT_H */
+#include <asm-i386/hypertransport.h>
index 556be5563e308f2d80e7e67f65b4ab19b67b3b49..7bc030a1996de9c2ad53763eac202643e459a54b 100644 (file)
@@ -107,6 +107,9 @@ extern void do_machine_check(struct pt_regs *, long);
 
 extern int mce_notify_user(void);
 
+extern void stop_mce(void);
+extern void restart_mce(void);
+
 #endif
 
 #endif
index 5b8acddb70fba262cac24bd6d27c88c9c8266717..083ad5827e482f170480f6821b2090eaba117289 100644 (file)
@@ -1,47 +1 @@
-#ifndef ASM_MSIDEF_H
-#define ASM_MSIDEF_H
-
-/*
- * Constants for Intel APIC based MSI messages.
- */
-
-/*
- * Shifts for MSI data
- */
-
-#define MSI_DATA_VECTOR_SHIFT          0
-#define  MSI_DATA_VECTOR_MASK          0x000000ff
-#define         MSI_DATA_VECTOR(v)             (((v) << MSI_DATA_VECTOR_SHIFT) & MSI_DATA_VECTOR_MASK)
-
-#define MSI_DATA_DELIVERY_MODE_SHIFT   8
-#define  MSI_DATA_DELIVERY_FIXED       (0 << MSI_DATA_DELIVERY_MODE_SHIFT)
-#define  MSI_DATA_DELIVERY_LOWPRI      (1 << MSI_DATA_DELIVERY_MODE_SHIFT)
-
-#define MSI_DATA_LEVEL_SHIFT           14
-#define         MSI_DATA_LEVEL_DEASSERT        (0 << MSI_DATA_LEVEL_SHIFT)
-#define         MSI_DATA_LEVEL_ASSERT          (1 << MSI_DATA_LEVEL_SHIFT)
-
-#define MSI_DATA_TRIGGER_SHIFT         15
-#define  MSI_DATA_TRIGGER_EDGE         (0 << MSI_DATA_TRIGGER_SHIFT)
-#define  MSI_DATA_TRIGGER_LEVEL                (1 << MSI_DATA_TRIGGER_SHIFT)
-
-/*
- * Shift/mask fields for msi address
- */
-
-#define MSI_ADDR_BASE_HI               0
-#define MSI_ADDR_BASE_LO               0xfee00000
-
-#define MSI_ADDR_DEST_MODE_SHIFT       2
-#define  MSI_ADDR_DEST_MODE_PHYSICAL   (0 << MSI_ADDR_DEST_MODE_SHIFT)
-#define         MSI_ADDR_DEST_MODE_LOGICAL     (1 << MSI_ADDR_DEST_MODE_SHIFT)
-
-#define MSI_ADDR_REDIRECTION_SHIFT     3
-#define  MSI_ADDR_REDIRECTION_CPU      (0 << MSI_ADDR_REDIRECTION_SHIFT) /* dedicated cpu */
-#define  MSI_ADDR_REDIRECTION_LOWPRI   (1 << MSI_ADDR_REDIRECTION_SHIFT) /* lowest priority */
-
-#define MSI_ADDR_DEST_ID_SHIFT         12
-#define         MSI_ADDR_DEST_ID_MASK          0x00ffff0
-#define  MSI_ADDR_DEST_ID(dest)                (((dest) << MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK)
-
-#endif /* ASM_MSIDEF_H */
+#include <asm-i386/msidef.h>
index d0a7f53b1497cf65442c2162716608378589c467..5fb3c0de5cccba5a421a3820bb551619d489fad9 100644 (file)
@@ -88,5 +88,7 @@ unsigned lapic_adjust_nmi_hz(unsigned hz);
 int lapic_watchdog_ok(void);
 void disable_lapic_nmi_watchdog(void);
 void enable_lapic_nmi_watchdog(void);
+void stop_nmi(void);
+void restart_nmi(void);
 
 #endif /* ASM_NMI_H */
index 60cff1e4f7a34b9797dcb8eb4b6e39e6ff839867..c9d8764c89d182920dc1b50b4938f63521292c70 100644 (file)
@@ -403,6 +403,8 @@ extern struct list_head pgd_list;
 
 extern int kern_addr_valid(unsigned long addr); 
 
+pte_t *lookup_address(unsigned long addr);
+
 #define io_remap_pfn_range(vma, vaddr, pfn, size, prot)                \
                remap_pfn_range(vma, vaddr, pfn, size, prot)
 
index a1645bbc03bd20cb066908073cd3d7954f8eb930..19525175b91c2a7793bf463c4e78eba925030d3c 100644 (file)
@@ -389,17 +389,6 @@ static inline void prefetchw(void *x)
 
 #define cpu_relax()   rep_nop()
 
-/*
- *      NSC/Cyrix CPU indexed register access macros
- */
-
-#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
-
-#define setCx86(reg, data) do { \
-       outb((reg), 0x22); \
-       outb((data), 0x23); \
-} while (0)
-
 static inline void serialize_cpu(void)
 {
        __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
index d6e3225549c0a820bcefa529e4b39739644fbfb9..31f20ad65876b25f588e6c2e7e693fff23eb19b0 100644 (file)
@@ -75,8 +75,6 @@ extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long en
 extern void early_quirks(void);
 extern void check_efer(void);
 
-extern int unhandled_signal(struct task_struct *tsk, int sig);
-
 extern void select_idle_routine(const struct cpuinfo_x86 *c);
 
 extern unsigned long table_start, table_end;
index 6313d33a06869f8e564feec78d86357f669302cd..02175aa1d16a8aea903a51e6b5e1c71fda57d075 100644 (file)
@@ -75,19 +75,31 @@ static inline unsigned long read_cr0(void)
        unsigned long cr0;
        asm volatile("movq %%cr0,%0" : "=r" (cr0));
        return cr0;
-} 
+}
 
 static inline void write_cr0(unsigned long val) 
 { 
        asm volatile("movq %0,%%cr0" :: "r" (val));
-} 
+}
+
+static inline unsigned long read_cr2(void)
+{
+       unsigned long cr2;
+       asm("movq %%cr2,%0" : "=r" (cr2));
+       return cr2;
+}
+
+static inline void write_cr2(unsigned long val)
+{
+       asm volatile("movq %0,%%cr2" :: "r" (val));
+}
 
 static inline unsigned long read_cr3(void)
 { 
        unsigned long cr3;
        asm("movq %%cr3,%0" : "=r" (cr3));
        return cr3;
-} 
+}
 
 static inline void write_cr3(unsigned long val)
 {
@@ -99,12 +111,24 @@ static inline unsigned long read_cr4(void)
        unsigned long cr4;
        asm("movq %%cr4,%0" : "=r" (cr4));
        return cr4;
-} 
+}
 
 static inline void write_cr4(unsigned long val)
 { 
        asm volatile("movq %0,%%cr4" :: "r" (val) : "memory");
-} 
+}
+
+static inline unsigned long read_cr8(void)
+{
+       unsigned long cr8;
+       asm("movq %%cr8,%0" : "=r" (cr8));
+       return cr8;
+}
+
+static inline void write_cr8(unsigned long val)
+{
+       asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
+}
 
 #define stts() write_cr0(8 | read_cr0())
 
index ea91abe740da0b76810b19a522b9d814f0e8aa6e..0ae338866240dee807f7f35a5f8280ebe1aa15b2 100644 (file)
@@ -237,12 +237,15 @@ extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct
 extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
 extern long do_sigpending(void __user *, unsigned long);
 extern int sigprocmask(int, sigset_t *, sigset_t *);
+extern int show_unhandled_signals;
 
 struct pt_regs;
 extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
 
 extern struct kmem_cache *sighand_cachep;
 
+int unhandled_signal(struct task_struct *tsk, int sig);
+
 /*
  * In POSIX a signal is sent either to a specific thread (Linux task)
  * or to the process as a whole (Linux thread group).  How the signal
index 39d122753bac93eb7cfa62d0f2e2e451a4908dd5..ef8156a6aad519014c030f62e856302dacf045e7 100644 (file)
@@ -255,6 +255,16 @@ flush_signal_handlers(struct task_struct *t, int force_default)
        }
 }
 
+int unhandled_signal(struct task_struct *tsk, int sig)
+{
+       if (is_init(tsk))
+               return 1;
+       if (tsk->ptrace & PT_PTRACED)
+               return 0;
+       return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
+               (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
+}
+
 
 /* Notify the system that a driver wants to block all signals for this
  * process, and wants to be notified if any signals at all were to be
index 222299844ad1b5a495b5796f1898f95174157632..ddebf3f2affe937d8a9ccb694de85dc9d567f1fb 100644 (file)
@@ -1203,6 +1203,16 @@ static ctl_table fs_table[] = {
 };
 
 static ctl_table debug_table[] = {
+#ifdef CONFIG_X86
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "exception-trace",
+               .data           = &show_unhandled_signals,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec
+       },
+#endif
        { .ctl_name = 0 }
 };
 
index e03b39f3540f79adf384c476f185e7a9da91e4ac..3047bf06c1f3256bd59965fc064a32b439135369 100644 (file)
@@ -209,7 +209,7 @@ static int __meminit sparse_init_one_section(struct mem_section *ms,
        return 1;
 }
 
-__attribute__((weak))
+__attribute__((weak)) __init
 void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
 {
        return NULL;