diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-04 00:05:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-04 00:05:40 -0500 |
commit | 4302d506d5f3419109abdd0d6e400ed6e8148209 (patch) | |
tree | ec8763fead6955c35eef5b284aa924fd660c4f06 /arch/x86/kernel | |
parent | ce4d72fac16a9540452957b526443b6080030bff (diff) | |
parent | 0e2815de552a638295cfdaf0865e575573bf263e (diff) |
Merge branch 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 sigcontext header cleanups from Ingo Molnar:
"This series reorganizes and cleans up various aspects of the main
sigcontext UAPI headers, such as unifying the data structures and
updating/adding lots of comments to explain all the ABI details and
quirks. The headers can now also be built in user-space standalone"
* 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/headers: Clean up too long lines
x86/headers: Remove <asm/sigcontext.h> references on the kernel side
x86/headers: Remove direct sigcontext32.h uses
x86/headers: Convert sigcontext_ia32 uses to sigcontext_32
x86/headers: Unify 'struct sigcontext_ia32' and 'struct sigcontext_32'
x86/headers: Make sigcontext pointers bit independent
x86/headers: Move the 'struct sigcontext' definitions into the UAPI header
x86/headers: Clean up the kernel's struct sigcontext types to be ABI-clean
x86/headers: Convert uses of _fpstate_ia32 to _fpstate_32
x86/headers: Unify 'struct _fpstate_ia32' and i386 struct _fpstate
x86/headers: Unify register type definitions between 32-bit compat and i386
x86/headers: Use ABI types consistently in sigcontext*.h
x86/headers: Separate out legacy user-space structure definitions
x86/headers: Clean up and better document uapi/asm/sigcontext.h
x86/headers: Clean up uapi/asm/sigcontext32.h
x86/headers: Fix (old) header file dependency bug in uapi/asm/sigcontext32.h
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/asm-offsets.c | 18 | ||||
-rw-r--r-- | arch/x86/kernel/fpu/signal.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/signal.c | 4 |
3 files changed, 14 insertions, 12 deletions
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c index 95a18e25d5bf..439df975bc7a 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c | |||
@@ -43,15 +43,15 @@ void common(void) { | |||
43 | 43 | ||
44 | #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) | 44 | #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) |
45 | BLANK(); | 45 | BLANK(); |
46 | OFFSET(IA32_SIGCONTEXT_ax, sigcontext_ia32, ax); | 46 | OFFSET(IA32_SIGCONTEXT_ax, sigcontext_32, ax); |
47 | OFFSET(IA32_SIGCONTEXT_bx, sigcontext_ia32, bx); | 47 | OFFSET(IA32_SIGCONTEXT_bx, sigcontext_32, bx); |
48 | OFFSET(IA32_SIGCONTEXT_cx, sigcontext_ia32, cx); | 48 | OFFSET(IA32_SIGCONTEXT_cx, sigcontext_32, cx); |
49 | OFFSET(IA32_SIGCONTEXT_dx, sigcontext_ia32, dx); | 49 | OFFSET(IA32_SIGCONTEXT_dx, sigcontext_32, dx); |
50 | OFFSET(IA32_SIGCONTEXT_si, sigcontext_ia32, si); | 50 | OFFSET(IA32_SIGCONTEXT_si, sigcontext_32, si); |
51 | OFFSET(IA32_SIGCONTEXT_di, sigcontext_ia32, di); | 51 | OFFSET(IA32_SIGCONTEXT_di, sigcontext_32, di); |
52 | OFFSET(IA32_SIGCONTEXT_bp, sigcontext_ia32, bp); | 52 | OFFSET(IA32_SIGCONTEXT_bp, sigcontext_32, bp); |
53 | OFFSET(IA32_SIGCONTEXT_sp, sigcontext_ia32, sp); | 53 | OFFSET(IA32_SIGCONTEXT_sp, sigcontext_32, sp); |
54 | OFFSET(IA32_SIGCONTEXT_ip, sigcontext_ia32, ip); | 54 | OFFSET(IA32_SIGCONTEXT_ip, sigcontext_32, ip); |
55 | 55 | ||
56 | BLANK(); | 56 | BLANK(); |
57 | OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext); | 57 | OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext); |
diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c index eb032677f939..ef29b742cea7 100644 --- a/arch/x86/kernel/fpu/signal.c +++ b/arch/x86/kernel/fpu/signal.c | |||
@@ -56,7 +56,7 @@ static inline int save_fsave_header(struct task_struct *tsk, void __user *buf) | |||
56 | if (use_fxsr()) { | 56 | if (use_fxsr()) { |
57 | struct xregs_state *xsave = &tsk->thread.fpu.state.xsave; | 57 | struct xregs_state *xsave = &tsk->thread.fpu.state.xsave; |
58 | struct user_i387_ia32_struct env; | 58 | struct user_i387_ia32_struct env; |
59 | struct _fpstate_ia32 __user *fp = buf; | 59 | struct _fpstate_32 __user *fp = buf; |
60 | 60 | ||
61 | convert_from_fxsr(&env, tsk); | 61 | convert_from_fxsr(&env, tsk); |
62 | 62 | ||
@@ -165,7 +165,7 @@ int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size) | |||
165 | if (!static_cpu_has(X86_FEATURE_FPU)) | 165 | if (!static_cpu_has(X86_FEATURE_FPU)) |
166 | return fpregs_soft_get(current, NULL, 0, | 166 | return fpregs_soft_get(current, NULL, 0, |
167 | sizeof(struct user_i387_ia32_struct), NULL, | 167 | sizeof(struct user_i387_ia32_struct), NULL, |
168 | (struct _fpstate_ia32 __user *) buf) ? -1 : 1; | 168 | (struct _fpstate_32 __user *) buf) ? -1 : 1; |
169 | 169 | ||
170 | if (fpregs_active()) { | 170 | if (fpregs_active()) { |
171 | /* Save the live register state to the user directly. */ | 171 | /* Save the live register state to the user directly. */ |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 32165d649979..b7ffb7c00075 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -63,6 +63,7 @@ | |||
63 | 63 | ||
64 | int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | 64 | int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) |
65 | { | 65 | { |
66 | unsigned long buf_val; | ||
66 | void __user *buf; | 67 | void __user *buf; |
67 | unsigned int tmpflags; | 68 | unsigned int tmpflags; |
68 | unsigned int err = 0; | 69 | unsigned int err = 0; |
@@ -107,7 +108,8 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
107 | regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); | 108 | regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); |
108 | regs->orig_ax = -1; /* disable syscall checks */ | 109 | regs->orig_ax = -1; /* disable syscall checks */ |
109 | 110 | ||
110 | get_user_ex(buf, &sc->fpstate); | 111 | get_user_ex(buf_val, &sc->fpstate); |
112 | buf = (void __user *)buf_val; | ||
111 | } get_user_catch(err); | 113 | } get_user_catch(err); |
112 | 114 | ||
113 | err |= fpu__restore_sig(buf, config_enabled(CONFIG_X86_32)); | 115 | err |= fpu__restore_sig(buf, config_enabled(CONFIG_X86_32)); |