aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/traps.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@ezchip.com>2015-12-23 17:13:04 -0500
committerChris Metcalf <cmetcalf@ezchip.com>2016-01-18 14:49:30 -0500
commit1bb50cad45f4a3fb9a339006d76efc50f70eed5b (patch)
tree91e00be5d5852acdb7c5c9ba9707b9f7926e6bc6 /arch/tile/kernel/traps.c
parent9ce815ed50bbc518526106071f395deacaf94ad7 (diff)
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 49e4e15619cd ("tile: support CONTEXT_TRACKING and thus NOHZ_FULL"). Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Diffstat (limited to 'arch/tile/kernel/traps.c')
-rw-r--r--arch/tile/kernel/traps.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/tile/kernel/traps.c b/arch/tile/kernel/traps.c
index 0011a9ff0525..4d9651c5b1ad 100644
--- a/arch/tile/kernel/traps.c
+++ b/arch/tile/kernel/traps.c
@@ -20,7 +20,6 @@
20#include <linux/reboot.h> 20#include <linux/reboot.h>
21#include <linux/uaccess.h> 21#include <linux/uaccess.h>
22#include <linux/ptrace.h> 22#include <linux/ptrace.h>
23#include <linux/context_tracking.h>
24#include <asm/stack.h> 23#include <asm/stack.h>
25#include <asm/traps.h> 24#include <asm/traps.h>
26#include <asm/setup.h> 25#include <asm/setup.h>
@@ -254,7 +253,6 @@ static int do_bpt(struct pt_regs *regs)
254void __kprobes do_trap(struct pt_regs *regs, int fault_num, 253void __kprobes do_trap(struct pt_regs *regs, int fault_num,
255 unsigned long reason) 254 unsigned long reason)
256{ 255{
257 enum ctx_state prev_state = exception_enter();
258 siginfo_t info = { 0 }; 256 siginfo_t info = { 0 };
259 int signo, code; 257 int signo, code;
260 unsigned long address = 0; 258 unsigned long address = 0;
@@ -263,7 +261,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
263 261
264 /* Handle breakpoints, etc. */ 262 /* Handle breakpoints, etc. */
265 if (is_kernel && fault_num == INT_ILL && do_bpt(regs)) 263 if (is_kernel && fault_num == INT_ILL && do_bpt(regs))
266 goto done; 264 return;
267 265
268 /* Re-enable interrupts, if they were previously enabled. */ 266 /* Re-enable interrupts, if they were previously enabled. */
269 if (!(regs->flags & PT_FLAGS_DISABLE_IRQ)) 267 if (!(regs->flags & PT_FLAGS_DISABLE_IRQ))
@@ -277,7 +275,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
277 const char *name; 275 const char *name;
278 char buf[100]; 276 char buf[100];
279 if (fixup_exception(regs)) /* ILL_TRANS or UNALIGN_DATA */ 277 if (fixup_exception(regs)) /* ILL_TRANS or UNALIGN_DATA */
280 goto done; 278 return;
281 if (fault_num >= 0 && 279 if (fault_num >= 0 &&
282 fault_num < ARRAY_SIZE(int_name) && 280 fault_num < ARRAY_SIZE(int_name) &&
283 int_name[fault_num] != NULL) 281 int_name[fault_num] != NULL)
@@ -319,7 +317,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
319 case INT_GPV: 317 case INT_GPV:
320#if CHIP_HAS_TILE_DMA() 318#if CHIP_HAS_TILE_DMA()
321 if (retry_gpv(reason)) 319 if (retry_gpv(reason))
322 goto done; 320 return;
323#endif 321#endif
324 /*FALLTHROUGH*/ 322 /*FALLTHROUGH*/
325 case INT_UDN_ACCESS: 323 case INT_UDN_ACCESS:
@@ -346,7 +344,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
346 if (!state || 344 if (!state ||
347 (void __user *)(regs->pc) != state->buffer) { 345 (void __user *)(regs->pc) != state->buffer) {
348 single_step_once(regs); 346 single_step_once(regs);
349 goto done; 347 return;
350 } 348 }
351 } 349 }
352#endif 350#endif
@@ -390,9 +388,6 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
390 if (signo != SIGTRAP) 388 if (signo != SIGTRAP)
391 trace_unhandled_signal("trap", regs, address, signo); 389 trace_unhandled_signal("trap", regs, address, signo);
392 force_sig_info(signo, &info, current); 390 force_sig_info(signo, &info, current);
393
394done:
395 exception_exit(prev_state);
396} 391}
397 392
398void do_nmi(struct pt_regs *regs, int fault_num, unsigned long reason) 393void do_nmi(struct pt_regs *regs, int fault_num, unsigned long reason)