diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-30 02:45:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 09:48:05 -0400 |
commit | fcbc99c403c4a1a24ac4744e08c04da3ec18a68c (patch) | |
tree | dadaae57529d3b64d3bfae2509757b68d98786d8 | |
parent | 05012c13f69d67be8a6a7e65726eeb70899ad6ad (diff) |
x86/fpu: Split out fpu/signal.h from fpu/internal.h for signal frame handling functions
Most of the FPU does not use them, so split it out and include
them in signal.c and ia32_signal.c
Also fix header file dependency assumption in fpu/core.c.
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.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>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/ia32/ia32_signal.c | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/fpu/internal.h | 24 | ||||
-rw-r--r-- | arch/x86/include/asm/fpu/signal.h | 31 | ||||
-rw-r--r-- | arch/x86/kernel/fpu/core.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/fpu/xstate.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/signal.c | 1 |
7 files changed, 37 insertions, 24 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 54605eb1631f..ae3a29ae875b 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/ucontext.h> | 22 | #include <asm/ucontext.h> |
23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
24 | #include <asm/fpu/internal.h> | 24 | #include <asm/fpu/internal.h> |
25 | #include <asm/fpu/signal.h> | ||
25 | #include <asm/ptrace.h> | 26 | #include <asm/ptrace.h> |
26 | #include <asm/ia32_unistd.h> | 27 | #include <asm/ia32_unistd.h> |
27 | #include <asm/user32.h> | 28 | #include <asm/user32.h> |
diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index dc4842b0831b..e2ceb49d310d 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h | |||
@@ -19,21 +19,6 @@ | |||
19 | #include <asm/fpu/api.h> | 19 | #include <asm/fpu/api.h> |
20 | #include <asm/fpu/xstate.h> | 20 | #include <asm/fpu/xstate.h> |
21 | 21 | ||
22 | #ifdef CONFIG_X86_64 | ||
23 | # include <asm/sigcontext32.h> | ||
24 | # include <asm/user32.h> | ||
25 | struct ksignal; | ||
26 | int ia32_setup_rt_frame(int sig, struct ksignal *ksig, | ||
27 | compat_sigset_t *set, struct pt_regs *regs); | ||
28 | int ia32_setup_frame(int sig, struct ksignal *ksig, | ||
29 | compat_sigset_t *set, struct pt_regs *regs); | ||
30 | #else | ||
31 | # define user_i387_ia32_struct user_i387_struct | ||
32 | # define user32_fxsr_struct user_fxsr_struct | ||
33 | # define ia32_setup_frame __setup_frame | ||
34 | # define ia32_setup_rt_frame __setup_rt_frame | ||
35 | #endif | ||
36 | |||
37 | #define MXCSR_DEFAULT 0x1f80 | 22 | #define MXCSR_DEFAULT 0x1f80 |
38 | 23 | ||
39 | extern unsigned int mxcsr_feature_mask; | 24 | extern unsigned int mxcsr_feature_mask; |
@@ -63,11 +48,6 @@ extern void fpu__resume_cpu(void); | |||
63 | 48 | ||
64 | DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx); | 49 | DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx); |
65 | 50 | ||
66 | extern void convert_from_fxsr(struct user_i387_ia32_struct *env, | ||
67 | struct task_struct *tsk); | ||
68 | extern void convert_to_fxsr(struct task_struct *tsk, | ||
69 | const struct user_i387_ia32_struct *env); | ||
70 | |||
71 | extern user_regset_active_fn regset_fpregs_active, regset_xregset_fpregs_active; | 51 | extern user_regset_active_fn regset_fpregs_active, regset_xregset_fpregs_active; |
72 | extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get, | 52 | extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get, |
73 | xstateregs_get; | 53 | xstateregs_get; |
@@ -530,8 +510,4 @@ static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk) | |||
530 | } | 510 | } |
531 | } | 511 | } |
532 | 512 | ||
533 | unsigned long | ||
534 | fpu__alloc_mathframe(unsigned long sp, int ia32_frame, | ||
535 | unsigned long *buf_fx, unsigned long *size); | ||
536 | |||
537 | #endif /* _ASM_X86_FPU_INTERNAL_H */ | 513 | #endif /* _ASM_X86_FPU_INTERNAL_H */ |
diff --git a/arch/x86/include/asm/fpu/signal.h b/arch/x86/include/asm/fpu/signal.h new file mode 100644 index 000000000000..0803dc2aba80 --- /dev/null +++ b/arch/x86/include/asm/fpu/signal.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * x86 FPU signal frame handling methods: | ||
3 | */ | ||
4 | #ifndef _ASM_X86_FPU_SIGNAL_H | ||
5 | #define _ASM_X86_FPU_SIGNAL_H | ||
6 | |||
7 | #ifdef CONFIG_X86_64 | ||
8 | # include <asm/sigcontext32.h> | ||
9 | # include <asm/user32.h> | ||
10 | struct ksignal; | ||
11 | int ia32_setup_rt_frame(int sig, struct ksignal *ksig, | ||
12 | compat_sigset_t *set, struct pt_regs *regs); | ||
13 | int ia32_setup_frame(int sig, struct ksignal *ksig, | ||
14 | compat_sigset_t *set, struct pt_regs *regs); | ||
15 | #else | ||
16 | # define user_i387_ia32_struct user_i387_struct | ||
17 | # define user32_fxsr_struct user_fxsr_struct | ||
18 | # define ia32_setup_frame __setup_frame | ||
19 | # define ia32_setup_rt_frame __setup_rt_frame | ||
20 | #endif | ||
21 | |||
22 | extern void convert_from_fxsr(struct user_i387_ia32_struct *env, | ||
23 | struct task_struct *tsk); | ||
24 | extern void convert_to_fxsr(struct task_struct *tsk, | ||
25 | const struct user_i387_ia32_struct *env); | ||
26 | |||
27 | unsigned long | ||
28 | fpu__alloc_mathframe(unsigned long sp, int ia32_frame, | ||
29 | unsigned long *buf_fx, unsigned long *size); | ||
30 | |||
31 | #endif /* _ASM_X86_FPU_SIGNAL_H */ | ||
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 1ba866cce00a..b61a5136c0e0 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c | |||
@@ -6,6 +6,8 @@ | |||
6 | * Gareth Hughes <gareth@valinux.com>, May 2000 | 6 | * Gareth Hughes <gareth@valinux.com>, May 2000 |
7 | */ | 7 | */ |
8 | #include <asm/fpu/internal.h> | 8 | #include <asm/fpu/internal.h> |
9 | #include <asm/fpu/signal.h> | ||
10 | |||
9 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index 9bc3734acc16..78710740e9a0 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/cpu.h> | 7 | #include <linux/cpu.h> |
8 | #include <asm/fpu/api.h> | 8 | #include <asm/fpu/api.h> |
9 | #include <asm/fpu/internal.h> | 9 | #include <asm/fpu/internal.h> |
10 | #include <asm/fpu/signal.h> | ||
10 | #include <asm/sigframe.h> | 11 | #include <asm/sigframe.h> |
11 | #include <asm/tlbflush.h> | 12 | #include <asm/tlbflush.h> |
12 | 13 | ||
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 4c615661ec72..51e73a685ce4 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <asm/pgtable.h> | 29 | #include <asm/pgtable.h> |
30 | #include <asm/processor.h> | 30 | #include <asm/processor.h> |
31 | #include <asm/fpu/internal.h> | 31 | #include <asm/fpu/internal.h> |
32 | #include <asm/fpu/signal.h> | ||
32 | #include <asm/debugreg.h> | 33 | #include <asm/debugreg.h> |
33 | #include <asm/ldt.h> | 34 | #include <asm/ldt.h> |
34 | #include <asm/desc.h> | 35 | #include <asm/desc.h> |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index f4b205686527..206996c1669d 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/processor.h> | 27 | #include <asm/processor.h> |
28 | #include <asm/ucontext.h> | 28 | #include <asm/ucontext.h> |
29 | #include <asm/fpu/internal.h> | 29 | #include <asm/fpu/internal.h> |
30 | #include <asm/fpu/signal.h> | ||
30 | #include <asm/vdso.h> | 31 | #include <asm/vdso.h> |
31 | #include <asm/mce.h> | 32 | #include <asm/mce.h> |
32 | #include <asm/sighandling.h> | 33 | #include <asm/sighandling.h> |