Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[deliverable/linux.git] / arch / x86 / mm / extable.c
index 4bb53b89f3c55defd9098d81002eed1877b0fa07..832b98f822be72b07fe7f5ec7750cad63d0249bb 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/traps.h>
+#include <asm/kdebug.h>
 
 typedef bool (*ex_handler_t)(const struct exception_table_entry *,
                            struct pt_regs *, int);
@@ -37,7 +38,7 @@ bool ex_handler_ext(const struct exception_table_entry *fixup,
                   struct pt_regs *regs, int trapnr)
 {
        /* Special hack for uaccess_err */
-       current_thread_info()->uaccess_err = 1;
+       current->thread.uaccess_err = 1;
        regs->ip = ex_fixup_addr(fixup);
        return true;
 }
@@ -46,8 +47,9 @@ EXPORT_SYMBOL(ex_handler_ext);
 bool ex_handler_rdmsr_unsafe(const struct exception_table_entry *fixup,
                             struct pt_regs *regs, int trapnr)
 {
-       WARN_ONCE(1, "unchecked MSR access error: RDMSR from 0x%x\n",
-                 (unsigned int)regs->cx);
+       if (pr_warn_once("unchecked MSR access error: RDMSR from 0x%x at rIP: 0x%lx (%pF)\n",
+                        (unsigned int)regs->cx, regs->ip, (void *)regs->ip))
+               show_stack_regs(regs);
 
        /* Pretend that the read succeeded and returned 0. */
        regs->ip = ex_fixup_addr(fixup);
@@ -60,9 +62,10 @@ EXPORT_SYMBOL(ex_handler_rdmsr_unsafe);
 bool ex_handler_wrmsr_unsafe(const struct exception_table_entry *fixup,
                             struct pt_regs *regs, int trapnr)
 {
-       WARN_ONCE(1, "unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x)\n",
-                 (unsigned int)regs->cx,
-                 (unsigned int)regs->dx, (unsigned int)regs->ax);
+       if (pr_warn_once("unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x) at rIP: 0x%lx (%pF)\n",
+                        (unsigned int)regs->cx, (unsigned int)regs->dx,
+                        (unsigned int)regs->ax,  regs->ip, (void *)regs->ip))
+               show_stack_regs(regs);
 
        /* Pretend that the write succeeded. */
        regs->ip = ex_fixup_addr(fixup);
This page took 0.026322 seconds and 5 git commands to generate.