]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IA64] kprobes: fixup the pagefault exception caused by probehandlers
authorKeshavamurthy Anil S <anil.s.keshavamurthy@intel.com>
Mon, 25 Sep 2006 23:32:20 +0000 (16:32 -0700)
committerTony Luck <tony.luck@intel.com>
Tue, 26 Sep 2006 18:33:32 +0000 (11:33 -0700)
If the user-specified kprobe handler causes the page fault when accessing
user space address, fixup this fault since do_page_fault() should not
continue as the kprobe handler are run with preemption disabled.

Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/kernel/kprobes.c

index 320cb7a91c9d222f81448c65722122070c022c82..169ec3a7156ce4dc349769e90ead997bed4f4329 100644 (file)
@@ -771,6 +771,12 @@ static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)
                 */
                if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
                        return 1;
+               /*
+                * In case the user-specified fault handler returned
+                * zero, try to fix up.
+                */
+               if (ia64_done_with_exception(regs))
+                       return 1;
 
                /*
                 * Let ia64_do_page_fault() fix it.