Commit 9b355897 authored by Jan Beulich's avatar Jan Beulich Committed by Andi Kleen

[PATCH] x86: simplify notify_page_fault()

Remove all parameters from this function that aren't really variable.
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
parent 6a051565
...@@ -46,17 +46,17 @@ int unregister_page_fault_notifier(struct notifier_block *nb) ...@@ -46,17 +46,17 @@ int unregister_page_fault_notifier(struct notifier_block *nb)
} }
EXPORT_SYMBOL_GPL(unregister_page_fault_notifier); EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
static inline int notify_page_fault(enum die_val val, const char *str, static inline int notify_page_fault(struct pt_regs *regs, long err)
struct pt_regs *regs, long err, int trap, int sig)
{ {
struct die_args args = { struct die_args args = {
.regs = regs, .regs = regs,
.str = str, .str = "page fault",
.err = err, .err = err,
.trapnr = trap, .trapnr = 14,
.signr = sig .signr = SIGSEGV
}; };
return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); return atomic_notifier_call_chain(&notify_page_fault_chain,
DIE_PAGE_FAULT, &args);
} }
/* /*
...@@ -327,8 +327,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -327,8 +327,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
if (unlikely(address >= TASK_SIZE)) { if (unlikely(address >= TASK_SIZE)) {
if (!(error_code & 0x0000000d) && vmalloc_fault(address) >= 0) if (!(error_code & 0x0000000d) && vmalloc_fault(address) >= 0)
return; return;
if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
SIGSEGV) == NOTIFY_STOP)
return; return;
/* /*
* Don't take the mm semaphore here. If we fixup a prefetch * Don't take the mm semaphore here. If we fixup a prefetch
...@@ -337,8 +336,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -337,8 +336,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
goto bad_area_nosemaphore; goto bad_area_nosemaphore;
} }
if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
SIGSEGV) == NOTIFY_STOP)
return; return;
/* It's safe to allow irq's after cr2 has been saved and the vmalloc /* It's safe to allow irq's after cr2 has been saved and the vmalloc
......
...@@ -56,17 +56,17 @@ int unregister_page_fault_notifier(struct notifier_block *nb) ...@@ -56,17 +56,17 @@ int unregister_page_fault_notifier(struct notifier_block *nb)
} }
EXPORT_SYMBOL_GPL(unregister_page_fault_notifier); EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
static inline int notify_page_fault(enum die_val val, const char *str, static inline int notify_page_fault(struct pt_regs *regs, long err)
struct pt_regs *regs, long err, int trap, int sig)
{ {
struct die_args args = { struct die_args args = {
.regs = regs, .regs = regs,
.str = str, .str = "page fault",
.err = err, .err = err,
.trapnr = trap, .trapnr = 14,
.signr = sig .signr = SIGSEGV
}; };
return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); return atomic_notifier_call_chain(&notify_page_fault_chain,
DIE_PAGE_FAULT, &args);
} }
/* Sometimes the CPU reports invalid exceptions on prefetch. /* Sometimes the CPU reports invalid exceptions on prefetch.
...@@ -355,8 +355,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -355,8 +355,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
if (vmalloc_fault(address) >= 0) if (vmalloc_fault(address) >= 0)
return; return;
} }
if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
SIGSEGV) == NOTIFY_STOP)
return; return;
/* /*
* Don't take the mm semaphore here. If we fixup a prefetch * Don't take the mm semaphore here. If we fixup a prefetch
...@@ -365,8 +364,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -365,8 +364,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
goto bad_area_nosemaphore; goto bad_area_nosemaphore;
} }
if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
SIGSEGV) == NOTIFY_STOP)
return; return;
if (likely(regs->eflags & X86_EFLAGS_IF)) if (likely(regs->eflags & X86_EFLAGS_IF))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment