aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 16:53:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 16:53:55 -0400
commitfa2e5c073a355465a2a8c9a2fbecf404f9857c3a (patch)
tree771be75e5436031ad53649634dffa67f6667b083
parente44740c1a94b5d39b093045920f543a7bc135584 (diff)
parent97b2f0dc331474fb80ba4f4e4aee1d8e9ffbf7ce (diff)
Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc
Pull exec domain removal from Richard Weinberger: "This series removes execution domain support from Linux. The idea behind exec domains was to support different ABIs. The feature was never complete nor stable. Let's rip it out and make the kernel signal handling code less complicated" * 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc: (27 commits) arm64: Removed unused variable sparc: Fix execution domain removal Remove rest of exec domains. arch: Remove exec_domain from remaining archs arc: Remove signal translation and exec_domain xtensa: Remove signal translation and exec_domain xtensa: Autogenerate offsets in struct thread_info x86: Remove signal translation and exec_domain unicore32: Remove signal translation and exec_domain um: Remove signal translation and exec_domain tile: Remove signal translation and exec_domain sparc: Remove signal translation and exec_domain sh: Remove signal translation and exec_domain s390: Remove signal translation and exec_domain mn10300: Remove signal translation and exec_domain microblaze: Remove signal translation and exec_domain m68k: Remove signal translation and exec_domain m32r: Remove signal translation and exec_domain m32r: Autogenerate offsets in struct thread_info frv: Remove signal translation and exec_domain ...
-rw-r--r--arch/alpha/include/asm/thread_info.h2
-rw-r--r--arch/arc/include/asm/thread_info.h2
-rw-r--r--arch/arc/kernel/signal.c14
-rw-r--r--arch/arm/Kconfig10
-rw-r--r--arch/arm/configs/badge4_defconfig1
-rw-r--r--arch/arm/include/asm/thread_info.h3
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/arthur.c94
-rw-r--r--arch/arm/kernel/asm-offsets.c1
-rw-r--r--arch/arm/kernel/signal.c13
-rw-r--r--arch/arm/kernel/traps.c6
-rw-r--r--arch/arm64/include/asm/thread_info.h3
-rw-r--r--arch/arm64/kernel/asm-offsets.c1
-rw-r--r--arch/arm64/kernel/signal.c7
-rw-r--r--arch/avr32/include/asm/thread_info.h3
-rw-r--r--arch/avr32/kernel/asm-offsets.c1
-rw-r--r--arch/blackfin/include/asm/thread_info.h11
-rw-r--r--arch/blackfin/kernel/asm-offsets.c6
-rw-r--r--arch/blackfin/kernel/signal.c6
-rw-r--r--arch/blackfin/kernel/traps.c1
-rw-r--r--arch/c6x/include/asm/thread_info.h2
-rw-r--r--arch/cris/arch-v10/kernel/signal.c2
-rw-r--r--arch/cris/arch-v32/kernel/signal.c2
-rw-r--r--arch/cris/include/asm/thread_info.h2
-rw-r--r--arch/frv/include/asm/thread_info.h2
-rw-r--r--arch/frv/kernel/asm-offsets.c1
-rw-r--r--arch/frv/kernel/signal.c20
-rw-r--r--arch/hexagon/include/asm/thread_info.h2
-rw-r--r--arch/ia64/include/asm/thread_info.h2
-rw-r--r--arch/ia64/mm/init.c25
-rw-r--r--arch/m32r/include/asm/asm-offsets.h1
-rw-r--r--arch/m32r/include/asm/thread_info.h15
-rw-r--r--arch/m32r/kernel/asm-offsets.c15
-rw-r--r--arch/m32r/kernel/entry.S1
-rw-r--r--arch/m32r/kernel/signal.c12
-rw-r--r--arch/m68k/include/asm/thread_info.h2
-rw-r--r--arch/m68k/kernel/signal.c14
-rw-r--r--arch/metag/include/asm/thread_info.h2
-rw-r--r--arch/metag/kernel/irq.c2
-rw-r--r--arch/microblaze/include/asm/thread_info.h2
-rw-r--r--arch/microblaze/kernel/signal.c9
-rw-r--r--arch/mips/include/asm/thread_info.h2
-rw-r--r--arch/mips/kernel/asm-offsets.c1
-rw-r--r--arch/mn10300/include/asm/thread_info.h2
-rw-r--r--arch/mn10300/kernel/asm-offsets.c2
-rw-r--r--arch/mn10300/kernel/signal.c20
-rw-r--r--arch/nios2/include/asm/thread_info.h2
-rw-r--r--arch/openrisc/include/asm/thread_info.h2
-rw-r--r--arch/openrisc/kernel/signal.c2
-rw-r--r--arch/parisc/include/asm/thread_info.h2
-rw-r--r--arch/parisc/kernel/asm-offsets.c1
-rw-r--r--arch/powerpc/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/kernel/asm-offsets.c1
-rw-r--r--arch/s390/kernel/compat_signal.c14
-rw-r--r--arch/s390/kernel/signal.c14
-rw-r--r--arch/score/include/asm/thread_info.h2
-rw-r--r--arch/score/kernel/asm-offsets.c1
-rw-r--r--arch/sh/include/asm/thread_info.h2
-rw-r--r--arch/sh/kernel/asm-offsets.c1
-rw-r--r--arch/sh/kernel/irq.c2
-rw-r--r--arch/sh/kernel/signal_32.c18
-rw-r--r--arch/sh/kernel/signal_64.c21
-rw-r--r--arch/sparc/include/asm/thread_info_32.h15
-rw-r--r--arch/sparc/include/asm/thread_info_64.h26
-rw-r--r--arch/sparc/kernel/traps_32.c1
-rw-r--r--arch/sparc/kernel/traps_64.c2
-rw-r--r--arch/tile/include/asm/thread_info.h2
-rw-r--r--arch/tile/kernel/compat_signal.c9
-rw-r--r--arch/tile/kernel/signal.c9
-rw-r--r--arch/um/include/asm/thread_info.h2
-rw-r--r--arch/unicore32/include/asm/thread_info.h3
-rw-r--r--arch/unicore32/kernel/asm-offsets.c1
-rw-r--r--arch/unicore32/kernel/signal.c7
-rw-r--r--arch/x86/include/asm/thread_info.h3
-rw-r--r--arch/x86/kernel/signal.c16
-rw-r--r--arch/x86/um/signal.c7
-rw-r--r--arch/xtensa/include/asm/thread_info.h13
-rw-r--r--arch/xtensa/kernel/asm-offsets.c8
-rw-r--r--arch/xtensa/kernel/signal.c11
-rw-r--r--include/linux/personality.h40
-rw-r--r--include/linux/sched.h6
-rw-r--r--kernel/exec_domain.c137
-rw-r--r--kernel/exit.c2
-rw-r--r--kernel/fork.c4
85 files changed, 86 insertions, 675 deletions
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index d5b98ab514bb..32e920a83ae5 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -18,7 +18,6 @@ struct thread_info {
18 unsigned int flags; /* low level flags */ 18 unsigned int flags; /* low level flags */
19 unsigned int ieee_state; /* see fpu.h */ 19 unsigned int ieee_state; /* see fpu.h */
20 20
21 struct exec_domain *exec_domain; /* execution domain */
22 mm_segment_t addr_limit; /* thread address space */ 21 mm_segment_t addr_limit; /* thread address space */
23 unsigned cpu; /* current CPU */ 22 unsigned cpu; /* current CPU */
24 int preempt_count; /* 0 => preemptable, <0 => BUG */ 23 int preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -35,7 +34,6 @@ struct thread_info {
35#define INIT_THREAD_INFO(tsk) \ 34#define INIT_THREAD_INFO(tsk) \
36{ \ 35{ \
37 .task = &tsk, \ 36 .task = &tsk, \
38 .exec_domain = &default_exec_domain, \
39 .addr_limit = KERNEL_DS, \ 37 .addr_limit = KERNEL_DS, \
40 .preempt_count = INIT_PREEMPT_COUNT, \ 38 .preempt_count = INIT_PREEMPT_COUNT, \
41} 39}
diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h
index 1163a1838ac1..aca0d5a45c7b 100644
--- a/arch/arc/include/asm/thread_info.h
+++ b/arch/arc/include/asm/thread_info.h
@@ -43,7 +43,6 @@ struct thread_info {
43 int preempt_count; /* 0 => preemptable, <0 => BUG */ 43 int preempt_count; /* 0 => preemptable, <0 => BUG */
44 struct task_struct *task; /* main task structure */ 44 struct task_struct *task; /* main task structure */
45 mm_segment_t addr_limit; /* thread address space */ 45 mm_segment_t addr_limit; /* thread address space */
46 struct exec_domain *exec_domain;/* execution domain */
47 __u32 cpu; /* current CPU */ 46 __u32 cpu; /* current CPU */
48 unsigned long thr_ptr; /* TLS ptr */ 47 unsigned long thr_ptr; /* TLS ptr */
49}; 48};
@@ -56,7 +55,6 @@ struct thread_info {
56#define INIT_THREAD_INFO(tsk) \ 55#define INIT_THREAD_INFO(tsk) \
57{ \ 56{ \
58 .task = &tsk, \ 57 .task = &tsk, \
59 .exec_domain = &default_exec_domain, \
60 .flags = 0, \ 58 .flags = 0, \
61 .cpu = 0, \ 59 .cpu = 0, \
62 .preempt_count = INIT_PREEMPT_COUNT, \ 60 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c
index edda76fae83f..2251fb4bbfd7 100644
--- a/arch/arc/kernel/signal.c
+++ b/arch/arc/kernel/signal.c
@@ -171,18 +171,6 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
171 return frame; 171 return frame;
172} 172}
173 173
174/*
175 * translate the signal
176 */
177static inline int map_sig(int sig)
178{
179 struct thread_info *thread = current_thread_info();
180 if (thread->exec_domain && thread->exec_domain->signal_invmap
181 && sig < 32)
182 sig = thread->exec_domain->signal_invmap[sig];
183 return sig;
184}
185
186static int 174static int
187setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) 175setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
188{ 176{
@@ -231,7 +219,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
231 return err; 219 return err;
232 220
233 /* #1 arg to the user Signal handler */ 221 /* #1 arg to the user Signal handler */
234 regs->r0 = map_sig(ksig->sig); 222 regs->r0 = ksig->sig;
235 223
236 /* setup PC of user space signal handler */ 224 /* setup PC of user space signal handler */
237 regs->ret = (unsigned long)ksig->ka.sa.sa_handler; 225 regs->ret = (unsigned long)ksig->ka.sa.sa_handler;
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7cbf4ef5c6fd..392e7ae69452 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2133,16 +2133,6 @@ menu "Userspace binary formats"
2133 2133
2134source "fs/Kconfig.binfmt" 2134source "fs/Kconfig.binfmt"
2135 2135
2136config ARTHUR
2137 tristate "RISC OS personality"
2138 depends on !AEABI
2139 help
2140 Say Y here to include the kernel code necessary if you want to run
2141 Acorn RISC OS/Arthur binaries under Linux. This code is still very
2142 experimental; if this sounds frightening, say N and sleep in peace.
2143 You can also say M here to compile this support as a module (which
2144 will be called arthur).
2145
2146endmenu 2136endmenu
2147 2137
2148menu "Power management options" 2138menu "Power management options"
diff --git a/arch/arm/configs/badge4_defconfig b/arch/arm/configs/badge4_defconfig
index 0494c8f229a2..d59009878312 100644
--- a/arch/arm/configs/badge4_defconfig
+++ b/arch/arm/configs/badge4_defconfig
@@ -12,7 +12,6 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
12CONFIG_FPE_NWFPE=y 12CONFIG_FPE_NWFPE=y
13CONFIG_BINFMT_AOUT=m 13CONFIG_BINFMT_AOUT=m
14CONFIG_BINFMT_MISC=m 14CONFIG_BINFMT_MISC=m
15CONFIG_ARTHUR=m
16CONFIG_NET=y 15CONFIG_NET=y
17CONFIG_PACKET=y 16CONFIG_PACKET=y
18CONFIG_UNIX=y 17CONFIG_UNIX=y
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 72812a1f3d1c..bd32eded3e50 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -23,7 +23,6 @@
23#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
24 24
25struct task_struct; 25struct task_struct;
26struct exec_domain;
27 26
28#include <asm/types.h> 27#include <asm/types.h>
29#include <asm/domain.h> 28#include <asm/domain.h>
@@ -53,7 +52,6 @@ struct thread_info {
53 int preempt_count; /* 0 => preemptable, <0 => bug */ 52 int preempt_count; /* 0 => preemptable, <0 => bug */
54 mm_segment_t addr_limit; /* address limit */ 53 mm_segment_t addr_limit; /* address limit */
55 struct task_struct *task; /* main task structure */ 54 struct task_struct *task; /* main task structure */
56 struct exec_domain *exec_domain; /* execution domain */
57 __u32 cpu; /* cpu */ 55 __u32 cpu; /* cpu */
58 __u32 cpu_domain; /* cpu domain */ 56 __u32 cpu_domain; /* cpu domain */
59 struct cpu_context_save cpu_context; /* cpu context */ 57 struct cpu_context_save cpu_context; /* cpu context */
@@ -73,7 +71,6 @@ struct thread_info {
73#define INIT_THREAD_INFO(tsk) \ 71#define INIT_THREAD_INFO(tsk) \
74{ \ 72{ \
75 .task = &tsk, \ 73 .task = &tsk, \
76 .exec_domain = &default_exec_domain, \
77 .flags = 0, \ 74 .flags = 0, \
78 .preempt_count = INIT_PREEMPT_COUNT, \ 75 .preempt_count = INIT_PREEMPT_COUNT, \
79 .addr_limit = KERNEL_DS, \ 76 .addr_limit = KERNEL_DS, \
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index ba5f83226011..752725dcbf42 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o
34obj-$(CONFIG_ISA_DMA_API) += dma.o 34obj-$(CONFIG_ISA_DMA_API) += dma.o
35obj-$(CONFIG_FIQ) += fiq.o fiqasm.o 35obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
36obj-$(CONFIG_MODULES) += armksyms.o module.o 36obj-$(CONFIG_MODULES) += armksyms.o module.o
37obj-$(CONFIG_ARTHUR) += arthur.o
38obj-$(CONFIG_ISA_DMA) += dma-isa.o 37obj-$(CONFIG_ISA_DMA) += dma-isa.o
39obj-$(CONFIG_PCI) += bios32.o isa.o 38obj-$(CONFIG_PCI) += bios32.o isa.o
40obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o 39obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o
diff --git a/arch/arm/kernel/arthur.c b/arch/arm/kernel/arthur.c
deleted file mode 100644
index 321c5291d05f..000000000000
--- a/arch/arm/kernel/arthur.c
+++ /dev/null
@@ -1,94 +0,0 @@
1/*
2 * linux/arch/arm/kernel/arthur.c
3 *
4 * Copyright (C) 1998, 1999, 2000, 2001 Philip Blundell
5 *
6 * Arthur personality
7 */
8
9/*
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/module.h>
17#include <linux/personality.h>
18#include <linux/stddef.h>
19#include <linux/signal.h>
20#include <linux/init.h>
21#include <linux/sched.h>
22
23#include <asm/ptrace.h>
24
25/* Arthur doesn't have many signals, and a lot of those that it does
26 have don't map easily to any Linux equivalent. Never mind. */
27
28#define ARTHUR_SIGABRT 1
29#define ARTHUR_SIGFPE 2
30#define ARTHUR_SIGILL 3
31#define ARTHUR_SIGINT 4
32#define ARTHUR_SIGSEGV 5
33#define ARTHUR_SIGTERM 6
34#define ARTHUR_SIGSTAK 7
35#define ARTHUR_SIGUSR1 8
36#define ARTHUR_SIGUSR2 9
37#define ARTHUR_SIGOSERROR 10
38
39static unsigned long arthur_to_linux_signals[32] = {
40 0, 1, 2, 3, 4, 5, 6, 7,
41 8, 9, 10, 11, 12, 13, 14, 15,
42 16, 17, 18, 19, 20, 21, 22, 23,
43 24, 25, 26, 27, 28, 29, 30, 31
44};
45
46static unsigned long linux_to_arthur_signals[32] = {
47 0, -1, ARTHUR_SIGINT, -1,
48 ARTHUR_SIGILL, 5, ARTHUR_SIGABRT, 7,
49 ARTHUR_SIGFPE, 9, ARTHUR_SIGUSR1, ARTHUR_SIGSEGV,
50 ARTHUR_SIGUSR2, 13, 14, ARTHUR_SIGTERM,
51 16, 17, 18, 19,
52 20, 21, 22, 23,
53 24, 25, 26, 27,
54 28, 29, 30, 31
55};
56
57static void arthur_lcall7(int nr, struct pt_regs *regs)
58{
59 struct siginfo info;
60 info.si_signo = SIGSWI;
61 info.si_errno = nr;
62 /* Bounce it to the emulator */
63 send_sig_info(SIGSWI, &info, current);
64}
65
66static struct exec_domain arthur_exec_domain = {
67 .name = "Arthur",
68 .handler = arthur_lcall7,
69 .pers_low = PER_RISCOS,
70 .pers_high = PER_RISCOS,
71 .signal_map = arthur_to_linux_signals,
72 .signal_invmap = linux_to_arthur_signals,
73 .module = THIS_MODULE,
74};
75
76/*
77 * We could do with some locking to stop Arthur being removed while
78 * processes are using it.
79 */
80
81static int __init arthur_init(void)
82{
83 return register_exec_domain(&arthur_exec_domain);
84}
85
86static void __exit arthur_exit(void)
87{
88 unregister_exec_domain(&arthur_exec_domain);
89}
90
91module_init(arthur_init);
92module_exit(arthur_exit);
93
94MODULE_LICENSE("GPL");
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 61bb5a65eb37..871b8267d211 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -67,7 +67,6 @@ int main(void)
67 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 67 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
68 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); 68 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
69 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 69 DEFINE(TI_TASK, offsetof(struct thread_info, task));
70 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
71 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 70 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
72 DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); 71 DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain));
73 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context)); 72 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 023ac905e4c3..423663e23791 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -318,17 +318,6 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, int framesize)
318 return frame; 318 return frame;
319} 319}
320 320
321/*
322 * translate the signal
323 */
324static inline int map_sig(int sig)
325{
326 struct thread_info *thread = current_thread_info();
327 if (sig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
328 sig = thread->exec_domain->signal_invmap[sig];
329 return sig;
330}
331
332static int 321static int
333setup_return(struct pt_regs *regs, struct ksignal *ksig, 322setup_return(struct pt_regs *regs, struct ksignal *ksig,
334 unsigned long __user *rc, void __user *frame) 323 unsigned long __user *rc, void __user *frame)
@@ -412,7 +401,7 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
412 } 401 }
413 } 402 }
414 403
415 regs->ARM_r0 = map_sig(ksig->sig); 404 regs->ARM_r0 = ksig->sig;
416 regs->ARM_sp = (unsigned long)frame; 405 regs->ARM_sp = (unsigned long)frame;
417 regs->ARM_lr = retcode; 406 regs->ARM_lr = retcode;
418 regs->ARM_pc = handler; 407 regs->ARM_pc = handler;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 788e23fe64d8..3dce1a342030 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -505,12 +505,10 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason)
505 505
506static int bad_syscall(int n, struct pt_regs *regs) 506static int bad_syscall(int n, struct pt_regs *regs)
507{ 507{
508 struct thread_info *thread = current_thread_info();
509 siginfo_t info; 508 siginfo_t info;
510 509
511 if ((current->personality & PER_MASK) != PER_LINUX && 510 if ((current->personality & PER_MASK) != PER_LINUX) {
512 thread->exec_domain->handler) { 511 send_sig(SIGSEGV, current, 1);
513 thread->exec_domain->handler(n, regs);
514 return regs->ARM_r0; 512 return regs->ARM_r0;
515 } 513 }
516 514
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index 702e1e6a0d80..dcd06d18a42a 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -33,7 +33,6 @@
33#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
34 34
35struct task_struct; 35struct task_struct;
36struct exec_domain;
37 36
38#include <asm/types.h> 37#include <asm/types.h>
39 38
@@ -47,7 +46,6 @@ struct thread_info {
47 unsigned long flags; /* low level flags */ 46 unsigned long flags; /* low level flags */
48 mm_segment_t addr_limit; /* address limit */ 47 mm_segment_t addr_limit; /* address limit */
49 struct task_struct *task; /* main task structure */ 48 struct task_struct *task; /* main task structure */
50 struct exec_domain *exec_domain; /* execution domain */
51 int preempt_count; /* 0 => preemptable, <0 => bug */ 49 int preempt_count; /* 0 => preemptable, <0 => bug */
52 int cpu; /* cpu */ 50 int cpu; /* cpu */
53}; 51};
@@ -55,7 +53,6 @@ struct thread_info {
55#define INIT_THREAD_INFO(tsk) \ 53#define INIT_THREAD_INFO(tsk) \
56{ \ 54{ \
57 .task = &tsk, \ 55 .task = &tsk, \
58 .exec_domain = &default_exec_domain, \
59 .flags = 0, \ 56 .flags = 0, \
60 .preempt_count = INIT_PREEMPT_COUNT, \ 57 .preempt_count = INIT_PREEMPT_COUNT, \
61 .addr_limit = KERNEL_DS, \ 58 .addr_limit = KERNEL_DS, \
diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c
index f7fa65d4c352..56cadd3606bf 100644
--- a/arch/arm64/kernel/asm-offsets.c
+++ b/arch/arm64/kernel/asm-offsets.c
@@ -38,7 +38,6 @@ int main(void)
38 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 38 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
39 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); 39 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
40 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 40 DEFINE(TI_TASK, offsetof(struct thread_info, task));
41 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
42 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 41 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
43 BLANK(); 42 BLANK();
44 DEFINE(THREAD_CPU_CONTEXT, offsetof(struct task_struct, thread.cpu_context)); 43 DEFINE(THREAD_CPU_CONTEXT, offsetof(struct task_struct, thread.cpu_context));
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index 660ccf9f7524..e18c48cb6db1 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -287,19 +287,12 @@ static void setup_restart_syscall(struct pt_regs *regs)
287 */ 287 */
288static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) 288static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
289{ 289{
290 struct thread_info *thread = current_thread_info();
291 struct task_struct *tsk = current; 290 struct task_struct *tsk = current;
292 sigset_t *oldset = sigmask_to_save(); 291 sigset_t *oldset = sigmask_to_save();
293 int usig = ksig->sig; 292 int usig = ksig->sig;
294 int ret; 293 int ret;
295 294
296 /* 295 /*
297 * translate the signal
298 */
299 if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
300 usig = thread->exec_domain->signal_invmap[usig];
301
302 /*
303 * Set up the stack frame 296 * Set up the stack frame
304 */ 297 */
305 if (is_compat_task()) { 298 if (is_compat_task()) {
diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
index d56afa99a514..d4d3079541ea 100644
--- a/arch/avr32/include/asm/thread_info.h
+++ b/arch/avr32/include/asm/thread_info.h
@@ -17,11 +17,9 @@
17#include <asm/types.h> 17#include <asm/types.h>
18 18
19struct task_struct; 19struct task_struct;
20struct exec_domain;
21 20
22struct thread_info { 21struct thread_info {
23 struct task_struct *task; /* main task structure */ 22 struct task_struct *task; /* main task structure */
24 struct exec_domain *exec_domain; /* execution domain */
25 unsigned long flags; /* low level flags */ 23 unsigned long flags; /* low level flags */
26 __u32 cpu; 24 __u32 cpu;
27 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 25 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -36,7 +34,6 @@ struct thread_info {
36#define INIT_THREAD_INFO(tsk) \ 34#define INIT_THREAD_INFO(tsk) \
37{ \ 35{ \
38 .task = &tsk, \ 36 .task = &tsk, \
39 .exec_domain = &default_exec_domain, \
40 .flags = 0, \ 37 .flags = 0, \
41 .cpu = 0, \ 38 .cpu = 0, \
42 .preempt_count = INIT_PREEMPT_COUNT, \ 39 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/avr32/kernel/asm-offsets.c b/arch/avr32/kernel/asm-offsets.c
index e41c84516e5d..2c9764fe3532 100644
--- a/arch/avr32/kernel/asm-offsets.c
+++ b/arch/avr32/kernel/asm-offsets.c
@@ -12,7 +12,6 @@
12void foo(void) 12void foo(void)
13{ 13{
14 OFFSET(TI_task, thread_info, task); 14 OFFSET(TI_task, thread_info, task);
15 OFFSET(TI_exec_domain, thread_info, exec_domain);
16 OFFSET(TI_flags, thread_info, flags); 15 OFFSET(TI_flags, thread_info, flags);
17 OFFSET(TI_cpu, thread_info, cpu); 16 OFFSET(TI_cpu, thread_info, cpu);
18 OFFSET(TI_preempt_count, thread_info, preempt_count); 17 OFFSET(TI_preempt_count, thread_info, preempt_count);
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 57c3a8bd583d..2966b93850a1 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -37,7 +37,6 @@ typedef unsigned long mm_segment_t;
37 37
38struct thread_info { 38struct thread_info {
39 struct task_struct *task; /* main task structure */ 39 struct task_struct *task; /* main task structure */
40 struct exec_domain *exec_domain; /* execution domain */
41 unsigned long flags; /* low level flags */ 40 unsigned long flags; /* low level flags */
42 int cpu; /* cpu we're on */ 41 int cpu; /* cpu we're on */
43 int preempt_count; /* 0 => preemptable, <0 => BUG */ 42 int preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -53,7 +52,6 @@ struct thread_info {
53#define INIT_THREAD_INFO(tsk) \ 52#define INIT_THREAD_INFO(tsk) \
54{ \ 53{ \
55 .task = &tsk, \ 54 .task = &tsk, \
56 .exec_domain = &default_exec_domain, \
57 .flags = 0, \ 55 .flags = 0, \
58 .cpu = 0, \ 56 .cpu = 0, \
59 .preempt_count = INIT_PREEMPT_COUNT, \ 57 .preempt_count = INIT_PREEMPT_COUNT, \
@@ -76,15 +74,6 @@ static inline struct thread_info *current_thread_info(void)
76#endif /* __ASSEMBLY__ */ 74#endif /* __ASSEMBLY__ */
77 75
78/* 76/*
79 * Offsets in thread_info structure, used in assembly code
80 */
81#define TI_TASK 0
82#define TI_EXECDOMAIN 4
83#define TI_FLAGS 8
84#define TI_CPU 12
85#define TI_PREEMPT 16
86
87/*
88 * thread information flag bit numbers 77 * thread information flag bit numbers
89 */ 78 */
90#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 79#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c
index 37fcae950216..486560aea050 100644
--- a/arch/blackfin/kernel/asm-offsets.c
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -42,6 +42,12 @@ int main(void)
42 DEFINE(THREAD_PC, offsetof(struct thread_struct, pc)); 42 DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
43 DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE); 43 DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
44 44
45 /* offsets in thread_info struct */
46 OFFSET(TI_TASK, thread_info, task);
47 OFFSET(TI_FLAGS, thread_info, flags);
48 OFFSET(TI_CPU, thread_info, cpu);
49 OFFSET(TI_PREEMPT, thread_info, preempt_count);
50
45 /* offsets into the pt_regs */ 51 /* offsets into the pt_regs */
46 DEFINE(PT_ORIG_R0, offsetof(struct pt_regs, orig_r0)); 52 DEFINE(PT_ORIG_R0, offsetof(struct pt_regs, orig_r0));
47 DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0)); 53 DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index f2a8b5493bd3..ea570db598e5 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -151,11 +151,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
151 151
152 frame = get_sigframe(ksig, sizeof(*frame)); 152 frame = get_sigframe(ksig, sizeof(*frame));
153 153
154 err |= __put_user((current_thread_info()->exec_domain 154 err |= __put_user(ksig->sig, &frame->sig);
155 && current_thread_info()->exec_domain->signal_invmap
156 && ksig->sig < 32
157 ? current_thread_info()->exec_domain->
158 signal_invmap[ksig->sig] : ksig->sig), &frame->sig);
159 155
160 err |= __put_user(&frame->info, &frame->pinfo); 156 err |= __put_user(&frame->info, &frame->pinfo);
161 err |= __put_user(&frame->uc, &frame->puc); 157 err |= __put_user(&frame->uc, &frame->puc);
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index de5c2c3ebd9b..1ed85ddadc0d 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -18,6 +18,7 @@
18#include <asm/fixed_code.h> 18#include <asm/fixed_code.h>
19#include <asm/pseudo_instructions.h> 19#include <asm/pseudo_instructions.h>
20#include <asm/pda.h> 20#include <asm/pda.h>
21#include <asm/asm-offsets.h>
21 22
22#ifdef CONFIG_KGDB 23#ifdef CONFIG_KGDB
23# include <linux/kgdb.h> 24# include <linux/kgdb.h>
diff --git a/arch/c6x/include/asm/thread_info.h b/arch/c6x/include/asm/thread_info.h
index 584e253f3217..acc70c135ab8 100644
--- a/arch/c6x/include/asm/thread_info.h
+++ b/arch/c6x/include/asm/thread_info.h
@@ -40,7 +40,6 @@ typedef struct {
40 */ 40 */
41struct thread_info { 41struct thread_info {
42 struct task_struct *task; /* main task structure */ 42 struct task_struct *task; /* main task structure */
43 struct exec_domain *exec_domain; /* execution domain */
44 unsigned long flags; /* low level flags */ 43 unsigned long flags; /* low level flags */
45 int cpu; /* cpu we're on */ 44 int cpu; /* cpu we're on */
46 int preempt_count; /* 0 = preemptable, <0 = BUG */ 45 int preempt_count; /* 0 = preemptable, <0 = BUG */
@@ -55,7 +54,6 @@ struct thread_info {
55#define INIT_THREAD_INFO(tsk) \ 54#define INIT_THREAD_INFO(tsk) \
56{ \ 55{ \
57 .task = &tsk, \ 56 .task = &tsk, \
58 .exec_domain = &default_exec_domain, \
59 .flags = 0, \ 57 .flags = 0, \
60 .cpu = 0, \ 58 .cpu = 0, \
61 .preempt_count = INIT_PREEMPT_COUNT, \ 59 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 74d7ba35120d..7122d9773b13 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -321,8 +321,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
321 if (err) 321 if (err)
322 return -EFAULT; 322 return -EFAULT;
323 323
324 /* TODO what is the current->exec_domain stuff and invmap ? */
325
326 /* Set up registers for signal handler */ 324 /* Set up registers for signal handler */
327 325
328 /* What we enter NOW */ 326 /* What we enter NOW */
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index 870e3e069318..0c9ce9eac614 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -287,8 +287,6 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
287 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 287 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
288 return -EFAULT; 288 return -EFAULT;
289 289
290 /* TODO: what is the current->exec_domain stuff and invmap ? */
291
292 err |= __put_user(&frame->info, &frame->pinfo); 290 err |= __put_user(&frame->info, &frame->pinfo);
293 err |= __put_user(&frame->uc, &frame->puc); 291 err |= __put_user(&frame->uc, &frame->puc);
294 err |= copy_siginfo_to_user(&frame->info, &ksig->info); 292 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h
index 7286db5ed90e..4ead1b40d2d7 100644
--- a/arch/cris/include/asm/thread_info.h
+++ b/arch/cris/include/asm/thread_info.h
@@ -28,7 +28,6 @@
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29struct thread_info { 29struct thread_info {
30 struct task_struct *task; /* main task structure */ 30 struct task_struct *task; /* main task structure */
31 struct exec_domain *exec_domain; /* execution domain */
32 unsigned long flags; /* low level flags */ 31 unsigned long flags; /* low level flags */
33 __u32 cpu; /* current CPU */ 32 __u32 cpu; /* current CPU */
34 int preempt_count; /* 0 => preemptable, <0 => BUG */ 33 int preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -50,7 +49,6 @@ struct thread_info {
50#define INIT_THREAD_INFO(tsk) \ 49#define INIT_THREAD_INFO(tsk) \
51{ \ 50{ \
52 .task = &tsk, \ 51 .task = &tsk, \
53 .exec_domain = &default_exec_domain, \
54 .flags = 0, \ 52 .flags = 0, \
55 .cpu = 0, \ 53 .cpu = 0, \
56 .preempt_count = INIT_PREEMPT_COUNT, \ 54 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index 6b917f1c2955..ccba3b6ce918 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -31,7 +31,6 @@
31 31
32struct thread_info { 32struct thread_info {
33 struct task_struct *task; /* main task structure */ 33 struct task_struct *task; /* main task structure */
34 struct exec_domain *exec_domain; /* execution domain */
35 unsigned long flags; /* low level flags */ 34 unsigned long flags; /* low level flags */
36 unsigned long status; /* thread-synchronous flags */ 35 unsigned long status; /* thread-synchronous flags */
37 __u32 cpu; /* current CPU */ 36 __u32 cpu; /* current CPU */
@@ -59,7 +58,6 @@ struct thread_info {
59#define INIT_THREAD_INFO(tsk) \ 58#define INIT_THREAD_INFO(tsk) \
60{ \ 59{ \
61 .task = &tsk, \ 60 .task = &tsk, \
62 .exec_domain = &default_exec_domain, \
63 .flags = 0, \ 61 .flags = 0, \
64 .cpu = 0, \ 62 .cpu = 0, \
65 .preempt_count = INIT_PREEMPT_COUNT, \ 63 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/frv/kernel/asm-offsets.c b/arch/frv/kernel/asm-offsets.c
index 446e89d500cc..8414293f213a 100644
--- a/arch/frv/kernel/asm-offsets.c
+++ b/arch/frv/kernel/asm-offsets.c
@@ -34,7 +34,6 @@ void foo(void)
34{ 34{
35 /* offsets into the thread_info structure */ 35 /* offsets into the thread_info structure */
36 OFFSET(TI_TASK, thread_info, task); 36 OFFSET(TI_TASK, thread_info, task);
37 OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
38 OFFSET(TI_FLAGS, thread_info, flags); 37 OFFSET(TI_FLAGS, thread_info, flags);
39 OFFSET(TI_STATUS, thread_info, status); 38 OFFSET(TI_STATUS, thread_info, status);
40 OFFSET(TI_CPU, thread_info, cpu); 39 OFFSET(TI_CPU, thread_info, cpu);
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 85ca6727ca07..82d5e914dc15 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -174,20 +174,14 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
174static int setup_frame(struct ksignal *ksig, sigset_t *set) 174static int setup_frame(struct ksignal *ksig, sigset_t *set)
175{ 175{
176 struct sigframe __user *frame; 176 struct sigframe __user *frame;
177 int rsig, sig = ksig->sig; 177 int sig = ksig->sig;
178 178
179 frame = get_sigframe(ksig, sizeof(*frame)); 179 frame = get_sigframe(ksig, sizeof(*frame));
180 180
181 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 181 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
182 return -EFAULT; 182 return -EFAULT;
183 183
184 rsig = sig; 184 if (__put_user(sig, &frame->sig) < 0)
185 if (sig < 32 &&
186 __current_thread_info->exec_domain &&
187 __current_thread_info->exec_domain->signal_invmap)
188 rsig = __current_thread_info->exec_domain->signal_invmap[sig];
189
190 if (__put_user(rsig, &frame->sig) < 0)
191 return -EFAULT; 185 return -EFAULT;
192 186
193 if (setup_sigcontext(&frame->sc, set->sig[0])) 187 if (setup_sigcontext(&frame->sc, set->sig[0]))
@@ -253,20 +247,14 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
253static int setup_rt_frame(struct ksignal *ksig, sigset_t *set) 247static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
254{ 248{
255 struct rt_sigframe __user *frame; 249 struct rt_sigframe __user *frame;
256 int rsig, sig = ksig->sig; 250 int sig = ksig->sig;
257 251
258 frame = get_sigframe(ksig, sizeof(*frame)); 252 frame = get_sigframe(ksig, sizeof(*frame));
259 253
260 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 254 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
261 return -EFAULT; 255 return -EFAULT;
262 256
263 rsig = sig; 257 if (__put_user(sig, &frame->sig) ||
264 if (sig < 32 &&
265 __current_thread_info->exec_domain &&
266 __current_thread_info->exec_domain->signal_invmap)
267 rsig = __current_thread_info->exec_domain->signal_invmap[sig];
268
269 if (__put_user(rsig, &frame->sig) ||
270 __put_user(&frame->info, &frame->pinfo) || 258 __put_user(&frame->info, &frame->pinfo) ||
271 __put_user(&frame->uc, &frame->puc)) 259 __put_user(&frame->uc, &frame->puc))
272 return -EFAULT; 260 return -EFAULT;
diff --git a/arch/hexagon/include/asm/thread_info.h b/arch/hexagon/include/asm/thread_info.h
index bacd3d6030c5..b80fe1db7b64 100644
--- a/arch/hexagon/include/asm/thread_info.h
+++ b/arch/hexagon/include/asm/thread_info.h
@@ -47,7 +47,6 @@ typedef struct {
47 47
48struct thread_info { 48struct thread_info {
49 struct task_struct *task; /* main task structure */ 49 struct task_struct *task; /* main task structure */
50 struct exec_domain *exec_domain; /* execution domain */
51 unsigned long flags; /* low level flags */ 50 unsigned long flags; /* low level flags */
52 __u32 cpu; /* current cpu */ 51 __u32 cpu; /* current cpu */
53 int preempt_count; /* 0=>preemptible,<0=>BUG */ 52 int preempt_count; /* 0=>preemptible,<0=>BUG */
@@ -77,7 +76,6 @@ struct thread_info {
77#define INIT_THREAD_INFO(tsk) \ 76#define INIT_THREAD_INFO(tsk) \
78{ \ 77{ \
79 .task = &tsk, \ 78 .task = &tsk, \
80 .exec_domain = &default_exec_domain, \
81 .flags = 0, \ 79 .flags = 0, \
82 .cpu = 0, \ 80 .cpu = 0, \
83 .preempt_count = 1, \ 81 .preempt_count = 1, \
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index c16f21a068ff..aa995b67c3f5 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -20,7 +20,6 @@
20 */ 20 */
21struct thread_info { 21struct thread_info {
22 struct task_struct *task; /* XXX not really needed, except for dup_task_struct() */ 22 struct task_struct *task; /* XXX not really needed, except for dup_task_struct() */
23 struct exec_domain *exec_domain;/* execution domain */
24 __u32 flags; /* thread_info flags (see TIF_*) */ 23 __u32 flags; /* thread_info flags (see TIF_*) */
25 __u32 cpu; /* current CPU */ 24 __u32 cpu; /* current CPU */
26 __u32 last_cpu; /* Last CPU thread ran on */ 25 __u32 last_cpu; /* Last CPU thread ran on */
@@ -40,7 +39,6 @@ struct thread_info {
40#define INIT_THREAD_INFO(tsk) \ 39#define INIT_THREAD_INFO(tsk) \
41{ \ 40{ \
42 .task = &tsk, \ 41 .task = &tsk, \
43 .exec_domain = &default_exec_domain, \
44 .flags = 0, \ 42 .flags = 0, \
45 .cpu = 0, \ 43 .cpu = 0, \
46 .addr_limit = KERNEL_DS, \ 44 .addr_limit = KERNEL_DS, \
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 6b3345758d3e..a9b65cf7b34a 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -692,31 +692,6 @@ int arch_remove_memory(u64 start, u64 size)
692#endif 692#endif
693#endif 693#endif
694 694
695/*
696 * Even when CONFIG_IA32_SUPPORT is not enabled it is
697 * useful to have the Linux/x86 domain registered to
698 * avoid an attempted module load when emulators call
699 * personality(PER_LINUX32). This saves several milliseconds
700 * on each such call.
701 */
702static struct exec_domain ia32_exec_domain;
703
704static int __init
705per_linux32_init(void)
706{
707 ia32_exec_domain.name = "Linux/x86";
708 ia32_exec_domain.handler = NULL;
709 ia32_exec_domain.pers_low = PER_LINUX32;
710 ia32_exec_domain.pers_high = PER_LINUX32;
711 ia32_exec_domain.signal_map = default_exec_domain.signal_map;
712 ia32_exec_domain.signal_invmap = default_exec_domain.signal_invmap;
713 register_exec_domain(&ia32_exec_domain);
714
715 return 0;
716}
717
718__initcall(per_linux32_init);
719
720/** 695/**
721 * show_mem - give short summary of memory stats 696 * show_mem - give short summary of memory stats
722 * 697 *
diff --git a/arch/m32r/include/asm/asm-offsets.h b/arch/m32r/include/asm/asm-offsets.h
new file mode 100644
index 000000000000..d370ee36a182
--- /dev/null
+++ b/arch/m32r/include/asm/asm-offsets.h
@@ -0,0 +1 @@
#include <generated/asm-offsets.h>
diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
index 32422d0211c3..f630d9c30b28 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -24,7 +24,6 @@
24 24
25struct thread_info { 25struct thread_info {
26 struct task_struct *task; /* main task structure */ 26 struct task_struct *task; /* main task structure */
27 struct exec_domain *exec_domain; /* execution domain */
28 unsigned long flags; /* low level flags */ 27 unsigned long flags; /* low level flags */
29 unsigned long status; /* thread-synchronous flags */ 28 unsigned long status; /* thread-synchronous flags */
30 __u32 cpu; /* current CPU */ 29 __u32 cpu; /* current CPU */
@@ -38,18 +37,7 @@ struct thread_info {
38 __u8 supervisor_stack[0]; 37 __u8 supervisor_stack[0];
39}; 38};
40 39
41#else /* !__ASSEMBLY__ */ 40#endif /* !__ASSEMBLY__ */
42
43/* offsets into the thread_info struct for assembly code access */
44#define TI_TASK 0x00000000
45#define TI_EXEC_DOMAIN 0x00000004
46#define TI_FLAGS 0x00000008
47#define TI_STATUS 0x0000000C
48#define TI_CPU 0x00000010
49#define TI_PRE_COUNT 0x00000014
50#define TI_ADDR_LIMIT 0x00000018
51
52#endif
53 41
54#define THREAD_SIZE (PAGE_SIZE << 1) 42#define THREAD_SIZE (PAGE_SIZE << 1)
55#define THREAD_SIZE_ORDER 1 43#define THREAD_SIZE_ORDER 1
@@ -61,7 +49,6 @@ struct thread_info {
61#define INIT_THREAD_INFO(tsk) \ 49#define INIT_THREAD_INFO(tsk) \
62{ \ 50{ \
63 .task = &tsk, \ 51 .task = &tsk, \
64 .exec_domain = &default_exec_domain, \
65 .flags = 0, \ 52 .flags = 0, \
66 .cpu = 0, \ 53 .cpu = 0, \
67 .preempt_count = INIT_PREEMPT_COUNT, \ 54 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/m32r/kernel/asm-offsets.c b/arch/m32r/kernel/asm-offsets.c
index 9e263112a6e2..cd3d2fc9c8df 100644
--- a/arch/m32r/kernel/asm-offsets.c
+++ b/arch/m32r/kernel/asm-offsets.c
@@ -1 +1,14 @@
1/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */ 1#include <linux/thread_info.h>
2#include <linux/kbuild.h>
3
4int foo(void)
5{
6 OFFSET(TI_TASK, thread_info, task);
7 OFFSET(TI_FLAGS, thread_info, flags);
8 OFFSET(TI_STATUS, thread_info, status);
9 OFFSET(TI_CPU, thread_info, cpu);
10 OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
11 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
12
13 return 0;
14}
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S
index 7c3db9940ce1..c639bfa32232 100644
--- a/arch/m32r/kernel/entry.S
+++ b/arch/m32r/kernel/entry.S
@@ -65,6 +65,7 @@
65#include <asm/page.h> 65#include <asm/page.h>
66#include <asm/m32r.h> 66#include <asm/m32r.h>
67#include <asm/mmu_context.h> 67#include <asm/mmu_context.h>
68#include <asm/asm-offsets.h>
68 69
69#if !defined(CONFIG_MMU) 70#if !defined(CONFIG_MMU)
70#define sys_madvise sys_ni_syscall 71#define sys_madvise sys_ni_syscall
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 8c25e0c8f6a5..1c81e24fd006 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -172,20 +172,14 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
172{ 172{
173 struct rt_sigframe __user *frame; 173 struct rt_sigframe __user *frame;
174 int err = 0; 174 int err = 0;
175 int signal, sig = ksig->sig; 175 int sig = ksig->sig;
176 176
177 frame = get_sigframe(ksig, regs->spu, sizeof(*frame)); 177 frame = get_sigframe(ksig, regs->spu, sizeof(*frame));
178 178
179 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 179 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
180 return -EFAULT; 180 return -EFAULT;
181 181
182 signal = current_thread_info()->exec_domain 182 err |= __put_user(sig, &frame->sig);
183 && current_thread_info()->exec_domain->signal_invmap
184 && sig < 32
185 ? current_thread_info()->exec_domain->signal_invmap[sig]
186 : sig;
187
188 err |= __put_user(signal, &frame->sig);
189 if (err) 183 if (err)
190 return -EFAULT; 184 return -EFAULT;
191 185
@@ -209,7 +203,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
209 203
210 /* Set up registers for signal handler */ 204 /* Set up registers for signal handler */
211 regs->spu = (unsigned long)frame; 205 regs->spu = (unsigned long)frame;
212 regs->r0 = signal; /* Arg for signal handler */ 206 regs->r0 = sig; /* Arg for signal handler */
213 regs->r1 = (unsigned long)&frame->info; 207 regs->r1 = (unsigned long)&frame->info;
214 regs->r2 = (unsigned long)&frame->uc; 208 regs->r2 = (unsigned long)&frame->uc;
215 regs->bpc = (unsigned long)ksig->ka.sa.sa_handler; 209 regs->bpc = (unsigned long)ksig->ka.sa.sa_handler;
diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h
index c54256e69e64..cee13c2e5161 100644
--- a/arch/m68k/include/asm/thread_info.h
+++ b/arch/m68k/include/asm/thread_info.h
@@ -26,7 +26,6 @@
26struct thread_info { 26struct thread_info {
27 struct task_struct *task; /* main task structure */ 27 struct task_struct *task; /* main task structure */
28 unsigned long flags; 28 unsigned long flags;
29 struct exec_domain *exec_domain; /* execution domain */
30 mm_segment_t addr_limit; /* thread address space */ 29 mm_segment_t addr_limit; /* thread address space */
31 int preempt_count; /* 0 => preemptable, <0 => BUG */ 30 int preempt_count; /* 0 => preemptable, <0 => BUG */
32 __u32 cpu; /* should always be 0 on m68k */ 31 __u32 cpu; /* should always be 0 on m68k */
@@ -37,7 +36,6 @@ struct thread_info {
37#define INIT_THREAD_INFO(tsk) \ 36#define INIT_THREAD_INFO(tsk) \
38{ \ 37{ \
39 .task = &tsk, \ 38 .task = &tsk, \
40 .exec_domain = &default_exec_domain, \
41 .addr_limit = KERNEL_DS, \ 39 .addr_limit = KERNEL_DS, \
42 .preempt_count = INIT_PREEMPT_COUNT, \ 40 .preempt_count = INIT_PREEMPT_COUNT, \
43} 41}
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index d7179281e74a..af1c4f330aef 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -863,12 +863,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
863 if (fsize) 863 if (fsize)
864 err |= copy_to_user (frame + 1, regs + 1, fsize); 864 err |= copy_to_user (frame + 1, regs + 1, fsize);
865 865
866 err |= __put_user((current_thread_info()->exec_domain 866 err |= __put_user(sig, &frame->sig);
867 && current_thread_info()->exec_domain->signal_invmap
868 && sig < 32
869 ? current_thread_info()->exec_domain->signal_invmap[sig]
870 : sig),
871 &frame->sig);
872 867
873 err |= __put_user(regs->vector, &frame->code); 868 err |= __put_user(regs->vector, &frame->code);
874 err |= __put_user(&frame->sc, &frame->psc); 869 err |= __put_user(&frame->sc, &frame->psc);
@@ -948,12 +943,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
948 if (fsize) 943 if (fsize)
949 err |= copy_to_user (&frame->uc.uc_extra, regs + 1, fsize); 944 err |= copy_to_user (&frame->uc.uc_extra, regs + 1, fsize);
950 945
951 err |= __put_user((current_thread_info()->exec_domain 946 err |= __put_user(sig, &frame->sig);
952 && current_thread_info()->exec_domain->signal_invmap
953 && sig < 32
954 ? current_thread_info()->exec_domain->signal_invmap[sig]
955 : sig),
956 &frame->sig);
957 err |= __put_user(&frame->info, &frame->pinfo); 947 err |= __put_user(&frame->info, &frame->pinfo);
958 err |= __put_user(&frame->uc, &frame->puc); 948 err |= __put_user(&frame->uc, &frame->puc);
959 err |= copy_siginfo_to_user(&frame->info, &ksig->info); 949 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
diff --git a/arch/metag/include/asm/thread_info.h b/arch/metag/include/asm/thread_info.h
index afb3ca4776d1..32677cc278aa 100644
--- a/arch/metag/include/asm/thread_info.h
+++ b/arch/metag/include/asm/thread_info.h
@@ -28,7 +28,6 @@
28/* This must be 8 byte aligned so we can ensure stack alignment. */ 28/* This must be 8 byte aligned so we can ensure stack alignment. */
29struct thread_info { 29struct thread_info {
30 struct task_struct *task; /* main task structure */ 30 struct task_struct *task; /* main task structure */
31 struct exec_domain *exec_domain; /* execution domain */
32 unsigned long flags; /* low level flags */ 31 unsigned long flags; /* low level flags */
33 unsigned long status; /* thread-synchronous flags */ 32 unsigned long status; /* thread-synchronous flags */
34 u32 cpu; /* current CPU */ 33 u32 cpu; /* current CPU */
@@ -68,7 +67,6 @@ struct thread_info {
68#define INIT_THREAD_INFO(tsk) \ 67#define INIT_THREAD_INFO(tsk) \
69{ \ 68{ \
70 .task = &tsk, \ 69 .task = &tsk, \
71 .exec_domain = &default_exec_domain, \
72 .flags = 0, \ 70 .flags = 0, \
73 .cpu = 0, \ 71 .cpu = 0, \
74 .preempt_count = INIT_PREEMPT_COUNT, \ 72 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/metag/kernel/irq.c b/arch/metag/kernel/irq.c
index 5385dd1216b7..4f8f1f87ef11 100644
--- a/arch/metag/kernel/irq.c
+++ b/arch/metag/kernel/irq.c
@@ -132,7 +132,6 @@ void irq_ctx_init(int cpu)
132 132
133 irqctx = (union irq_ctx *) &hardirq_stack[cpu * THREAD_SIZE]; 133 irqctx = (union irq_ctx *) &hardirq_stack[cpu * THREAD_SIZE];
134 irqctx->tinfo.task = NULL; 134 irqctx->tinfo.task = NULL;
135 irqctx->tinfo.exec_domain = NULL;
136 irqctx->tinfo.cpu = cpu; 135 irqctx->tinfo.cpu = cpu;
137 irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; 136 irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
138 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); 137 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
@@ -141,7 +140,6 @@ void irq_ctx_init(int cpu)
141 140
142 irqctx = (union irq_ctx *) &softirq_stack[cpu * THREAD_SIZE]; 141 irqctx = (union irq_ctx *) &softirq_stack[cpu * THREAD_SIZE];
143 irqctx->tinfo.task = NULL; 142 irqctx->tinfo.task = NULL;
144 irqctx->tinfo.exec_domain = NULL;
145 irqctx->tinfo.cpu = cpu; 143 irqctx->tinfo.cpu = cpu;
146 irqctx->tinfo.preempt_count = 0; 144 irqctx->tinfo.preempt_count = 0;
147 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); 145 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index b699fbd7de4a..383f387b4eee 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -65,7 +65,6 @@ typedef struct {
65 65
66struct thread_info { 66struct thread_info {
67 struct task_struct *task; /* main task structure */ 67 struct task_struct *task; /* main task structure */
68 struct exec_domain *exec_domain; /* execution domain */
69 unsigned long flags; /* low level flags */ 68 unsigned long flags; /* low level flags */
70 unsigned long status; /* thread-synchronous flags */ 69 unsigned long status; /* thread-synchronous flags */
71 __u32 cpu; /* current CPU */ 70 __u32 cpu; /* current CPU */
@@ -81,7 +80,6 @@ struct thread_info {
81#define INIT_THREAD_INFO(tsk) \ 80#define INIT_THREAD_INFO(tsk) \
82{ \ 81{ \
83 .task = &tsk, \ 82 .task = &tsk, \
84 .exec_domain = &default_exec_domain, \
85 .flags = 0, \ 83 .flags = 0, \
86 .cpu = 0, \ 84 .cpu = 0, \
87 .preempt_count = INIT_PREEMPT_COUNT, \ 85 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index 20ccd4e2baa5..97001524ca2d 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -158,7 +158,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
158{ 158{
159 struct rt_sigframe __user *frame; 159 struct rt_sigframe __user *frame;
160 int err = 0, sig = ksig->sig; 160 int err = 0, sig = ksig->sig;
161 unsigned long signal;
162 unsigned long address = 0; 161 unsigned long address = 0;
163#ifdef CONFIG_MMU 162#ifdef CONFIG_MMU
164 pmd_t *pmdp; 163 pmd_t *pmdp;
@@ -170,12 +169,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
170 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 169 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
171 return -EFAULT; 170 return -EFAULT;
172 171
173 signal = current_thread_info()->exec_domain
174 && current_thread_info()->exec_domain->signal_invmap
175 && sig < 32
176 ? current_thread_info()->exec_domain->signal_invmap[sig]
177 : (unsigned long)sig;
178
179 if (ksig->ka.sa.sa_flags & SA_SIGINFO) 172 if (ksig->ka.sa.sa_flags & SA_SIGINFO)
180 err |= copy_siginfo_to_user(&frame->info, &ksig->info); 173 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
181 174
@@ -230,7 +223,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
230 regs->r1 = (unsigned long) frame; 223 regs->r1 = (unsigned long) frame;
231 224
232 /* Signal handler args: */ 225 /* Signal handler args: */
233 regs->r5 = signal; /* arg 0: signum */ 226 regs->r5 = sig; /* arg 0: signum */
234 regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */ 227 regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */
235 regs->r7 = (unsigned long) &frame->uc; /* arg2: ucontext */ 228 regs->r7 = (unsigned long) &frame->uc; /* arg2: ucontext */
236 /* Offset to handle microblaze rtid r14, 0 */ 229 /* Offset to handle microblaze rtid r14, 0 */
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 55ed6602204c..8408a30c47f3 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -23,7 +23,6 @@
23 */ 23 */
24struct thread_info { 24struct thread_info {
25 struct task_struct *task; /* main task structure */ 25 struct task_struct *task; /* main task structure */
26 struct exec_domain *exec_domain; /* execution domain */
27 unsigned long flags; /* low level flags */ 26 unsigned long flags; /* low level flags */
28 unsigned long tp_value; /* thread pointer */ 27 unsigned long tp_value; /* thread pointer */
29 __u32 cpu; /* current CPU */ 28 __u32 cpu; /* current CPU */
@@ -44,7 +43,6 @@ struct thread_info {
44#define INIT_THREAD_INFO(tsk) \ 43#define INIT_THREAD_INFO(tsk) \
45{ \ 44{ \
46 .task = &tsk, \ 45 .task = &tsk, \
47 .exec_domain = &default_exec_domain, \
48 .flags = _TIF_FIXADE, \ 46 .flags = _TIF_FIXADE, \
49 .cpu = 0, \ 47 .cpu = 0, \
50 .preempt_count = INIT_PREEMPT_COUNT, \ 48 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index e59fd7cfac9e..beabe19ff8e5 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -92,7 +92,6 @@ void output_thread_info_defines(void)
92{ 92{
93 COMMENT("MIPS thread_info offsets."); 93 COMMENT("MIPS thread_info offsets.");
94 OFFSET(TI_TASK, thread_info, task); 94 OFFSET(TI_TASK, thread_info, task);
95 OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
96 OFFSET(TI_FLAGS, thread_info, flags); 95 OFFSET(TI_FLAGS, thread_info, flags);
97 OFFSET(TI_TP_VALUE, thread_info, tp_value); 96 OFFSET(TI_TP_VALUE, thread_info, tp_value);
98 OFFSET(TI_CPU, thread_info, cpu); 97 OFFSET(TI_CPU, thread_info, cpu);
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index c1c374f0ec12..4861a78c7160 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -40,7 +40,6 @@ typedef struct {
40 40
41struct thread_info { 41struct thread_info {
42 struct task_struct *task; /* main task structure */ 42 struct task_struct *task; /* main task structure */
43 struct exec_domain *exec_domain; /* execution domain */
44 struct pt_regs *frame; /* current exception frame */ 43 struct pt_regs *frame; /* current exception frame */
45 unsigned long flags; /* low level flags */ 44 unsigned long flags; /* low level flags */
46 __u32 cpu; /* current CPU */ 45 __u32 cpu; /* current CPU */
@@ -74,7 +73,6 @@ struct thread_info {
74#define INIT_THREAD_INFO(tsk) \ 73#define INIT_THREAD_INFO(tsk) \
75{ \ 74{ \
76 .task = &tsk, \ 75 .task = &tsk, \
77 .exec_domain = &default_exec_domain, \
78 .flags = 0, \ 76 .flags = 0, \
79 .cpu = 0, \ 77 .cpu = 0, \
80 .preempt_count = INIT_PREEMPT_COUNT, \ 78 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/mn10300/kernel/asm-offsets.c b/arch/mn10300/kernel/asm-offsets.c
index d780670cbaf3..e5a61c659b5a 100644
--- a/arch/mn10300/kernel/asm-offsets.c
+++ b/arch/mn10300/kernel/asm-offsets.c
@@ -22,7 +22,6 @@ void foo(void)
22 BLANK(); 22 BLANK();
23 23
24 OFFSET(TI_task, thread_info, task); 24 OFFSET(TI_task, thread_info, task);
25 OFFSET(TI_exec_domain, thread_info, exec_domain);
26 OFFSET(TI_frame, thread_info, frame); 25 OFFSET(TI_frame, thread_info, frame);
27 OFFSET(TI_flags, thread_info, flags); 26 OFFSET(TI_flags, thread_info, flags);
28 OFFSET(TI_cpu, thread_info, cpu); 27 OFFSET(TI_cpu, thread_info, cpu);
@@ -85,7 +84,6 @@ void foo(void)
85 DEFINE(SIGCHLD_asm, SIGCHLD); 84 DEFINE(SIGCHLD_asm, SIGCHLD);
86 BLANK(); 85 BLANK();
87 86
88 OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
89 OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); 87 OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
90 88
91 DEFINE(PAGE_SIZE_asm, PAGE_SIZE); 89 DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 8609845f12c5..dfd0301cf200 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -202,20 +202,14 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
202 struct pt_regs *regs) 202 struct pt_regs *regs)
203{ 203{
204 struct sigframe __user *frame; 204 struct sigframe __user *frame;
205 int rsig, sig = ksig->sig; 205 int sig = ksig->sig;
206 206
207 frame = get_sigframe(ksig, regs, sizeof(*frame)); 207 frame = get_sigframe(ksig, regs, sizeof(*frame));
208 208
209 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 209 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
210 return -EFAULT; 210 return -EFAULT;
211 211
212 rsig = sig; 212 if (__put_user(sig, &frame->sig) < 0 ||
213 if (sig < 32 &&
214 current_thread_info()->exec_domain &&
215 current_thread_info()->exec_domain->signal_invmap)
216 rsig = current_thread_info()->exec_domain->signal_invmap[sig];
217
218 if (__put_user(rsig, &frame->sig) < 0 ||
219 __put_user(&frame->sc, &frame->psc) < 0) 213 __put_user(&frame->sc, &frame->psc) < 0)
220 return -EFAULT; 214 return -EFAULT;
221 215
@@ -270,20 +264,14 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
270 struct pt_regs *regs) 264 struct pt_regs *regs)
271{ 265{
272 struct rt_sigframe __user *frame; 266 struct rt_sigframe __user *frame;
273 int rsig, sig = ksig->sig; 267 int sig = ksig->sig;
274 268
275 frame = get_sigframe(ksig, regs, sizeof(*frame)); 269 frame = get_sigframe(ksig, regs, sizeof(*frame));
276 270
277 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 271 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
278 return -EFAULT; 272 return -EFAULT;
279 273
280 rsig = sig; 274 if (__put_user(sig, &frame->sig) ||
281 if (sig < 32 &&
282 current_thread_info()->exec_domain &&
283 current_thread_info()->exec_domain->signal_invmap)
284 rsig = current_thread_info()->exec_domain->signal_invmap[sig];
285
286 if (__put_user(rsig, &frame->sig) ||
287 __put_user(&frame->info, &frame->pinfo) || 275 __put_user(&frame->info, &frame->pinfo) ||
288 __put_user(&frame->uc, &frame->puc) || 276 __put_user(&frame->uc, &frame->puc) ||
289 copy_siginfo_to_user(&frame->info, &ksig->info)) 277 copy_siginfo_to_user(&frame->info, &ksig->info))
diff --git a/arch/nios2/include/asm/thread_info.h b/arch/nios2/include/asm/thread_info.h
index a16e55cbd8ad..d69c338bd19c 100644
--- a/arch/nios2/include/asm/thread_info.h
+++ b/arch/nios2/include/asm/thread_info.h
@@ -39,7 +39,6 @@ typedef struct {
39 */ 39 */
40struct thread_info { 40struct thread_info {
41 struct task_struct *task; /* main task structure */ 41 struct task_struct *task; /* main task structure */
42 struct exec_domain *exec_domain; /* execution domain */
43 unsigned long flags; /* low level flags */ 42 unsigned long flags; /* low level flags */
44 __u32 cpu; /* current CPU */ 43 __u32 cpu; /* current CPU */
45 int preempt_count; /* 0 => preemptable,<0 => BUG */ 44 int preempt_count; /* 0 => preemptable,<0 => BUG */
@@ -58,7 +57,6 @@ struct thread_info {
58#define INIT_THREAD_INFO(tsk) \ 57#define INIT_THREAD_INFO(tsk) \
59{ \ 58{ \
60 .task = &tsk, \ 59 .task = &tsk, \
61 .exec_domain = &default_exec_domain, \
62 .flags = 0, \ 60 .flags = 0, \
63 .cpu = 0, \ 61 .cpu = 0, \
64 .preempt_count = INIT_PREEMPT_COUNT, \ 62 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/openrisc/include/asm/thread_info.h b/arch/openrisc/include/asm/thread_info.h
index 875f0845a707..6e619a79a401 100644
--- a/arch/openrisc/include/asm/thread_info.h
+++ b/arch/openrisc/include/asm/thread_info.h
@@ -48,7 +48,6 @@ typedef unsigned long mm_segment_t;
48 48
49struct thread_info { 49struct thread_info {
50 struct task_struct *task; /* main task structure */ 50 struct task_struct *task; /* main task structure */
51 struct exec_domain *exec_domain; /* execution domain */
52 unsigned long flags; /* low level flags */ 51 unsigned long flags; /* low level flags */
53 __u32 cpu; /* current CPU */ 52 __u32 cpu; /* current CPU */
54 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 53 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -73,7 +72,6 @@ struct thread_info {
73#define INIT_THREAD_INFO(tsk) \ 72#define INIT_THREAD_INFO(tsk) \
74{ \ 73{ \
75 .task = &tsk, \ 74 .task = &tsk, \
76 .exec_domain = &default_exec_domain, \
77 .flags = 0, \ 75 .flags = 0, \
78 .cpu = 0, \ 76 .cpu = 0, \
79 .preempt_count = 1, \ 77 .preempt_count = 1, \
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c
index 4112175bf803..c82be69b43c6 100644
--- a/arch/openrisc/kernel/signal.c
+++ b/arch/openrisc/kernel/signal.c
@@ -193,8 +193,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
193 if (err) 193 if (err)
194 return -EFAULT; 194 return -EFAULT;
195 195
196 /* TODO what is the current->exec_domain stuff and invmap ? */
197
198 /* Set up registers for signal handler */ 196 /* Set up registers for signal handler */
199 regs->pc = (unsigned long)ksig->ka.sa.sa_handler; /* what we enter NOW */ 197 regs->pc = (unsigned long)ksig->ka.sa.sa_handler; /* what we enter NOW */
200 regs->gpr[9] = (unsigned long)return_ip; /* what we enter LATER */ 198 regs->gpr[9] = (unsigned long)return_ip; /* what we enter LATER */
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
index fb13e3865563..e96e693fd58c 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -9,7 +9,6 @@
9 9
10struct thread_info { 10struct thread_info {
11 struct task_struct *task; /* main task structure */ 11 struct task_struct *task; /* main task structure */
12 struct exec_domain *exec_domain;/* execution domain */
13 unsigned long flags; /* thread_info flags (see TIF_*) */ 12 unsigned long flags; /* thread_info flags (see TIF_*) */
14 mm_segment_t addr_limit; /* user-level address space limit */ 13 mm_segment_t addr_limit; /* user-level address space limit */
15 __u32 cpu; /* current CPU */ 14 __u32 cpu; /* current CPU */
@@ -19,7 +18,6 @@ struct thread_info {
19#define INIT_THREAD_INFO(tsk) \ 18#define INIT_THREAD_INFO(tsk) \
20{ \ 19{ \
21 .task = &tsk, \ 20 .task = &tsk, \
22 .exec_domain = &default_exec_domain, \
23 .flags = 0, \ 21 .flags = 0, \
24 .cpu = 0, \ 22 .cpu = 0, \
25 .addr_limit = KERNEL_DS, \ 23 .addr_limit = KERNEL_DS, \
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index dcd55103a4bb..59001cea13f9 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -242,7 +242,6 @@ int main(void)
242 DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN)); 242 DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN));
243 BLANK(); 243 BLANK();
244 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 244 DEFINE(TI_TASK, offsetof(struct thread_info, task));
245 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
246 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 245 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
247 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 246 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
248 DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit)); 247 DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit));
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 72489799cf02..7efee4a3240b 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -39,7 +39,6 @@
39 */ 39 */
40struct thread_info { 40struct thread_info {
41 struct task_struct *task; /* main task structure */ 41 struct task_struct *task; /* main task structure */
42 struct exec_domain *exec_domain; /* execution domain */
43 int cpu; /* cpu we're on */ 42 int cpu; /* cpu we're on */
44 int preempt_count; /* 0 => preemptable, 43 int preempt_count; /* 0 => preemptable,
45 <0 => BUG */ 44 <0 => BUG */
@@ -55,7 +54,6 @@ struct thread_info {
55#define INIT_THREAD_INFO(tsk) \ 54#define INIT_THREAD_INFO(tsk) \
56{ \ 55{ \
57 .task = &tsk, \ 56 .task = &tsk, \
58 .exec_domain = &default_exec_domain, \
59 .cpu = 0, \ 57 .cpu = 0, \
60 .preempt_count = INIT_PREEMPT_COUNT, \ 58 .preempt_count = INIT_PREEMPT_COUNT, \
61 .flags = 0, \ 59 .flags = 0, \
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index d532098d98bf..4c27ec764c36 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -29,7 +29,6 @@
29 */ 29 */
30struct thread_info { 30struct thread_info {
31 struct task_struct *task; /* main task structure */ 31 struct task_struct *task; /* main task structure */
32 struct exec_domain *exec_domain; /* execution domain */
33 unsigned long flags; /* low level flags */ 32 unsigned long flags; /* low level flags */
34 unsigned long sys_call_table; /* System call table address */ 33 unsigned long sys_call_table; /* System call table address */
35 unsigned int cpu; /* current CPU */ 34 unsigned int cpu; /* current CPU */
@@ -46,7 +45,6 @@ struct thread_info {
46#define INIT_THREAD_INFO(tsk) \ 45#define INIT_THREAD_INFO(tsk) \
47{ \ 46{ \
48 .task = &tsk, \ 47 .task = &tsk, \
49 .exec_domain = &default_exec_domain, \
50 .flags = 0, \ 48 .flags = 0, \
51 .cpu = 0, \ 49 .cpu = 0, \
52 .preempt_count = INIT_PREEMPT_COUNT, \ 50 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index f35058da8eaf..c7d1b9d09011 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -34,7 +34,6 @@ int main(void)
34 DEFINE(__THREAD_per_paid, offsetof(struct task_struct, thread.per_event.paid)); 34 DEFINE(__THREAD_per_paid, offsetof(struct task_struct, thread.per_event.paid));
35 BLANK(); 35 BLANK();
36 DEFINE(__TI_task, offsetof(struct thread_info, task)); 36 DEFINE(__TI_task, offsetof(struct thread_info, task));
37 DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain));
38 DEFINE(__TI_flags, offsetof(struct thread_info, flags)); 37 DEFINE(__TI_flags, offsetof(struct thread_info, flags));
39 DEFINE(__TI_sysc_table, offsetof(struct thread_info, sys_call_table)); 38 DEFINE(__TI_sysc_table, offsetof(struct thread_info, sys_call_table));
40 DEFINE(__TI_cpu, offsetof(struct thread_info, cpu)); 39 DEFINE(__TI_cpu, offsetof(struct thread_info, cpu));
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index bc1df12dd4f8..fe8d6924efaa 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -370,16 +370,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
370 return (void __user *)((sp - frame_size) & -8ul); 370 return (void __user *)((sp - frame_size) & -8ul);
371} 371}
372 372
373static inline int map_signal(int sig)
374{
375 if (current_thread_info()->exec_domain
376 && current_thread_info()->exec_domain->signal_invmap
377 && sig < 32)
378 return current_thread_info()->exec_domain->signal_invmap[sig];
379 else
380 return sig;
381}
382
383static int setup_frame32(struct ksignal *ksig, sigset_t *set, 373static int setup_frame32(struct ksignal *ksig, sigset_t *set,
384 struct pt_regs *regs) 374 struct pt_regs *regs)
385{ 375{
@@ -449,7 +439,7 @@ static int setup_frame32(struct ksignal *ksig, sigset_t *set,
449 (regs->psw.mask & ~PSW_MASK_ASC); 439 (regs->psw.mask & ~PSW_MASK_ASC);
450 regs->psw.addr = (__force __u64) ksig->ka.sa.sa_handler; 440 regs->psw.addr = (__force __u64) ksig->ka.sa.sa_handler;
451 441
452 regs->gprs[2] = map_signal(sig); 442 regs->gprs[2] = sig;
453 regs->gprs[3] = (__force __u64) &frame->sc; 443 regs->gprs[3] = (__force __u64) &frame->sc;
454 444
455 /* We forgot to include these in the sigcontext. 445 /* We forgot to include these in the sigcontext.
@@ -532,7 +522,7 @@ static int setup_rt_frame32(struct ksignal *ksig, sigset_t *set,
532 (regs->psw.mask & ~PSW_MASK_ASC); 522 (regs->psw.mask & ~PSW_MASK_ASC);
533 regs->psw.addr = (__u64 __force) ksig->ka.sa.sa_handler; 523 regs->psw.addr = (__u64 __force) ksig->ka.sa.sa_handler;
534 524
535 regs->gprs[2] = map_signal(ksig->sig); 525 regs->gprs[2] = ksig->sig;
536 regs->gprs[3] = (__force __u64) &frame->info; 526 regs->gprs[3] = (__force __u64) &frame->info;
537 regs->gprs[4] = (__force __u64) &frame->uc; 527 regs->gprs[4] = (__force __u64) &frame->uc;
538 regs->gprs[5] = task_thread_info(current)->last_break; 528 regs->gprs[5] = task_thread_info(current)->last_break;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 7fec60cb0b75..c551f22ce066 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -301,16 +301,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
301 return (void __user *)((sp - frame_size) & -8ul); 301 return (void __user *)((sp - frame_size) & -8ul);
302} 302}
303 303
304static inline int map_signal(int sig)
305{
306 if (current_thread_info()->exec_domain
307 && current_thread_info()->exec_domain->signal_invmap
308 && sig < 32)
309 return current_thread_info()->exec_domain->signal_invmap[sig];
310 else
311 return sig;
312}
313
314static int setup_frame(int sig, struct k_sigaction *ka, 304static int setup_frame(int sig, struct k_sigaction *ka,
315 sigset_t *set, struct pt_regs * regs) 305 sigset_t *set, struct pt_regs * regs)
316{ 306{
@@ -378,7 +368,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
378 (regs->psw.mask & ~PSW_MASK_ASC); 368 (regs->psw.mask & ~PSW_MASK_ASC);
379 regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; 369 regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE;
380 370
381 regs->gprs[2] = map_signal(sig); 371 regs->gprs[2] = sig;
382 regs->gprs[3] = (unsigned long) &frame->sc; 372 regs->gprs[3] = (unsigned long) &frame->sc;
383 373
384 /* We forgot to include these in the sigcontext. 374 /* We forgot to include these in the sigcontext.
@@ -458,7 +448,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
458 (regs->psw.mask & ~PSW_MASK_ASC); 448 (regs->psw.mask & ~PSW_MASK_ASC);
459 regs->psw.addr = (unsigned long) ksig->ka.sa.sa_handler | PSW_ADDR_AMODE; 449 regs->psw.addr = (unsigned long) ksig->ka.sa.sa_handler | PSW_ADDR_AMODE;
460 450
461 regs->gprs[2] = map_signal(ksig->sig); 451 regs->gprs[2] = ksig->sig;
462 regs->gprs[3] = (unsigned long) &frame->info; 452 regs->gprs[3] = (unsigned long) &frame->info;
463 regs->gprs[4] = (unsigned long) &frame->uc; 453 regs->gprs[4] = (unsigned long) &frame->uc;
464 regs->gprs[5] = task_thread_info(current)->last_break; 454 regs->gprs[5] = task_thread_info(current)->last_break;
diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h
index 33864fa2a8d4..7d9ffb15c477 100644
--- a/arch/score/include/asm/thread_info.h
+++ b/arch/score/include/asm/thread_info.h
@@ -28,7 +28,6 @@
28 */ 28 */
29struct thread_info { 29struct thread_info {
30 struct task_struct *task; /* main task structure */ 30 struct task_struct *task; /* main task structure */
31 struct exec_domain *exec_domain; /* execution domain */
32 unsigned long flags; /* low level flags */ 31 unsigned long flags; /* low level flags */
33 unsigned long tp_value; /* thread pointer */ 32 unsigned long tp_value; /* thread pointer */
34 __u32 cpu; /* current CPU */ 33 __u32 cpu; /* current CPU */
@@ -53,7 +52,6 @@ struct thread_info {
53#define INIT_THREAD_INFO(tsk) \ 52#define INIT_THREAD_INFO(tsk) \
54{ \ 53{ \
55 .task = &tsk, \ 54 .task = &tsk, \
56 .exec_domain = &default_exec_domain, \
57 .cpu = 0, \ 55 .cpu = 0, \
58 .preempt_count = 1, \ 56 .preempt_count = 1, \
59 .addr_limit = KERNEL_DS, \ 57 .addr_limit = KERNEL_DS, \
diff --git a/arch/score/kernel/asm-offsets.c b/arch/score/kernel/asm-offsets.c
index b4d5214a7a7e..52794f9421e2 100644
--- a/arch/score/kernel/asm-offsets.c
+++ b/arch/score/kernel/asm-offsets.c
@@ -100,7 +100,6 @@ void output_thread_info_defines(void)
100{ 100{
101 COMMENT("SCORE thread_info offsets."); 101 COMMENT("SCORE thread_info offsets.");
102 OFFSET(TI_TASK, thread_info, task); 102 OFFSET(TI_TASK, thread_info, task);
103 OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
104 OFFSET(TI_FLAGS, thread_info, flags); 103 OFFSET(TI_FLAGS, thread_info, flags);
105 OFFSET(TI_TP_VALUE, thread_info, tp_value); 104 OFFSET(TI_TP_VALUE, thread_info, tp_value);
106 OFFSET(TI_CPU, thread_info, cpu); 105 OFFSET(TI_CPU, thread_info, cpu);
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index 657c03919627..2afa321157be 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -27,7 +27,6 @@
27 27
28struct thread_info { 28struct thread_info {
29 struct task_struct *task; /* main task structure */ 29 struct task_struct *task; /* main task structure */
30 struct exec_domain *exec_domain; /* execution domain */
31 unsigned long flags; /* low level flags */ 30 unsigned long flags; /* low level flags */
32 __u32 status; /* thread synchronous flags */ 31 __u32 status; /* thread synchronous flags */
33 __u32 cpu; 32 __u32 cpu;
@@ -56,7 +55,6 @@ struct thread_info {
56#define INIT_THREAD_INFO(tsk) \ 55#define INIT_THREAD_INFO(tsk) \
57{ \ 56{ \
58 .task = &tsk, \ 57 .task = &tsk, \
59 .exec_domain = &default_exec_domain, \
60 .flags = 0, \ 58 .flags = 0, \
61 .status = 0, \ 59 .status = 0, \
62 .cpu = 0, \ 60 .cpu = 0, \
diff --git a/arch/sh/kernel/asm-offsets.c b/arch/sh/kernel/asm-offsets.c
index 542225fedb11..4bd44da910f3 100644
--- a/arch/sh/kernel/asm-offsets.c
+++ b/arch/sh/kernel/asm-offsets.c
@@ -21,7 +21,6 @@ int main(void)
21{ 21{
22 /* offsets into the thread_info struct */ 22 /* offsets into the thread_info struct */
23 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 23 DEFINE(TI_TASK, offsetof(struct thread_info, task));
24 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
25 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 24 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
26 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 25 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
27 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); 26 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 65a1ecd77f96..eb10ff84015c 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -124,7 +124,6 @@ void irq_ctx_init(int cpu)
124 124
125 irqctx = (union irq_ctx *)&hardirq_stack[cpu * THREAD_SIZE]; 125 irqctx = (union irq_ctx *)&hardirq_stack[cpu * THREAD_SIZE];
126 irqctx->tinfo.task = NULL; 126 irqctx->tinfo.task = NULL;
127 irqctx->tinfo.exec_domain = NULL;
128 irqctx->tinfo.cpu = cpu; 127 irqctx->tinfo.cpu = cpu;
129 irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; 128 irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
130 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); 129 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
@@ -133,7 +132,6 @@ void irq_ctx_init(int cpu)
133 132
134 irqctx = (union irq_ctx *)&softirq_stack[cpu * THREAD_SIZE]; 133 irqctx = (union irq_ctx *)&softirq_stack[cpu * THREAD_SIZE];
135 irqctx->tinfo.task = NULL; 134 irqctx->tinfo.task = NULL;
136 irqctx->tinfo.exec_domain = NULL;
137 irqctx->tinfo.cpu = cpu; 135 irqctx->tinfo.cpu = cpu;
138 irqctx->tinfo.preempt_count = 0; 136 irqctx->tinfo.preempt_count = 0;
139 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); 137 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index 97292890b51b..f7c3d5c25caf 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -267,19 +267,12 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
267{ 267{
268 struct sigframe __user *frame; 268 struct sigframe __user *frame;
269 int err = 0, sig = ksig->sig; 269 int err = 0, sig = ksig->sig;
270 int signal;
271 270
272 frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); 271 frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame));
273 272
274 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 273 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
275 return -EFAULT; 274 return -EFAULT;
276 275
277 signal = current_thread_info()->exec_domain
278 && current_thread_info()->exec_domain->signal_invmap
279 && sig < 32
280 ? current_thread_info()->exec_domain->signal_invmap[sig]
281 : sig;
282
283 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); 276 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
284 277
285 if (_NSIG_WORDS > 1) 278 if (_NSIG_WORDS > 1)
@@ -313,7 +306,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
313 306
314 /* Set up registers for signal handler */ 307 /* Set up registers for signal handler */
315 regs->regs[15] = (unsigned long) frame; 308 regs->regs[15] = (unsigned long) frame;
316 regs->regs[4] = signal; /* Arg for signal handler */ 309 regs->regs[4] = sig; /* Arg for signal handler */
317 regs->regs[5] = 0; 310 regs->regs[5] = 0;
318 regs->regs[6] = (unsigned long) &frame->sc; 311 regs->regs[6] = (unsigned long) &frame->sc;
319 312
@@ -340,19 +333,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
340{ 333{
341 struct rt_sigframe __user *frame; 334 struct rt_sigframe __user *frame;
342 int err = 0, sig = ksig->sig; 335 int err = 0, sig = ksig->sig;
343 int signal;
344 336
345 frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); 337 frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame));
346 338
347 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 339 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
348 return -EFAULT; 340 return -EFAULT;
349 341
350 signal = current_thread_info()->exec_domain
351 && current_thread_info()->exec_domain->signal_invmap
352 && sig < 32
353 ? current_thread_info()->exec_domain->signal_invmap[sig]
354 : sig;
355
356 err |= copy_siginfo_to_user(&frame->info, &ksig->info); 342 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
357 343
358 /* Create the ucontext. */ 344 /* Create the ucontext. */
@@ -390,7 +376,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
390 376
391 /* Set up registers for signal handler */ 377 /* Set up registers for signal handler */
392 regs->regs[15] = (unsigned long) frame; 378 regs->regs[15] = (unsigned long) frame;
393 regs->regs[4] = signal; /* Arg for signal handler */ 379 regs->regs[4] = sig; /* Arg for signal handler */
394 regs->regs[5] = (unsigned long) &frame->info; 380 regs->regs[5] = (unsigned long) &frame->info;
395 regs->regs[6] = (unsigned long) &frame->uc; 381 regs->regs[6] = (unsigned long) &frame->uc;
396 382
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index 0462995d4d7f..d8a3f0d22809 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -385,12 +385,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
385 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 385 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
386 return -EFAULT; 386 return -EFAULT;
387 387
388 signal = current_thread_info()->exec_domain
389 && current_thread_info()->exec_domain->signal_invmap
390 && sig < 32
391 ? current_thread_info()->exec_domain->signal_invmap[sig]
392 : sig;
393
394 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); 388 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
395 389
396 /* Give up earlier as i386, in case */ 390 /* Give up earlier as i386, in case */
@@ -441,7 +435,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
441 * All edited pointers are subject to NEFF. 435 * All edited pointers are subject to NEFF.
442 */ 436 */
443 regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); 437 regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame);
444 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ 438 regs->regs[REG_ARG1] = sig; /* Arg for signal handler */
445 439
446 /* FIXME: 440 /* FIXME:
447 The glibc profiling support for SH-5 needs to be passed a sigcontext 441 The glibc profiling support for SH-5 needs to be passed a sigcontext
@@ -459,7 +453,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
459 453
460 /* Broken %016Lx */ 454 /* Broken %016Lx */
461 pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n", 455 pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n",
462 signal, current->comm, current->pid, frame, 456 sig, current->comm, current->pid, frame,
463 regs->pc >> 32, regs->pc & 0xffffffff, 457 regs->pc >> 32, regs->pc & 0xffffffff,
464 DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff); 458 DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff);
465 459
@@ -471,19 +465,12 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set,
471{ 465{
472 struct rt_sigframe __user *frame; 466 struct rt_sigframe __user *frame;
473 int err = 0, sig = ksig->sig; 467 int err = 0, sig = ksig->sig;
474 int signal;
475 468
476 frame = get_sigframe(&ksig->ka, regs->regs[REG_SP], sizeof(*frame)); 469 frame = get_sigframe(&ksig->ka, regs->regs[REG_SP], sizeof(*frame));
477 470
478 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 471 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
479 return -EFAULT; 472 return -EFAULT;
480 473
481 signal = current_thread_info()->exec_domain
482 && current_thread_info()->exec_domain->signal_invmap
483 && sig < 32
484 ? current_thread_info()->exec_domain->signal_invmap[sig]
485 : sig;
486
487 err |= __put_user(&frame->info, &frame->pinfo); 474 err |= __put_user(&frame->info, &frame->pinfo);
488 err |= __put_user(&frame->uc, &frame->puc); 475 err |= __put_user(&frame->uc, &frame->puc);
489 err |= copy_siginfo_to_user(&frame->info, &ksig->info); 476 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
@@ -540,13 +527,13 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set,
540 * All edited pointers are subject to NEFF. 527 * All edited pointers are subject to NEFF.
541 */ 528 */
542 regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); 529 regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame);
543 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ 530 regs->regs[REG_ARG1] = sig; /* Arg for signal handler */
544 regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info; 531 regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info;
545 regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext; 532 regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext;
546 regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler); 533 regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler);
547 534
548 pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n", 535 pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n",
549 signal, current->comm, current->pid, frame, 536 sig, current->comm, current->pid, frame,
550 regs->pc >> 32, regs->pc & 0xffffffff, 537 regs->pc >> 32, regs->pc & 0xffffffff,
551 DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff); 538 DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff);
552 539
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index fd7bd0a440ca..229475f0d7ce 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -27,7 +27,6 @@
27struct thread_info { 27struct thread_info {
28 unsigned long uwinmask; 28 unsigned long uwinmask;
29 struct task_struct *task; /* main task structure */ 29 struct task_struct *task; /* main task structure */
30 struct exec_domain *exec_domain; /* execution domain */
31 unsigned long flags; /* low level flags */ 30 unsigned long flags; /* low level flags */
32 int cpu; /* cpu we're on */ 31 int cpu; /* cpu we're on */
33 int preempt_count; /* 0 => preemptable, 32 int preempt_count; /* 0 => preemptable,
@@ -35,6 +34,8 @@ struct thread_info {
35 int softirq_count; 34 int softirq_count;
36 int hardirq_count; 35 int hardirq_count;
37 36
37 u32 __unused;
38
38 /* Context switch saved kernel state. */ 39 /* Context switch saved kernel state. */
39 unsigned long ksp; /* ... ksp __attribute__ ((aligned (8))); */ 40 unsigned long ksp; /* ... ksp __attribute__ ((aligned (8))); */
40 unsigned long kpc; 41 unsigned long kpc;
@@ -56,7 +57,6 @@ struct thread_info {
56{ \ 57{ \
57 .uwinmask = 0, \ 58 .uwinmask = 0, \
58 .task = &tsk, \ 59 .task = &tsk, \
59 .exec_domain = &default_exec_domain, \
60 .flags = 0, \ 60 .flags = 0, \
61 .cpu = 0, \ 61 .cpu = 0, \
62 .preempt_count = INIT_PREEMPT_COUNT, \ 62 .preempt_count = INIT_PREEMPT_COUNT, \
@@ -85,12 +85,11 @@ register struct thread_info *current_thread_info_reg asm("g6");
85 */ 85 */
86#define TI_UWINMASK 0x00 /* uwinmask */ 86#define TI_UWINMASK 0x00 /* uwinmask */
87#define TI_TASK 0x04 87#define TI_TASK 0x04
88#define TI_EXECDOMAIN 0x08 /* exec_domain */ 88#define TI_FLAGS 0x08
89#define TI_FLAGS 0x0c 89#define TI_CPU 0x0c
90#define TI_CPU 0x10 90#define TI_PREEMPT 0x10 /* preempt_count */
91#define TI_PREEMPT 0x14 /* preempt_count */ 91#define TI_SOFTIRQ 0x14 /* softirq_count */
92#define TI_SOFTIRQ 0x18 /* softirq_count */ 92#define TI_HARDIRQ 0x18 /* hardirq_count */
93#define TI_HARDIRQ 0x1c /* hardirq_count */
94#define TI_KSP 0x20 /* ksp */ 93#define TI_KSP 0x20 /* ksp */
95#define TI_KPC 0x24 /* kpc (ldd'ed with kpc) */ 94#define TI_KPC 0x24 /* kpc (ldd'ed with kpc) */
96#define TI_KPSR 0x28 /* kpsr */ 95#define TI_KPSR 0x28 /* kpsr */
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index ff455164732a..bde59825d06c 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -31,7 +31,6 @@
31#include <asm/types.h> 31#include <asm/types.h>
32 32
33struct task_struct; 33struct task_struct;
34struct exec_domain;
35 34
36struct thread_info { 35struct thread_info {
37 /* D$ line 1 */ 36 /* D$ line 1 */
@@ -44,7 +43,6 @@ struct thread_info {
44 /* D$ line 2 */ 43 /* D$ line 2 */
45 unsigned long fault_address; 44 unsigned long fault_address;
46 struct pt_regs *kregs; 45 struct pt_regs *kregs;
47 struct exec_domain *exec_domain;
48 int preempt_count; /* 0 => preemptable, <0 => BUG */ 46 int preempt_count; /* 0 => preemptable, <0 => BUG */
49 __u8 new_child; 47 __u8 new_child;
50 __u8 current_ds; 48 __u8 current_ds;
@@ -80,18 +78,17 @@ struct thread_info {
80#define TI_KSP 0x00000018 78#define TI_KSP 0x00000018
81#define TI_FAULT_ADDR 0x00000020 79#define TI_FAULT_ADDR 0x00000020
82#define TI_KREGS 0x00000028 80#define TI_KREGS 0x00000028
83#define TI_EXEC_DOMAIN 0x00000030 81#define TI_PRE_COUNT 0x00000030
84#define TI_PRE_COUNT 0x00000038 82#define TI_NEW_CHILD 0x00000034
85#define TI_NEW_CHILD 0x0000003c 83#define TI_CURRENT_DS 0x00000035
86#define TI_CURRENT_DS 0x0000003d 84#define TI_CPU 0x00000036
87#define TI_CPU 0x0000003e 85#define TI_UTRAPS 0x00000038
88#define TI_UTRAPS 0x00000040 86#define TI_REG_WINDOW 0x00000040
89#define TI_REG_WINDOW 0x00000048 87#define TI_RWIN_SPTRS 0x000003c0
90#define TI_RWIN_SPTRS 0x000003c8 88#define TI_GSR 0x000003f8
91#define TI_GSR 0x00000400 89#define TI_XFSR 0x00000430
92#define TI_XFSR 0x00000438 90#define TI_KUNA_REGS 0x00000468
93#define TI_KUNA_REGS 0x00000470 91#define TI_KUNA_INSN 0x00000470
94#define TI_KUNA_INSN 0x00000478
95#define TI_FPREGS 0x00000480 92#define TI_FPREGS 0x00000480
96 93
97/* We embed this in the uppermost byte of thread_info->flags */ 94/* We embed this in the uppermost byte of thread_info->flags */
@@ -119,7 +116,6 @@ struct thread_info {
119{ \ 116{ \
120 .task = &tsk, \ 117 .task = &tsk, \
121 .current_ds = ASI_P, \ 118 .current_ds = ASI_P, \
122 .exec_domain = &default_exec_domain, \
123 .preempt_count = INIT_PREEMPT_COUNT, \ 119 .preempt_count = INIT_PREEMPT_COUNT, \
124} 120}
125 121
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 6fd386c5232a..4f21df7d4f13 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -433,7 +433,6 @@ void trap_init(void)
433 /* Force linker to barf if mismatched */ 433 /* Force linker to barf if mismatched */
434 if (TI_UWINMASK != offsetof(struct thread_info, uwinmask) || 434 if (TI_UWINMASK != offsetof(struct thread_info, uwinmask) ||
435 TI_TASK != offsetof(struct thread_info, task) || 435 TI_TASK != offsetof(struct thread_info, task) ||
436 TI_EXECDOMAIN != offsetof(struct thread_info, exec_domain) ||
437 TI_FLAGS != offsetof(struct thread_info, flags) || 436 TI_FLAGS != offsetof(struct thread_info, flags) ||
438 TI_CPU != offsetof(struct thread_info, cpu) || 437 TI_CPU != offsetof(struct thread_info, cpu) ||
439 TI_PREEMPT != offsetof(struct thread_info, preempt_count) || 438 TI_PREEMPT != offsetof(struct thread_info, preempt_count) ||
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index 0e699745d643..d21cd625c0de 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2691,8 +2691,6 @@ void __init trap_init(void)
2691 fault_address) || 2691 fault_address) ||
2692 TI_KREGS != offsetof(struct thread_info, kregs) || 2692 TI_KREGS != offsetof(struct thread_info, kregs) ||
2693 TI_UTRAPS != offsetof(struct thread_info, utraps) || 2693 TI_UTRAPS != offsetof(struct thread_info, utraps) ||
2694 TI_EXEC_DOMAIN != offsetof(struct thread_info,
2695 exec_domain) ||
2696 TI_REG_WINDOW != offsetof(struct thread_info, 2694 TI_REG_WINDOW != offsetof(struct thread_info,
2697 reg_window) || 2695 reg_window) ||
2698 TI_RWIN_SPTRS != offsetof(struct thread_info, 2696 TI_RWIN_SPTRS != offsetof(struct thread_info,
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h
index 96c14c1430d8..98ee10a0ae89 100644
--- a/arch/tile/include/asm/thread_info.h
+++ b/arch/tile/include/asm/thread_info.h
@@ -26,7 +26,6 @@
26 */ 26 */
27struct thread_info { 27struct thread_info {
28 struct task_struct *task; /* main task structure */ 28 struct task_struct *task; /* main task structure */
29 struct exec_domain *exec_domain; /* execution domain */
30 unsigned long flags; /* low level flags */ 29 unsigned long flags; /* low level flags */
31 unsigned long status; /* thread-synchronous flags */ 30 unsigned long status; /* thread-synchronous flags */
32 __u32 homecache_cpu; /* CPU we are homecached on */ 31 __u32 homecache_cpu; /* CPU we are homecached on */
@@ -51,7 +50,6 @@ struct thread_info {
51#define INIT_THREAD_INFO(tsk) \ 50#define INIT_THREAD_INFO(tsk) \
52{ \ 51{ \
53 .task = &tsk, \ 52 .task = &tsk, \
54 .exec_domain = &default_exec_domain, \
55 .flags = 0, \ 53 .flags = 0, \
56 .cpu = 0, \ 54 .cpu = 0, \
57 .preempt_count = INIT_PREEMPT_COUNT, \ 55 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c
index 8c5abf2e4794..5cbc864398d3 100644
--- a/arch/tile/kernel/compat_signal.c
+++ b/arch/tile/kernel/compat_signal.c
@@ -196,19 +196,12 @@ int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set,
196 unsigned long restorer; 196 unsigned long restorer;
197 struct compat_rt_sigframe __user *frame; 197 struct compat_rt_sigframe __user *frame;
198 int err = 0, sig = ksig->sig; 198 int err = 0, sig = ksig->sig;
199 int usig;
200 199
201 frame = compat_get_sigframe(&ksig->ka, regs, sizeof(*frame)); 200 frame = compat_get_sigframe(&ksig->ka, regs, sizeof(*frame));
202 201
203 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 202 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
204 goto err; 203 goto err;
205 204
206 usig = current_thread_info()->exec_domain
207 && current_thread_info()->exec_domain->signal_invmap
208 && sig < 32
209 ? current_thread_info()->exec_domain->signal_invmap[sig]
210 : sig;
211
212 /* Always write at least the signal number for the stack backtracer. */ 205 /* Always write at least the signal number for the stack backtracer. */
213 if (ksig->ka.sa.sa_flags & SA_SIGINFO) { 206 if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
214 /* At sigreturn time, restore the callee-save registers too. */ 207 /* At sigreturn time, restore the callee-save registers too. */
@@ -243,7 +236,7 @@ int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set,
243 regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ 236 regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
244 regs->sp = ptr_to_compat_reg(frame); 237 regs->sp = ptr_to_compat_reg(frame);
245 regs->lr = restorer; 238 regs->lr = restorer;
246 regs->regs[0] = (unsigned long) usig; 239 regs->regs[0] = (unsigned long) sig;
247 regs->regs[1] = ptr_to_compat_reg(&frame->info); 240 regs->regs[1] = ptr_to_compat_reg(&frame->info);
248 regs->regs[2] = ptr_to_compat_reg(&frame->uc); 241 regs->regs[2] = ptr_to_compat_reg(&frame->uc);
249 regs->flags |= PT_FLAGS_CALLER_SAVES; 242 regs->flags |= PT_FLAGS_CALLER_SAVES;
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c
index 8a524e332c1a..87299a6cfec8 100644
--- a/arch/tile/kernel/signal.c
+++ b/arch/tile/kernel/signal.c
@@ -151,19 +151,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
151 unsigned long restorer; 151 unsigned long restorer;
152 struct rt_sigframe __user *frame; 152 struct rt_sigframe __user *frame;
153 int err = 0, sig = ksig->sig; 153 int err = 0, sig = ksig->sig;
154 int usig;
155 154
156 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); 155 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame));
157 156
158 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 157 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
159 goto err; 158 goto err;
160 159
161 usig = current_thread_info()->exec_domain
162 && current_thread_info()->exec_domain->signal_invmap
163 && sig < 32
164 ? current_thread_info()->exec_domain->signal_invmap[sig]
165 : sig;
166
167 /* Always write at least the signal number for the stack backtracer. */ 160 /* Always write at least the signal number for the stack backtracer. */
168 if (ksig->ka.sa.sa_flags & SA_SIGINFO) { 161 if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
169 /* At sigreturn time, restore the callee-save registers too. */ 162 /* At sigreturn time, restore the callee-save registers too. */
@@ -198,7 +191,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
198 regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ 191 regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
199 regs->sp = (unsigned long) frame; 192 regs->sp = (unsigned long) frame;
200 regs->lr = restorer; 193 regs->lr = restorer;
201 regs->regs[0] = (unsigned long) usig; 194 regs->regs[0] = (unsigned long) sig;
202 regs->regs[1] = (unsigned long) &frame->info; 195 regs->regs[1] = (unsigned long) &frame->info;
203 regs->regs[2] = (unsigned long) &frame->uc; 196 regs->regs[2] = (unsigned long) &frame->uc;
204 regs->flags |= PT_FLAGS_CALLER_SAVES; 197 regs->flags |= PT_FLAGS_CALLER_SAVES;
diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index e04114c4fcd9..b30c85b141d9 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -14,7 +14,6 @@
14 14
15struct thread_info { 15struct thread_info {
16 struct task_struct *task; /* main task structure */ 16 struct task_struct *task; /* main task structure */
17 struct exec_domain *exec_domain; /* execution domain */
18 unsigned long flags; /* low level flags */ 17 unsigned long flags; /* low level flags */
19 __u32 cpu; /* current CPU */ 18 __u32 cpu; /* current CPU */
20 int preempt_count; /* 0 => preemptable, 19 int preempt_count; /* 0 => preemptable,
@@ -28,7 +27,6 @@ struct thread_info {
28#define INIT_THREAD_INFO(tsk) \ 27#define INIT_THREAD_INFO(tsk) \
29{ \ 28{ \
30 .task = &tsk, \ 29 .task = &tsk, \
31 .exec_domain = &default_exec_domain, \
32 .flags = 0, \ 30 .flags = 0, \
33 .cpu = 0, \ 31 .cpu = 0, \
34 .preempt_count = INIT_PREEMPT_COUNT, \ 32 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h
index 63e2839dfeb8..e79ad6d5b5b2 100644
--- a/arch/unicore32/include/asm/thread_info.h
+++ b/arch/unicore32/include/asm/thread_info.h
@@ -24,7 +24,6 @@
24#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
25 25
26struct task_struct; 26struct task_struct;
27struct exec_domain;
28 27
29#include <asm/types.h> 28#include <asm/types.h>
30 29
@@ -71,7 +70,6 @@ struct thread_info {
71 /* <0 => bug */ 70 /* <0 => bug */
72 mm_segment_t addr_limit; /* address limit */ 71 mm_segment_t addr_limit; /* address limit */
73 struct task_struct *task; /* main task structure */ 72 struct task_struct *task; /* main task structure */
74 struct exec_domain *exec_domain; /* execution domain */
75 __u32 cpu; /* cpu */ 73 __u32 cpu; /* cpu */
76 struct cpu_context_save cpu_context; /* cpu context */ 74 struct cpu_context_save cpu_context; /* cpu context */
77 __u32 syscall; /* syscall number */ 75 __u32 syscall; /* syscall number */
@@ -84,7 +82,6 @@ struct thread_info {
84#define INIT_THREAD_INFO(tsk) \ 82#define INIT_THREAD_INFO(tsk) \
85{ \ 83{ \
86 .task = &tsk, \ 84 .task = &tsk, \
87 .exec_domain = &default_exec_domain, \
88 .flags = 0, \ 85 .flags = 0, \
89 .preempt_count = INIT_PREEMPT_COUNT, \ 86 .preempt_count = INIT_PREEMPT_COUNT, \
90 .addr_limit = KERNEL_DS, \ 87 .addr_limit = KERNEL_DS, \
diff --git a/arch/unicore32/kernel/asm-offsets.c b/arch/unicore32/kernel/asm-offsets.c
index ffcbe7536ca7..80d50c4651e3 100644
--- a/arch/unicore32/kernel/asm-offsets.c
+++ b/arch/unicore32/kernel/asm-offsets.c
@@ -42,7 +42,6 @@ int main(void)
42 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 42 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
43 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); 43 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
44 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 44 DEFINE(TI_TASK, offsetof(struct thread_info, task));
45 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
46 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 45 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
47 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context)); 46 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
48 DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp)); 47 DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));
diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c
index d329f85766cc..4ae51cf15ade 100644
--- a/arch/unicore32/kernel/signal.c
+++ b/arch/unicore32/kernel/signal.c
@@ -330,13 +330,6 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs,
330 } 330 }
331 331
332 /* 332 /*
333 * translate the signal
334 */
335 if (usig < 32 && thread->exec_domain
336 && thread->exec_domain->signal_invmap)
337 usig = thread->exec_domain->signal_invmap[usig];
338
339 /*
340 * Set up the stack frame 333 * Set up the stack frame
341 */ 334 */
342 if (ksig->ka.sa.sa_flags & SA_SIGINFO) 335 if (ksig->ka.sa.sa_flags & SA_SIGINFO)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index ea2dbe82cba3..b4bdec3e9523 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -46,13 +46,11 @@
46 */ 46 */
47#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
48struct task_struct; 48struct task_struct;
49struct exec_domain;
50#include <asm/processor.h> 49#include <asm/processor.h>
51#include <linux/atomic.h> 50#include <linux/atomic.h>
52 51
53struct thread_info { 52struct thread_info {
54 struct task_struct *task; /* main task structure */ 53 struct task_struct *task; /* main task structure */
55 struct exec_domain *exec_domain; /* execution domain */
56 __u32 flags; /* low level flags */ 54 __u32 flags; /* low level flags */
57 __u32 status; /* thread synchronous flags */ 55 __u32 status; /* thread synchronous flags */
58 __u32 cpu; /* current CPU */ 56 __u32 cpu; /* current CPU */
@@ -66,7 +64,6 @@ struct thread_info {
66#define INIT_THREAD_INFO(tsk) \ 64#define INIT_THREAD_INFO(tsk) \
67{ \ 65{ \
68 .task = &tsk, \ 66 .task = &tsk, \
69 .exec_domain = &default_exec_domain, \
70 .flags = 0, \ 67 .flags = 0, \
71 .cpu = 0, \ 68 .cpu = 0, \
72 .saved_preempt_count = INIT_PREEMPT_COUNT, \ 69 .saved_preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 3e581865c8e2..f9804080ccb3 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -593,24 +593,10 @@ badframe:
593 return 0; 593 return 0;
594} 594}
595 595
596/*
597 * OK, we're invoking a handler:
598 */
599static int signr_convert(int sig)
600{
601#ifdef CONFIG_X86_32
602 struct thread_info *info = current_thread_info();
603
604 if (info->exec_domain && info->exec_domain->signal_invmap && sig < 32)
605 return info->exec_domain->signal_invmap[sig];
606#endif /* CONFIG_X86_32 */
607 return sig;
608}
609
610static int 596static int
611setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) 597setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
612{ 598{
613 int usig = signr_convert(ksig->sig); 599 int usig = ksig->sig;
614 sigset_t *set = sigmask_to_save(); 600 sigset_t *set = sigmask_to_save();
615 compat_sigset_t *cset = (compat_sigset_t *) set; 601 compat_sigset_t *cset = (compat_sigset_t *) set;
616 602
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c
index 0c8c32bfd792..592491d1d70d 100644
--- a/arch/x86/um/signal.c
+++ b/arch/x86/um/signal.c
@@ -549,13 +549,6 @@ int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
549 if (err) 549 if (err)
550 return err; 550 return err;
551 551
552 /* Set up registers for signal handler */
553 {
554 struct exec_domain *ed = current_thread_info()->exec_domain;
555 if (unlikely(ed && ed->signal_invmap && sig < 32))
556 sig = ed->signal_invmap[sig];
557 }
558
559 PT_REGS_SP(regs) = (unsigned long) frame; 552 PT_REGS_SP(regs) = (unsigned long) frame;
560 PT_REGS_DI(regs) = sig; 553 PT_REGS_DI(regs) = sig;
561 /* In case the signal handler was declared without prototypes */ 554 /* In case the signal handler was declared without prototypes */
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
index a9b5d3ba196c..9ad12c617184 100644
--- a/arch/xtensa/include/asm/thread_info.h
+++ b/arch/xtensa/include/asm/thread_info.h
@@ -44,7 +44,6 @@ typedef struct xtregs_coprocessor {
44 44
45struct thread_info { 45struct thread_info {
46 struct task_struct *task; /* main task structure */ 46 struct task_struct *task; /* main task structure */
47 struct exec_domain *exec_domain; /* execution domain */
48 unsigned long flags; /* low level flags */ 47 unsigned long flags; /* low level flags */
49 unsigned long status; /* thread-synchronous flags */ 48 unsigned long status; /* thread-synchronous flags */
50 __u32 cpu; /* current CPU */ 49 __u32 cpu; /* current CPU */
@@ -61,17 +60,6 @@ struct thread_info {
61 xtregs_user_t xtregs_user; 60 xtregs_user_t xtregs_user;
62}; 61};
63 62
64#else /* !__ASSEMBLY__ */
65
66/* offsets into the thread_info struct for assembly code access */
67#define TI_TASK 0x00000000
68#define TI_EXEC_DOMAIN 0x00000004
69#define TI_FLAGS 0x00000008
70#define TI_STATUS 0x0000000C
71#define TI_CPU 0x00000010
72#define TI_PRE_COUNT 0x00000014
73#define TI_ADDR_LIMIT 0x00000018
74
75#endif 63#endif
76 64
77/* 65/*
@@ -83,7 +71,6 @@ struct thread_info {
83#define INIT_THREAD_INFO(tsk) \ 71#define INIT_THREAD_INFO(tsk) \
84{ \ 72{ \
85 .task = &tsk, \ 73 .task = &tsk, \
86 .exec_domain = &default_exec_domain, \
87 .flags = 0, \ 74 .flags = 0, \
88 .cpu = 0, \ 75 .cpu = 0, \
89 .preempt_count = INIT_PREEMPT_COUNT, \ 76 .preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offsets.c
index 1915c7c889ba..b123ace3b67c 100644
--- a/arch/xtensa/kernel/asm-offsets.c
+++ b/arch/xtensa/kernel/asm-offsets.c
@@ -77,6 +77,14 @@ int main(void)
77 DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack)); 77 DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack));
78 DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct)); 78 DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct));
79 79
80 /* offsets in thread_info struct */
81 OFFSET(TI_TASK, thread_info, task);
82 OFFSET(TI_FLAGS, thread_info, flags);
83 OFFSET(TI_STSTUS, thread_info, status);
84 OFFSET(TI_CPU, thread_info, cpu);
85 OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
86 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
87
80 /* struct thread_info (offset from start_struct) */ 88 /* struct thread_info (offset from start_struct) */
81 DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra)); 89 DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));
82 DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp)); 90 DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index 6b3790445cbe..e87adaa07ff3 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -336,7 +336,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
336{ 336{
337 struct rt_sigframe *frame; 337 struct rt_sigframe *frame;
338 int err = 0, sig = ksig->sig; 338 int err = 0, sig = ksig->sig;
339 int signal;
340 unsigned long sp, ra, tp; 339 unsigned long sp, ra, tp;
341 340
342 sp = regs->areg[1]; 341 sp = regs->areg[1];
@@ -354,12 +353,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
354 return -EFAULT; 353 return -EFAULT;
355 } 354 }
356 355
357 signal = current_thread_info()->exec_domain
358 && current_thread_info()->exec_domain->signal_invmap
359 && sig < 32
360 ? current_thread_info()->exec_domain->signal_invmap[sig]
361 : sig;
362
363 if (ksig->ka.sa.sa_flags & SA_SIGINFO) { 356 if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
364 err |= copy_siginfo_to_user(&frame->info, &ksig->info); 357 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
365 } 358 }
@@ -400,14 +393,14 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
400 * Note: PS.CALLINC is set to one by start_thread 393 * Note: PS.CALLINC is set to one by start_thread
401 */ 394 */
402 regs->areg[4] = (((unsigned long) ra) & 0x3fffffff) | 0x40000000; 395 regs->areg[4] = (((unsigned long) ra) & 0x3fffffff) | 0x40000000;
403 regs->areg[6] = (unsigned long) signal; 396 regs->areg[6] = (unsigned long) sig;
404 regs->areg[7] = (unsigned long) &frame->info; 397 regs->areg[7] = (unsigned long) &frame->info;
405 regs->areg[8] = (unsigned long) &frame->uc; 398 regs->areg[8] = (unsigned long) &frame->uc;
406 regs->threadptr = tp; 399 regs->threadptr = tp;
407 400
408#if DEBUG_SIG 401#if DEBUG_SIG
409 printk("SIG rt deliver (%s:%d): signal=%d sp=%p pc=%08x\n", 402 printk("SIG rt deliver (%s:%d): signal=%d sp=%p pc=%08x\n",
410 current->comm, current->pid, signal, frame, regs->pc); 403 current->comm, current->pid, sig, frame, regs->pc);
411#endif 404#endif
412 405
413 return 0; 406 return 0;
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 646c0a7d50fa..aeb7892b2468 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -3,52 +3,14 @@
3 3
4#include <uapi/linux/personality.h> 4#include <uapi/linux/personality.h>
5 5
6
7/*
8 * Handling of different ABIs (personalities).
9 */
10
11struct exec_domain;
12struct pt_regs;
13
14extern int register_exec_domain(struct exec_domain *);
15extern int unregister_exec_domain(struct exec_domain *);
16extern int __set_personality(unsigned int);
17
18
19/*
20 * Description of an execution domain.
21 *
22 * The first two members are refernced from assembly source
23 * and should stay where they are unless explicitly needed.
24 */
25typedef void (*handler_t)(int, struct pt_regs *);
26
27struct exec_domain {
28 const char *name; /* name of the execdomain */
29 handler_t handler; /* handler for syscalls */
30 unsigned char pers_low; /* lowest personality */
31 unsigned char pers_high; /* highest personality */
32 unsigned long *signal_map; /* signal mapping */
33 unsigned long *signal_invmap; /* reverse signal mapping */
34 struct map_segment *err_map; /* error mapping */
35 struct map_segment *socktype_map; /* socket type mapping */
36 struct map_segment *sockopt_map; /* socket option mapping */
37 struct map_segment *af_map; /* address family mapping */
38 struct module *module; /* module context of the ed. */
39 struct exec_domain *next; /* linked list (internal) */
40};
41
42/* 6/*
43 * Return the base personality without flags. 7 * Return the base personality without flags.
44 */ 8 */
45#define personality(pers) (pers & PER_MASK) 9#define personality(pers) (pers & PER_MASK)
46 10
47
48/* 11/*
49 * Change personality of the currently running process. 12 * Change personality of the currently running process.
50 */ 13 */
51#define set_personality(pers) \ 14#define set_personality(pers) (current->personality = (pers))
52 ((current->personality == (pers)) ? 0 : __set_personality(pers))
53 15
54#endif /* _LINUX_PERSONALITY_H */ 16#endif /* _LINUX_PERSONALITY_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f74d4cc3a3e5..8222ae40ecb0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -125,7 +125,6 @@ struct sched_attr {
125 u64 sched_period; 125 u64 sched_period;
126}; 126};
127 127
128struct exec_domain;
129struct futex_pi_state; 128struct futex_pi_state;
130struct robust_list_head; 129struct robust_list_head;
131struct bio_list; 130struct bio_list;
@@ -2311,11 +2310,6 @@ extern void set_curr_task(int cpu, struct task_struct *p);
2311 2310
2312void yield(void); 2311void yield(void);
2313 2312
2314/*
2315 * The default (Linux) execution domain.
2316 */
2317extern struct exec_domain default_exec_domain;
2318
2319union thread_union { 2313union thread_union {
2320 struct thread_info thread_info; 2314 struct thread_info thread_info;
2321 unsigned long stack[THREAD_SIZE/sizeof(long)]; 2315 unsigned long stack[THREAD_SIZE/sizeof(long)];
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
index 83d4382f5699..6873bb3e6b7e 100644
--- a/kernel/exec_domain.c
+++ b/kernel/exec_domain.c
@@ -20,145 +20,10 @@
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/fs_struct.h> 21#include <linux/fs_struct.h>
22 22
23
24static void default_handler(int, struct pt_regs *);
25
26static struct exec_domain *exec_domains = &default_exec_domain;
27static DEFINE_RWLOCK(exec_domains_lock);
28
29
30static unsigned long ident_map[32] = {
31 0, 1, 2, 3, 4, 5, 6, 7,
32 8, 9, 10, 11, 12, 13, 14, 15,
33 16, 17, 18, 19, 20, 21, 22, 23,
34 24, 25, 26, 27, 28, 29, 30, 31
35};
36
37struct exec_domain default_exec_domain = {
38 .name = "Linux", /* name */
39 .handler = default_handler, /* lcall7 causes a seg fault. */
40 .pers_low = 0, /* PER_LINUX personality. */
41 .pers_high = 0, /* PER_LINUX personality. */
42 .signal_map = ident_map, /* Identity map signals. */
43 .signal_invmap = ident_map, /* - both ways. */
44};
45
46
47static void
48default_handler(int segment, struct pt_regs *regp)
49{
50 set_personality(0);
51
52 if (current_thread_info()->exec_domain->handler != default_handler)
53 current_thread_info()->exec_domain->handler(segment, regp);
54 else
55 send_sig(SIGSEGV, current, 1);
56}
57
58static struct exec_domain *
59lookup_exec_domain(unsigned int personality)
60{
61 unsigned int pers = personality(personality);
62 struct exec_domain *ep;
63
64 read_lock(&exec_domains_lock);
65 for (ep = exec_domains; ep; ep = ep->next) {
66 if (pers >= ep->pers_low && pers <= ep->pers_high)
67 if (try_module_get(ep->module))
68 goto out;
69 }
70
71#ifdef CONFIG_MODULES
72 read_unlock(&exec_domains_lock);
73 request_module("personality-%d", pers);
74 read_lock(&exec_domains_lock);
75
76 for (ep = exec_domains; ep; ep = ep->next) {
77 if (pers >= ep->pers_low && pers <= ep->pers_high)
78 if (try_module_get(ep->module))
79 goto out;
80 }
81#endif
82
83 ep = &default_exec_domain;
84out:
85 read_unlock(&exec_domains_lock);
86 return ep;
87}
88
89int
90register_exec_domain(struct exec_domain *ep)
91{
92 struct exec_domain *tmp;
93 int err = -EBUSY;
94
95 if (ep == NULL)
96 return -EINVAL;
97
98 if (ep->next != NULL)
99 return -EBUSY;
100
101 write_lock(&exec_domains_lock);
102 for (tmp = exec_domains; tmp; tmp = tmp->next) {
103 if (tmp == ep)
104 goto out;
105 }
106
107 ep->next = exec_domains;
108 exec_domains = ep;
109 err = 0;
110
111out:
112 write_unlock(&exec_domains_lock);
113 return err;
114}
115EXPORT_SYMBOL(register_exec_domain);
116
117int
118unregister_exec_domain(struct exec_domain *ep)
119{
120 struct exec_domain **epp;
121
122 epp = &exec_domains;
123 write_lock(&exec_domains_lock);
124 for (epp = &exec_domains; *epp; epp = &(*epp)->next) {
125 if (ep == *epp)
126 goto unregister;
127 }
128 write_unlock(&exec_domains_lock);
129 return -EINVAL;
130
131unregister:
132 *epp = ep->next;
133 ep->next = NULL;
134 write_unlock(&exec_domains_lock);
135 return 0;
136}
137EXPORT_SYMBOL(unregister_exec_domain);
138
139int __set_personality(unsigned int personality)
140{
141 struct exec_domain *oep = current_thread_info()->exec_domain;
142
143 current_thread_info()->exec_domain = lookup_exec_domain(personality);
144 current->personality = personality;
145 module_put(oep->module);
146
147 return 0;
148}
149EXPORT_SYMBOL(__set_personality);
150
151#ifdef CONFIG_PROC_FS 23#ifdef CONFIG_PROC_FS
152static int execdomains_proc_show(struct seq_file *m, void *v) 24static int execdomains_proc_show(struct seq_file *m, void *v)
153{ 25{
154 struct exec_domain *ep; 26 seq_puts(m, "0-0\tLinux \t[kernel]\n");
155
156 read_lock(&exec_domains_lock);
157 for (ep = exec_domains; ep; ep = ep->next)
158 seq_printf(m, "%d-%d\t%-16s\t[%s]\n",
159 ep->pers_low, ep->pers_high, ep->name,
160 module_name(ep->module));
161 read_unlock(&exec_domains_lock);
162 return 0; 27 return 0;
163} 28}
164 29
diff --git a/kernel/exit.c b/kernel/exit.c
index feff10bbb307..22fcc05dec40 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -756,8 +756,6 @@ void do_exit(long code)
756 756
757 cgroup_exit(tsk); 757 cgroup_exit(tsk);
758 758
759 module_put(task_thread_info(tsk)->exec_domain->module);
760
761 /* 759 /*
762 * FIXME: do that only when needed, using sched_exit tracepoint 760 * FIXME: do that only when needed, using sched_exit tracepoint
763 */ 761 */
diff --git a/kernel/fork.c b/kernel/fork.c
index cf65139615a0..f2c1e7352298 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1279,9 +1279,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1279 if (nr_threads >= max_threads) 1279 if (nr_threads >= max_threads)
1280 goto bad_fork_cleanup_count; 1280 goto bad_fork_cleanup_count;
1281 1281
1282 if (!try_module_get(task_thread_info(p)->exec_domain->module))
1283 goto bad_fork_cleanup_count;
1284
1285 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */ 1282 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */
1286 p->flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER); 1283 p->flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER);
1287 p->flags |= PF_FORKNOEXEC; 1284 p->flags |= PF_FORKNOEXEC;
@@ -1590,7 +1587,6 @@ bad_fork_cleanup_threadgroup_lock:
1590 if (clone_flags & CLONE_THREAD) 1587 if (clone_flags & CLONE_THREAD)
1591 threadgroup_change_end(current); 1588 threadgroup_change_end(current);
1592 delayacct_tsk_free(p); 1589 delayacct_tsk_free(p);
1593 module_put(task_thread_info(p)->exec_domain->module);
1594bad_fork_cleanup_count: 1590bad_fork_cleanup_count:
1595 atomic_dec(&p->cred->user->processes); 1591 atomic_dec(&p->cred->user->processes);
1596 exit_creds(p); 1592 exit_creds(p);