aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal_64.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-07-29 13:29:25 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-30 13:49:27 -0400
commitc37b5efea43f9e500363f9973dd00e3d2cdcc685 (patch)
tree9ce635f1672099dafcd78e535b4ea18d80235d8f /arch/x86/kernel/signal_64.c
parentbdd8caba5ed5bb7ee21c9f061597284ffeb280bf (diff)
x86, xsave: save/restore the extended state context in sigframe
On cpu's supporting xsave/xrstor, fpstate pointer in the sigcontext, will include the extended state information along with fpstate information. Presence of extended state information is indicated by the presence of FP_XSTATE_MAGIC1 at fpstate.sw_reserved.magic1 and FP_XSTATE_MAGIC2 at fpstate + (fpstate.sw_reserved.extended_size - FP_XSTATE_MAGIC2_SIZE). Extended feature bit mask that is saved in the memory layout is represented by the fpstate.sw_reserved.xstate_bv For RT signal frames, UC_FP_XSTATE in the uc_flags also indicate the presence of extended state information in the sigcontext's fpstate pointer. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index ddf6123a55c8..2621b98f5bf6 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -192,7 +192,7 @@ get_stack(struct k_sigaction *ka, struct pt_regs *regs, unsigned long size)
192 sp = current->sas_ss_sp + current->sas_ss_size; 192 sp = current->sas_ss_sp + current->sas_ss_size;
193 } 193 }
194 194
195 return (void __user *)round_down(sp - size, 16); 195 return (void __user *)round_down(sp - size, 64);
196} 196}
197 197
198static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 198static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
@@ -226,7 +226,10 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
226 } 226 }
227 227
228 /* Create the ucontext. */ 228 /* Create the ucontext. */
229 err |= __put_user(0, &frame->uc.uc_flags); 229 if (cpu_has_xsave)
230 err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags);
231 else
232 err |= __put_user(0, &frame->uc.uc_flags);
230 err |= __put_user(0, &frame->uc.uc_link); 233 err |= __put_user(0, &frame->uc.uc_link);
231 err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 234 err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
232 err |= __put_user(sas_ss_flags(regs->sp), 235 err |= __put_user(sas_ss_flags(regs->sp),