Commit 530e5c82 authored by Ingo Molnar's avatar Ingo Molnar

x86/headers: Make sigcontext pointers bit independent

Before we can eliminate the duplication between 'struct
sigcontext_32' and 'struct sigcontext_ia32', make the 'fpstate'
pointer field in 'struct sigcontext_32' bit independent.
Acked-by: default avatarMikko Rapeli <mikko.rapeli@iki.fi>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/1441438363-9999-12-git-send-email-mingo@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent f2c609bc
...@@ -218,7 +218,7 @@ struct sigcontext_32 { ...@@ -218,7 +218,7 @@ struct sigcontext_32 {
* of extended memory layout. See comments at the definition of * of extended memory layout. See comments at the definition of
* (struct _fpx_sw_bytes) * (struct _fpx_sw_bytes)
*/ */
void __user *fpstate; /* Zero when no FPU/extended context */ __u32 fpstate; /* Zero when no FPU/extended context */
__u32 oldmask; __u32 oldmask;
__u32 cr2; __u32 cr2;
}; };
...@@ -258,7 +258,7 @@ struct sigcontext_64 { ...@@ -258,7 +258,7 @@ struct sigcontext_64 {
* of extended memory layout. See comments at the definition of * of extended memory layout. See comments at the definition of
* (struct _fpx_sw_bytes) * (struct _fpx_sw_bytes)
*/ */
void __user *fpstate; /* Zero when no FPU/extended context */ __u64 fpstate; /* Zero when no FPU/extended context */
__u64 reserved1[8]; __u64 reserved1[8];
}; };
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
{ {
unsigned long buf_val;
void __user *buf; void __user *buf;
unsigned int tmpflags; unsigned int tmpflags;
unsigned int err = 0; unsigned int err = 0;
...@@ -107,7 +108,8 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) ...@@ -107,7 +108,8 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
regs->orig_ax = -1; /* disable syscall checks */ regs->orig_ax = -1; /* disable syscall checks */
get_user_ex(buf, &sc->fpstate); get_user_ex(buf_val, &sc->fpstate);
buf = (void __user *)buf_val;
} get_user_catch(err); } get_user_catch(err);
err |= fpu__restore_sig(buf, config_enabled(CONFIG_X86_32)); err |= fpu__restore_sig(buf, config_enabled(CONFIG_X86_32));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment