aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal_64.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-04-19 17:27:56 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-26 11:35:47 -0400
commit55928e37b29ba5557a5edc8ab679fe5191bc051d (patch)
treea59752fa1083243e6b2126cbb40b6a247ddcd89f /arch/x86/kernel/signal_64.c
parent8b9c5ff380aa4f10658171ed2b9abc1e0861b770 (diff)
x86 signals: lift set_fs
This lifts the set_fs(USER_DS) call for signal handler setup out of the three places copying the same code into the one place that calls them all. There is no change in what it does. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/signal_64.c')
-rw-r--r--arch/x86/kernel/signal_64.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 3a76702dc3f1..ccb2a4560c2d 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -285,10 +285,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
285 even if the handler happens to be interrupting 32-bit code. */ 285 even if the handler happens to be interrupting 32-bit code. */
286 regs->cs = __USER_CS; 286 regs->cs = __USER_CS;
287 287
288 /* This, by contrast, has nothing to do with segment registers -
289 see include/asm-x86_64/uaccess.h for details. */
290 set_fs(USER_DS);
291
292 return 0; 288 return 0;
293 289
294give_sigsegv: 290give_sigsegv:
@@ -377,6 +373,13 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
377 373
378 if (ret == 0) { 374 if (ret == 0) {
379 /* 375 /*
376 * This has nothing to do with segment registers,
377 * despite the name. This magic affects uaccess.h
378 * macros' behavior. Reset it to the normal setting.
379 */
380 set_fs(USER_DS);
381
382 /*
380 * Clear the direction flag as per the ABI for function entry. 383 * Clear the direction flag as per the ABI for function entry.
381 */ 384 */
382 regs->flags &= ~X86_EFLAGS_DF; 385 regs->flags &= ~X86_EFLAGS_DF;