diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-01-30 07:33:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:12 -0500 |
commit | 608566b4edda5079c7812c2108a89c0fcf2894bb (patch) | |
tree | 4926ecc581c767eee053a2d74f84b832d9ea4948 /arch/x86/mm/fault_64.c | |
parent | f2857ce92023409df1544737d5b3499b4630a183 (diff) |
x86: do_page_fault small unification
Copy the prefetch of map_sem from X86_64 and move the check
notify_page_fault (soon to be kprobe_handle_fault) out of
the unlikely if() statement.
This makes the X86_32|64 pagefault handlers closer to each
other.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/fault_64.c')
-rw-r--r-- | arch/x86/mm/fault_64.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c index 80f8436ac8b2..c6b3ad515cf1 100644 --- a/arch/x86/mm/fault_64.c +++ b/arch/x86/mm/fault_64.c | |||
@@ -355,6 +355,8 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | |||
355 | 355 | ||
356 | si_code = SEGV_MAPERR; | 356 | si_code = SEGV_MAPERR; |
357 | 357 | ||
358 | if (notify_page_fault(regs)) | ||
359 | return; | ||
358 | 360 | ||
359 | /* | 361 | /* |
360 | * We fault-in kernel-space virtual memory on-demand. The | 362 | * We fault-in kernel-space virtual memory on-demand. The |
@@ -380,8 +382,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | |||
380 | if (vmalloc_fault(address) >= 0) | 382 | if (vmalloc_fault(address) >= 0) |
381 | return; | 383 | return; |
382 | } | 384 | } |
383 | if (notify_page_fault(regs)) | ||
384 | return; | ||
385 | /* | 385 | /* |
386 | * Don't take the mm semaphore here. If we fixup a prefetch | 386 | * Don't take the mm semaphore here. If we fixup a prefetch |
387 | * fault we could otherwise deadlock. | 387 | * fault we could otherwise deadlock. |
@@ -389,9 +389,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | |||
389 | goto bad_area_nosemaphore; | 389 | goto bad_area_nosemaphore; |
390 | } | 390 | } |
391 | 391 | ||
392 | if (notify_page_fault(regs)) | ||
393 | return; | ||
394 | |||
395 | if (likely(regs->flags & X86_EFLAGS_IF)) | 392 | if (likely(regs->flags & X86_EFLAGS_IF)) |
396 | local_irq_enable(); | 393 | local_irq_enable(); |
397 | 394 | ||