arch/tile: move user_exit() to early kernel entry sequence
This ensures that we always notify context tracking that we
have exited from user space no matter how we enter the kernel.
It is similar to how arm64 handles context tracking, for example.
This allows the removal of all the exception_enter() calls that
were added in commit 49e4e15619
("tile: support CONTEXT_TRACKING and
thus NOHZ_FULL").
Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/context_tracking.h>
|
||||
#include <asm/stack.h>
|
||||
#include <asm/traps.h>
|
||||
#include <asm/setup.h>
|
||||
@@ -254,7 +253,6 @@ static int do_bpt(struct pt_regs *regs)
|
||||
void __kprobes do_trap(struct pt_regs *regs, int fault_num,
|
||||
unsigned long reason)
|
||||
{
|
||||
enum ctx_state prev_state = exception_enter();
|
||||
siginfo_t info = { 0 };
|
||||
int signo, code;
|
||||
unsigned long address = 0;
|
||||
@@ -263,7 +261,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
|
||||
|
||||
/* Handle breakpoints, etc. */
|
||||
if (is_kernel && fault_num == INT_ILL && do_bpt(regs))
|
||||
goto done;
|
||||
return;
|
||||
|
||||
/* Re-enable interrupts, if they were previously enabled. */
|
||||
if (!(regs->flags & PT_FLAGS_DISABLE_IRQ))
|
||||
@@ -277,7 +275,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
|
||||
const char *name;
|
||||
char buf[100];
|
||||
if (fixup_exception(regs)) /* ILL_TRANS or UNALIGN_DATA */
|
||||
goto done;
|
||||
return;
|
||||
if (fault_num >= 0 &&
|
||||
fault_num < ARRAY_SIZE(int_name) &&
|
||||
int_name[fault_num] != NULL)
|
||||
@@ -319,7 +317,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
|
||||
case INT_GPV:
|
||||
#if CHIP_HAS_TILE_DMA()
|
||||
if (retry_gpv(reason))
|
||||
goto done;
|
||||
return;
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case INT_UDN_ACCESS:
|
||||
@@ -346,7 +344,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
|
||||
if (!state ||
|
||||
(void __user *)(regs->pc) != state->buffer) {
|
||||
single_step_once(regs);
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -390,9 +388,6 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
|
||||
if (signo != SIGTRAP)
|
||||
trace_unhandled_signal("trap", regs, address, signo);
|
||||
force_sig_info(signo, &info, current);
|
||||
|
||||
done:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
|
||||
void do_nmi(struct pt_regs *regs, int fault_num, unsigned long reason)
|
||||
|
Reference in New Issue
Block a user