mirror of https://gitee.com/openkylin/linux.git
powerpc/mm: Move debugger check to notify_page_fault()
unclutters the main path Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
f3d96e698e
commit
bb4be50e61
|
@ -47,27 +47,25 @@
|
||||||
|
|
||||||
#include "icswx.h"
|
#include "icswx.h"
|
||||||
|
|
||||||
#ifdef CONFIG_KPROBES
|
static inline bool notify_page_fault(struct pt_regs *regs)
|
||||||
static inline int notify_page_fault(struct pt_regs *regs)
|
|
||||||
{
|
{
|
||||||
int ret = 0;
|
bool ret = false;
|
||||||
|
|
||||||
|
#ifdef CONFIG_KPROBES
|
||||||
/* kprobe_running() needs smp_processor_id() */
|
/* kprobe_running() needs smp_processor_id() */
|
||||||
if (!user_mode(regs)) {
|
if (!user_mode(regs)) {
|
||||||
preempt_disable();
|
preempt_disable();
|
||||||
if (kprobe_running() && kprobe_fault_handler(regs, 11))
|
if (kprobe_running() && kprobe_fault_handler(regs, 11))
|
||||||
ret = 1;
|
ret = true;
|
||||||
preempt_enable();
|
preempt_enable();
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_KPROBES */
|
||||||
|
|
||||||
|
if (unlikely(debugger_fault_handler(regs)))
|
||||||
|
ret = true;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static inline int notify_page_fault(struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check whether the instruction at regs->nip is a store using
|
* Check whether the instruction at regs->nip is a store using
|
||||||
|
@ -242,9 +240,6 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
|
||||||
if (notify_page_fault(regs))
|
if (notify_page_fault(regs))
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
||||||
if (unlikely(debugger_fault_handler(regs)))
|
|
||||||
goto bail;
|
|
||||||
|
|
||||||
if (unlikely(page_fault_is_bad(error_code))) {
|
if (unlikely(page_fault_is_bad(error_code))) {
|
||||||
if (is_user)
|
if (is_user)
|
||||||
_exception(SIGBUS, regs, BUS_OBJERR, address);
|
_exception(SIGBUS, regs, BUS_OBJERR, address);
|
||||||
|
|
Loading…
Reference in New Issue