tracing: x86, mmiotrace: only register for die notifier when tracer active
[safe/jmp/linux-2.6] / arch / x86 / mm / fault.c
index 6fa9f17..a03b727 100644 (file)
@@ -1,6 +1,7 @@
 /*
  *  Copyright (C) 1995  Linus Torvalds
  *  Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs.
+ *  Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar
  */
 #include <linux/interrupt.h>
 #include <linux/mmiotrace.h>
@@ -56,7 +57,8 @@ enum x86_pf_error_code {
 };
 
 /*
- * (returns 0 if mmiotrace is disabled)
+ * Returns 0 if mmiotrace is disabled, or if the fault is not
+ * handled by mmiotrace:
  */
 static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr)
 {
@@ -836,11 +838,9 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address)
        if (!(error_code & PF_USER))
                no_context(regs, error_code, address);
 
-#ifdef CONFIG_X86_32
-       /* User space => ok to do another page fault: */
+       /* User-space => ok to do another page fault: */
        if (is_prefetch(regs, error_code, address))
                return;
-#endif
 
        tsk->thread.cr2         = address;
        tsk->thread.error_code  = error_code;
@@ -960,11 +960,7 @@ access_error(unsigned long error_code, int write, struct vm_area_struct *vma)
 
 static int fault_in_kernel_space(unsigned long address)
 {
-#ifdef CONFIG_X86_32
-       return address >= TASK_SIZE;
-#else
        return address >= TASK_SIZE_MAX;
-#endif
 }
 
 /*