forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
context_tracking: Move exception handling to generic code
Exceptions handling on context tracking should share common treatment: on entry we exit user mode if the exception triggered in that context. Then on exception exit we return to that previous context. Generalize this to avoid duplication across archs. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Kevin Hilman <khilman@linaro.org> Cc: Mats Liljegren <mats.liljegren@enea.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
- Loading branch information
Showing
5 changed files
with
19 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
#ifndef _ASM_X86_CONTEXT_TRACKING_H | ||
#define _ASM_X86_CONTEXT_TRACKING_H | ||
|
||
#ifndef __ASSEMBLY__ | ||
#include <linux/context_tracking.h> | ||
#include <asm/ptrace.h> | ||
|
||
static inline void exception_enter(struct pt_regs *regs) | ||
{ | ||
user_exit(); | ||
} | ||
|
||
static inline void exception_exit(struct pt_regs *regs) | ||
{ | ||
#ifdef CONFIG_CONTEXT_TRACKING | ||
if (user_mode(regs)) | ||
user_enter(); | ||
#endif | ||
} | ||
|
||
#else /* __ASSEMBLY__ */ | ||
|
||
#ifdef CONFIG_CONTEXT_TRACKING | ||
# define SCHEDULE_USER call schedule_user | ||
#else | ||
# define SCHEDULE_USER call schedule | ||
#endif | ||
|
||
#endif /* !__ASSEMBLY__ */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters