2015-04-11 20:54:45

by Richard Weinberger

[permalink] [raw]
Subject: Remove execution domain support

A long time ago there was the idea to support different ABIs on Linux
Such that someone could use for example SCO UNIX binaries on Linux
without emulation. While the linux-abi project existed mostly as
out-of-tree patch it's core component, execution domains,
went mainline. An execution domain allows to specify mappings between
different ABIs, these mappings consist of signal, error, socket type,
socket options and addess familiy mappings.
Mainline has only support for signal mappings.
The signal mapping happens in the architecutre specific signal code.
Some archs support it, some not, most of them copy&pasted from i386.

While the mapping support is incomplete we have two in-kernel users of
execution domains.

1. RISC OS personality on ARM.
The Kconfig help message states that this feature is very experimental
and it is likely that it never worked as expected.
Russel is fine with the removal.

2. ia32 support on ia64.
This is a left over from:
commit 32974ad4907cdde6c9de612cd1b2ee0568fb9409 ([IA64] Remove COMPAT_IA32 support)
It registers a dummy Linux/x86 execdomain to make calls to
personality(PER_LINUX32) faster as the execution domain core code
would try to load a module.

As both users can be removed there is no user left and we can remove
execution domains support at all from the kernel.
The removal will make architecutre specific signal handling easier
and there is no need to keep execuction domains as this feature is
obviously incomplete and abandoned.

[PATCH 01/24] arm: Remove RISC OS personality
[PATCH 02/24] ia64: Remove Linux/x86 exec domain support
[PATCH 03/24] Remove execution domain support
[PATCH 04/24] arm: Remove signal translation and exec_domain
[PATCH 05/24] arm64: Remove signal translation and exec_domain
[PATCH 06/24] blackfin: Autogenerate offsets in struct thread_info
[PATCH 07/24] blackfin: Remove exec_domain usage
[PATCH 08/24] frv: Remove signal translation and exec_domain
[PATCH 09/24] m32r: Autogenerate offsets in struct thread_info
[PATCH 10/24] m32r: Remove signal translation and exec_domain
[PATCH 11/24] m68k: Remove signal translation and exec_domain
[PATCH 12/24] microblaze: Remove signal translation and exec_domain
[PATCH 13/24] mn10300: Remove signal translation and exec_domain
[PATCH 14/24] s390: Remove signal translation and exec_domain
[PATCH 15/24] sh: Remove signal translation and exec_domain
[PATCH 16/24] sparc: Remove signal translation and exec_domain
[PATCH 17/24] tile: Remove signal translation and exec_domain
[PATCH 18/24] um: Remove signal translation and exec_domain
[PATCH 19/24] unicore32: Remove signal translation and exec_domain
[PATCH 20/24] x86: Remove signal translation and exec_domain
[PATCH 21/24] xtensa: Remove signal translation and exec_domain
[PATCH 22/24] arc: Remove signal translation and exec_domain
[PATCH 23/24] arch: Remove exec_domain from remaining archs
[PATCH 24/24] Remove rest of exec domains.

git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git exec_domain_rip_v1

Thanks,
//richard


2015-04-11 20:48:46

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 01/24] arm: Remove RISC OS personality

The RISC OS personality seems to be unused and untested for a long time.
It is doubtful whether this personality worked ever as expected.
Let's rip it out.

Signed-off-by: Richard Weinberger <[email protected]>
Acked-by: Russell King <[email protected]>
---
arch/arm/Kconfig | 10 -----
arch/arm/configs/badge4_defconfig | 1 -
arch/arm/kernel/Makefile | 1 -
arch/arm/kernel/arthur.c | 94 ---------------------------------------
4 files changed, 106 deletions(-)
delete mode 100644 arch/arm/kernel/arthur.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index cf4c0c9..57a8df0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2126,16 +2126,6 @@ menu "Userspace binary formats"

source "fs/Kconfig.binfmt"

-config ARTHUR
- tristate "RISC OS personality"
- depends on !AEABI
- help
- Say Y here to include the kernel code necessary if you want to run
- Acorn RISC OS/Arthur binaries under Linux. This code is still very
- experimental; if this sounds frightening, say N and sleep in peace.
- You can also say M here to compile this support as a module (which
- will be called arthur).
-
endmenu

menu "Power management options"
diff --git a/arch/arm/configs/badge4_defconfig b/arch/arm/configs/badge4_defconfig
index 0494c8f..d590098 100644
--- a/arch/arm/configs/badge4_defconfig
+++ b/arch/arm/configs/badge4_defconfig
@@ -12,7 +12,6 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_FPE_NWFPE=y
CONFIG_BINFMT_AOUT=m
CONFIG_BINFMT_MISC=m
-CONFIG_ARTHUR=m
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 902397d..d9d33fa 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o
obj-$(CONFIG_ISA_DMA_API) += dma.o
obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
obj-$(CONFIG_MODULES) += armksyms.o module.o
-obj-$(CONFIG_ARTHUR) += arthur.o
obj-$(CONFIG_ISA_DMA) += dma-isa.o
obj-$(CONFIG_PCI) += bios32.o isa.o
obj-$(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 321c529..0000000
--- a/arch/arm/kernel/arthur.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * linux/arch/arm/kernel/arthur.c
- *
- * Copyright (C) 1998, 1999, 2000, 2001 Philip Blundell
- *
- * Arthur personality
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/module.h>
-#include <linux/personality.h>
-#include <linux/stddef.h>
-#include <linux/signal.h>
-#include <linux/init.h>
-#include <linux/sched.h>
-
-#include <asm/ptrace.h>
-
-/* Arthur doesn't have many signals, and a lot of those that it does
- have don't map easily to any Linux equivalent. Never mind. */
-
-#define ARTHUR_SIGABRT 1
-#define ARTHUR_SIGFPE 2
-#define ARTHUR_SIGILL 3
-#define ARTHUR_SIGINT 4
-#define ARTHUR_SIGSEGV 5
-#define ARTHUR_SIGTERM 6
-#define ARTHUR_SIGSTAK 7
-#define ARTHUR_SIGUSR1 8
-#define ARTHUR_SIGUSR2 9
-#define ARTHUR_SIGOSERROR 10
-
-static unsigned long arthur_to_linux_signals[32] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31
-};
-
-static unsigned long linux_to_arthur_signals[32] = {
- 0, -1, ARTHUR_SIGINT, -1,
- ARTHUR_SIGILL, 5, ARTHUR_SIGABRT, 7,
- ARTHUR_SIGFPE, 9, ARTHUR_SIGUSR1, ARTHUR_SIGSEGV,
- ARTHUR_SIGUSR2, 13, 14, ARTHUR_SIGTERM,
- 16, 17, 18, 19,
- 20, 21, 22, 23,
- 24, 25, 26, 27,
- 28, 29, 30, 31
-};
-
-static void arthur_lcall7(int nr, struct pt_regs *regs)
-{
- struct siginfo info;
- info.si_signo = SIGSWI;
- info.si_errno = nr;
- /* Bounce it to the emulator */
- send_sig_info(SIGSWI, &info, current);
-}
-
-static struct exec_domain arthur_exec_domain = {
- .name = "Arthur",
- .handler = arthur_lcall7,
- .pers_low = PER_RISCOS,
- .pers_high = PER_RISCOS,
- .signal_map = arthur_to_linux_signals,
- .signal_invmap = linux_to_arthur_signals,
- .module = THIS_MODULE,
-};
-
-/*
- * We could do with some locking to stop Arthur being removed while
- * processes are using it.
- */
-
-static int __init arthur_init(void)
-{
- return register_exec_domain(&arthur_exec_domain);
-}
-
-static void __exit arthur_exit(void)
-{
- unregister_exec_domain(&arthur_exec_domain);
-}
-
-module_init(arthur_init);
-module_exit(arthur_exit);
-
-MODULE_LICENSE("GPL");
--
1.8.4.5

2015-04-11 20:48:48

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 02/24] ia64: Remove Linux/x86 exec domain support

As this series removes exec domain support we can
get rid of this hack.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/ia64/mm/init.c | 25 -------------------------
1 file changed, 25 deletions(-)

diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 6b33457..a9b65cf 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)
#endif
#endif

-/*
- * Even when CONFIG_IA32_SUPPORT is not enabled it is
- * useful to have the Linux/x86 domain registered to
- * avoid an attempted module load when emulators call
- * personality(PER_LINUX32). This saves several milliseconds
- * on each such call.
- */
-static struct exec_domain ia32_exec_domain;
-
-static int __init
-per_linux32_init(void)
-{
- ia32_exec_domain.name = "Linux/x86";
- ia32_exec_domain.handler = NULL;
- ia32_exec_domain.pers_low = PER_LINUX32;
- ia32_exec_domain.pers_high = PER_LINUX32;
- ia32_exec_domain.signal_map = default_exec_domain.signal_map;
- ia32_exec_domain.signal_invmap = default_exec_domain.signal_invmap;
- register_exec_domain(&ia32_exec_domain);
-
- return 0;
-}
-
-__initcall(per_linux32_init);
-
/**
* show_mem - give short summary of memory stats
*
--
1.8.4.5

2015-04-11 20:54:41

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 03/24] Remove execution domain support

All users of exec_domain are gone, now we can get rid
of that abandoned feature.
To not break existing userspace we keep a dummy
/proc/execdomains file which will always contain
"0-0 Linux [kernel]".

Signed-off-by: Richard Weinberger <[email protected]>
---
kernel/exec_domain.c | 100 +--------------------------------------------------
kernel/exit.c | 2 --
kernel/fork.c | 4 ---
3 files changed, 1 insertion(+), 105 deletions(-)

diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
index 83d4382..b2fb57d 100644
--- a/kernel/exec_domain.c
+++ b/kernel/exec_domain.c
@@ -20,13 +20,7 @@
#include <linux/types.h>
#include <linux/fs_struct.h>

-
static void default_handler(int, struct pt_regs *);
-
-static struct exec_domain *exec_domains = &default_exec_domain;
-static DEFINE_RWLOCK(exec_domains_lock);
-
-
static unsigned long ident_map[32] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
@@ -55,94 +49,9 @@ default_handler(int segment, struct pt_regs *regp)
send_sig(SIGSEGV, current, 1);
}

-static struct exec_domain *
-lookup_exec_domain(unsigned int personality)
-{
- unsigned int pers = personality(personality);
- struct exec_domain *ep;
-
- read_lock(&exec_domains_lock);
- for (ep = exec_domains; ep; ep = ep->next) {
- if (pers >= ep->pers_low && pers <= ep->pers_high)
- if (try_module_get(ep->module))
- goto out;
- }
-
-#ifdef CONFIG_MODULES
- read_unlock(&exec_domains_lock);
- request_module("personality-%d", pers);
- read_lock(&exec_domains_lock);
-
- for (ep = exec_domains; ep; ep = ep->next) {
- if (pers >= ep->pers_low && pers <= ep->pers_high)
- if (try_module_get(ep->module))
- goto out;
- }
-#endif
-
- ep = &default_exec_domain;
-out:
- read_unlock(&exec_domains_lock);
- return ep;
-}
-
-int
-register_exec_domain(struct exec_domain *ep)
-{
- struct exec_domain *tmp;
- int err = -EBUSY;
-
- if (ep == NULL)
- return -EINVAL;
-
- if (ep->next != NULL)
- return -EBUSY;
-
- write_lock(&exec_domains_lock);
- for (tmp = exec_domains; tmp; tmp = tmp->next) {
- if (tmp == ep)
- goto out;
- }
-
- ep->next = exec_domains;
- exec_domains = ep;
- err = 0;
-
-out:
- write_unlock(&exec_domains_lock);
- return err;
-}
-EXPORT_SYMBOL(register_exec_domain);
-
-int
-unregister_exec_domain(struct exec_domain *ep)
-{
- struct exec_domain **epp;
-
- epp = &exec_domains;
- write_lock(&exec_domains_lock);
- for (epp = &exec_domains; *epp; epp = &(*epp)->next) {
- if (ep == *epp)
- goto unregister;
- }
- write_unlock(&exec_domains_lock);
- return -EINVAL;
-
-unregister:
- *epp = ep->next;
- ep->next = NULL;
- write_unlock(&exec_domains_lock);
- return 0;
-}
-EXPORT_SYMBOL(unregister_exec_domain);
-
int __set_personality(unsigned int personality)
{
- struct exec_domain *oep = current_thread_info()->exec_domain;
-
- current_thread_info()->exec_domain = lookup_exec_domain(personality);
current->personality = personality;
- module_put(oep->module);

return 0;
}
@@ -151,14 +60,7 @@ EXPORT_SYMBOL(__set_personality);
#ifdef CONFIG_PROC_FS
static int execdomains_proc_show(struct seq_file *m, void *v)
{
- struct exec_domain *ep;
-
- read_lock(&exec_domains_lock);
- for (ep = exec_domains; ep; ep = ep->next)
- seq_printf(m, "%d-%d\t%-16s\t[%s]\n",
- ep->pers_low, ep->pers_high, ep->name,
- module_name(ep->module));
- read_unlock(&exec_domains_lock);
+ seq_puts(m, "0-0\tLinux \t[kernel]\n");
return 0;
}

diff --git a/kernel/exit.c b/kernel/exit.c
index feff10b..22fcc05 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -756,8 +756,6 @@ void do_exit(long code)

cgroup_exit(tsk);

- module_put(task_thread_info(tsk)->exec_domain->module);
-
/*
* FIXME: do that only when needed, using sched_exit tracepoint
*/
diff --git a/kernel/fork.c b/kernel/fork.c
index cf65139..f2c1e73 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1279,9 +1279,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
if (nr_threads >= max_threads)
goto bad_fork_cleanup_count;

- if (!try_module_get(task_thread_info(p)->exec_domain->module))
- goto bad_fork_cleanup_count;
-
delayacct_tsk_init(p); /* Must remain after dup_task_struct() */
p->flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER);
p->flags |= PF_FORKNOEXEC;
@@ -1590,7 +1587,6 @@ bad_fork_cleanup_threadgroup_lock:
if (clone_flags & CLONE_THREAD)
threadgroup_change_end(current);
delayacct_tsk_free(p);
- module_put(task_thread_info(p)->exec_domain->module);
bad_fork_cleanup_count:
atomic_dec(&p->cred->user->processes);
exit_creds(p);
--
1.8.4.5

2015-04-11 20:48:54

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 04/24] arm: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/arm/include/asm/thread_info.h | 3 ---
arch/arm/kernel/asm-offsets.c | 1 -
arch/arm/kernel/signal.c | 13 +------------
arch/arm/kernel/traps.c | 5 ++---
4 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 72812a1..bd32ede 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -23,7 +23,6 @@
#ifndef __ASSEMBLY__

struct task_struct;
-struct exec_domain;

#include <asm/types.h>
#include <asm/domain.h>
@@ -53,7 +52,6 @@ struct thread_info {
int preempt_count; /* 0 => preemptable, <0 => bug */
mm_segment_t addr_limit; /* address limit */
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
__u32 cpu; /* cpu */
__u32 cpu_domain; /* cpu domain */
struct cpu_context_save cpu_context; /* cpu context */
@@ -73,7 +71,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
.addr_limit = KERNEL_DS, \
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 2d2d608..70d277c 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -66,7 +66,6 @@ int main(void)
DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
- DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain));
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 023ac90..423663e 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)
return frame;
}

-/*
- * translate the signal
- */
-static inline int map_sig(int sig)
-{
- struct thread_info *thread = current_thread_info();
- if (sig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
- sig = thread->exec_domain->signal_invmap[sig];
- return sig;
-}
-
static int
setup_return(struct pt_regs *regs, struct ksignal *ksig,
unsigned long __user *rc, void __user *frame)
@@ -412,7 +401,7 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
}
}

- regs->ARM_r0 = map_sig(ksig->sig);
+ regs->ARM_r0 = ksig->sig;
regs->ARM_sp = (unsigned long)frame;
regs->ARM_lr = retcode;
regs->ARM_pc = handler;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 788e23f..fac2c7e 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -508,9 +508,8 @@ static int bad_syscall(int n, struct pt_regs *regs)
struct thread_info *thread = current_thread_info();
siginfo_t info;

- if ((current->personality & PER_MASK) != PER_LINUX &&
- thread->exec_domain->handler) {
- thread->exec_domain->handler(n, regs);
+ if ((current->personality & PER_MASK) != PER_LINUX) {
+ send_sig(SIGSEGV, current, 1);
return regs->ARM_r0;
}

--
1.8.4.5

2015-04-11 20:54:14

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 05/24] arm64: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/arm64/include/asm/thread_info.h | 3 ---
arch/arm64/kernel/asm-offsets.c | 1 -
arch/arm64/kernel/signal.c | 6 ------
3 files changed, 10 deletions(-)

diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index 702e1e6..dcd06d1 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -33,7 +33,6 @@
#ifndef __ASSEMBLY__

struct task_struct;
-struct exec_domain;

#include <asm/types.h>

@@ -47,7 +46,6 @@ struct thread_info {
unsigned long flags; /* low level flags */
mm_segment_t addr_limit; /* address limit */
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
int preempt_count; /* 0 => preemptable, <0 => bug */
int cpu; /* cpu */
};
@@ -55,7 +53,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
.addr_limit = KERNEL_DS, \
diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c
index f7fa65d..56cadd3 100644
--- a/arch/arm64/kernel/asm-offsets.c
+++ b/arch/arm64/kernel/asm-offsets.c
@@ -38,7 +38,6 @@ int main(void)
DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
- DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
BLANK();
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 660ccf9..9f28eaa 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -294,12 +294,6 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
int ret;

/*
- * translate the signal
- */
- if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
- usig = thread->exec_domain->signal_invmap[usig];
-
- /*
* Set up the stack frame
*/
if (is_compat_task()) {
--
1.8.4.5

2015-04-11 20:53:58

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 06/24] blackfin: Autogenerate offsets in struct thread_info

Maintaining offsets by hand is no fun.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/blackfin/include/asm/thread_info.h | 9 ---------
arch/blackfin/kernel/asm-offsets.c | 6 ++++++
arch/blackfin/kernel/traps.c | 1 +
3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 57c3a8b..962be3f 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -76,15 +76,6 @@ static inline struct thread_info *current_thread_info(void)
#endif /* __ASSEMBLY__ */

/*
- * Offsets in thread_info structure, used in assembly code
- */
-#define TI_TASK 0
-#define TI_EXECDOMAIN 4
-#define TI_FLAGS 8
-#define TI_CPU 12
-#define TI_PREEMPT 16
-
-/*
* thread information flag bit numbers
*/
#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 37fcae9..486560a 100644
--- a/arch/blackfin/kernel/asm-offsets.c
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -42,6 +42,12 @@ int main(void)
DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);

+ /* offsets in thread_info struct */
+ OFFSET(TI_TASK, thread_info, task);
+ OFFSET(TI_FLAGS, thread_info, flags);
+ OFFSET(TI_CPU, thread_info, cpu);
+ OFFSET(TI_PREEMPT, thread_info, preempt_count);
+
/* offsets into the pt_regs */
DEFINE(PT_ORIG_R0, offsetof(struct pt_regs, orig_r0));
DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index de5c2c3..1ed85dd 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -18,6 +18,7 @@
#include <asm/fixed_code.h>
#include <asm/pseudo_instructions.h>
#include <asm/pda.h>
+#include <asm/asm-offsets.h>

#ifdef CONFIG_KGDB
# include <linux/kgdb.h>
--
1.8.4.5

2015-04-11 20:49:01

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 07/24] blackfin: Remove exec_domain usage

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/blackfin/include/asm/thread_info.h | 2 --
arch/blackfin/kernel/signal.c | 6 +-----
2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 962be3f..2966b93 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;

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -53,7 +52,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index f2a8b54..1982a14 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)

frame = get_sigframe(ksig, sizeof(*frame));

- err |= __put_user((current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && ksig->sig < 32
- ? current_thread_info()->exec_domain->
- signal_invmap[ksig->sig] : ksig->sig), &frame->sig);
+ err |= __put_user(sig->sig, &frame->sig);

err |= __put_user(&frame->info, &frame->pinfo);
err |= __put_user(&frame->uc, &frame->puc);
--
1.8.4.5

2015-04-11 20:49:06

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 08/24] frv: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/blackfin/kernel/signal.c | 2 +-
arch/frv/include/asm/thread_info.h | 2 --
arch/frv/kernel/asm-offsets.c | 1 -
arch/frv/kernel/signal.c | 20 ++++----------------
4 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index 1982a14..ea570db 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -151,7 +151,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)

frame = get_sigframe(ksig, sizeof(*frame));

- err |= __put_user(sig->sig, &frame->sig);
+ err |= __put_user(ksig->sig, &frame->sig);

err |= __put_user(&frame->info, &frame->pinfo);
err |= __put_user(&frame->uc, &frame->puc);
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index 6b917f1..ccba3b6 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -31,7 +31,6 @@

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */
__u32 cpu; /* current CPU */
@@ -59,7 +58,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/frv/kernel/asm-offsets.c b/arch/frv/kernel/asm-offsets.c
index 446e89d..8414293 100644
--- a/arch/frv/kernel/asm-offsets.c
+++ b/arch/frv/kernel/asm-offsets.c
@@ -34,7 +34,6 @@ void foo(void)
{
/* offsets into the thread_info structure */
OFFSET(TI_TASK, thread_info, task);
- OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
OFFSET(TI_FLAGS, thread_info, flags);
OFFSET(TI_STATUS, thread_info, status);
OFFSET(TI_CPU, thread_info, cpu);
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 336713a..75c602d 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -174,7 +174,7 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
static int setup_frame(struct ksignal *ksig, sigset_t *set)
{
struct sigframe __user *frame;
- int rsig, sig = ksig->sig;
+ int sig = ksig->sig;

set_fs(USER_DS);

@@ -183,13 +183,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- rsig = sig;
- if (sig < 32 &&
- __current_thread_info->exec_domain &&
- __current_thread_info->exec_domain->signal_invmap)
- rsig = __current_thread_info->exec_domain->signal_invmap[sig];
-
- if (__put_user(rsig, &frame->sig) < 0)
+ if (__put_user(sig, &frame->sig) < 0)
return -EFAULT;

if (setup_sigcontext(&frame->sc, set->sig[0]))
@@ -255,7 +249,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
{
struct rt_sigframe __user *frame;
- int rsig, sig = ksig->sig;
+ int sig = ksig->sig;

set_fs(USER_DS);

@@ -264,13 +258,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- rsig = sig;
- if (sig < 32 &&
- __current_thread_info->exec_domain &&
- __current_thread_info->exec_domain->signal_invmap)
- rsig = __current_thread_info->exec_domain->signal_invmap[sig];
-
- if (__put_user(rsig, &frame->sig) ||
+ if (__put_user(sig, &frame->sig) ||
__put_user(&frame->info, &frame->pinfo) ||
__put_user(&frame->uc, &frame->puc))
return -EFAULT;
--
1.8.4.5

2015-04-11 20:53:38

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 09/24] m32r: Autogenerate offsets in struct thread_info

Maintaining offsets by hand is no fun.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/m32r/include/asm/asm-offsets.h | 1 +
arch/m32r/include/asm/thread_info.h | 13 +------------
arch/m32r/kernel/asm-offsets.c | 15 ++++++++++++++-
arch/m32r/kernel/entry.S | 1 +
4 files changed, 17 insertions(+), 13 deletions(-)
create mode 100644 arch/m32r/include/asm/asm-offsets.h

diff --git a/arch/m32r/include/asm/asm-offsets.h b/arch/m32r/include/asm/asm-offsets.h
new file mode 100644
index 0000000..d370ee3
--- /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 32422d0..034d1ab 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -38,18 +38,7 @@ struct thread_info {
__u8 supervisor_stack[0];
};

-#else /* !__ASSEMBLY__ */
-
-/* offsets into the thread_info struct for assembly code access */
-#define TI_TASK 0x00000000
-#define TI_EXEC_DOMAIN 0x00000004
-#define TI_FLAGS 0x00000008
-#define TI_STATUS 0x0000000C
-#define TI_CPU 0x00000010
-#define TI_PRE_COUNT 0x00000014
-#define TI_ADDR_LIMIT 0x00000018
-
-#endif
+#endif /* !__ASSEMBLY__ */

#define THREAD_SIZE (PAGE_SIZE << 1)
#define THREAD_SIZE_ORDER 1
diff --git a/arch/m32r/kernel/asm-offsets.c b/arch/m32r/kernel/asm-offsets.c
index 9e26311..cd3d2fc 100644
--- a/arch/m32r/kernel/asm-offsets.c
+++ b/arch/m32r/kernel/asm-offsets.c
@@ -1 +1,14 @@
-/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */
+#include <linux/thread_info.h>
+#include <linux/kbuild.h>
+
+int foo(void)
+{
+ OFFSET(TI_TASK, thread_info, task);
+ OFFSET(TI_FLAGS, thread_info, flags);
+ OFFSET(TI_STATUS, thread_info, status);
+ OFFSET(TI_CPU, thread_info, cpu);
+ OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
+ OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
+
+ return 0;
+}
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S
index 7c3db99..c639bfa 100644
--- a/arch/m32r/kernel/entry.S
+++ b/arch/m32r/kernel/entry.S
@@ -65,6 +65,7 @@
#include <asm/page.h>
#include <asm/m32r.h>
#include <asm/mmu_context.h>
+#include <asm/asm-offsets.h>

#if !defined(CONFIG_MMU)
#define sys_madvise sys_ni_syscall
--
1.8.4.5

2015-04-11 20:49:09

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 10/24] m32r: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/m32r/include/asm/thread_info.h | 2 --
arch/m32r/kernel/signal.c | 12 +++---------
2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
index 034d1ab..f630d9c 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -24,7 +24,6 @@

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */
__u32 cpu; /* current CPU */
@@ -50,7 +49,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 7736c66..318d8fd 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,
{
struct rt_sigframe __user *frame;
int err = 0;
- int signal, sig = ksig->sig;
+ int sig = ksig->sig;

frame = get_sigframe(ksig, regs->spu, sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- signal = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
- err |= __put_user(signal, &frame->sig);
+ err |= __put_user(sig, &frame->sig);
if (err)
return -EFAULT;

@@ -209,7 +203,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,

/* Set up registers for signal handler */
regs->spu = (unsigned long)frame;
- regs->r0 = signal; /* Arg for signal handler */
+ regs->r0 = sig; /* Arg for signal handler */
regs->r1 = (unsigned long)&frame->info;
regs->r2 = (unsigned long)&frame->uc;
regs->bpc = (unsigned long)ksig->ka.sa.sa_handler;
--
1.8.4.5

2015-04-11 20:53:12

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 11/24] m68k: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/m68k/include/asm/thread_info.h | 2 --
arch/m68k/kernel/signal.c | 14 ++------------
2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h
index c54256e..cee13c2 100644
--- a/arch/m68k/include/asm/thread_info.h
+++ b/arch/m68k/include/asm/thread_info.h
@@ -26,7 +26,6 @@
struct thread_info {
struct task_struct *task; /* main task structure */
unsigned long flags;
- struct exec_domain *exec_domain; /* execution domain */
mm_segment_t addr_limit; /* thread address space */
int preempt_count; /* 0 => preemptable, <0 => BUG */
__u32 cpu; /* should always be 0 on m68k */
@@ -37,7 +36,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.addr_limit = KERNEL_DS, \
.preempt_count = INIT_PREEMPT_COUNT, \
}
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index d717928..af1c4f3 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,
if (fsize)
err |= copy_to_user (frame + 1, regs + 1, fsize);

- err |= __put_user((current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig),
- &frame->sig);
+ err |= __put_user(sig, &frame->sig);

err |= __put_user(regs->vector, &frame->code);
err |= __put_user(&frame->sc, &frame->psc);
@@ -948,12 +943,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
if (fsize)
err |= copy_to_user (&frame->uc.uc_extra, regs + 1, fsize);

- err |= __put_user((current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig),
- &frame->sig);
+ err |= __put_user(sig, &frame->sig);
err |= __put_user(&frame->info, &frame->pinfo);
err |= __put_user(&frame->uc, &frame->puc);
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
--
1.8.4.5

2015-04-11 20:52:43

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 12/24] microblaze: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/microblaze/include/asm/thread_info.h | 2 --
arch/microblaze/kernel/signal.c | 9 +--------
2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index b699fbd..383f387 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -65,7 +65,6 @@ typedef struct {

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */
__u32 cpu; /* current CPU */
@@ -81,7 +80,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index a1cbaf9..cf7d8a3 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,
{
struct rt_sigframe __user *frame;
int err = 0, sig = ksig->sig;
- unsigned long signal;
unsigned long address = 0;
#ifdef CONFIG_MMU
pmd_t *pmdp;
@@ -170,12 +169,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- signal = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : (unsigned long)sig;
-
if (ksig->ka.sa.sa_flags & SA_SIGINFO)
err |= copy_siginfo_to_user(&frame->info, &ksig->info);

@@ -230,7 +223,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
regs->r1 = (unsigned long) frame;

/* Signal handler args: */
- regs->r5 = signal; /* arg 0: signum */
+ regs->r5 = sig; /* arg 0: signum */
regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */
regs->r7 = (unsigned long) &frame->uc; /* arg2: ucontext */
/* Offset to handle microblaze rtid r14, 0 */
--
1.8.4.5

2015-04-11 20:49:15

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 13/24] mn10300: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/mn10300/include/asm/thread_info.h | 2 --
arch/mn10300/kernel/asm-offsets.c | 2 --
arch/mn10300/kernel/signal.c | 20 ++++----------------
3 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index c1c374f..4861a78 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -40,7 +40,6 @@ typedef struct {

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
struct pt_regs *frame; /* current exception frame */
unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */
@@ -74,7 +73,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/mn10300/kernel/asm-offsets.c b/arch/mn10300/kernel/asm-offsets.c
index d780670..e5a61c6 100644
--- a/arch/mn10300/kernel/asm-offsets.c
+++ b/arch/mn10300/kernel/asm-offsets.c
@@ -22,7 +22,6 @@ void foo(void)
BLANK();

OFFSET(TI_task, thread_info, task);
- OFFSET(TI_exec_domain, thread_info, exec_domain);
OFFSET(TI_frame, thread_info, frame);
OFFSET(TI_flags, thread_info, flags);
OFFSET(TI_cpu, thread_info, cpu);
@@ -85,7 +84,6 @@ void foo(void)
DEFINE(SIGCHLD_asm, SIGCHLD);
BLANK();

- OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);

DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 8609845..dfd0301 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,
struct pt_regs *regs)
{
struct sigframe __user *frame;
- int rsig, sig = ksig->sig;
+ int sig = ksig->sig;

frame = get_sigframe(ksig, regs, sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- rsig = sig;
- if (sig < 32 &&
- current_thread_info()->exec_domain &&
- current_thread_info()->exec_domain->signal_invmap)
- rsig = current_thread_info()->exec_domain->signal_invmap[sig];
-
- if (__put_user(rsig, &frame->sig) < 0 ||
+ if (__put_user(sig, &frame->sig) < 0 ||
__put_user(&frame->sc, &frame->psc) < 0)
return -EFAULT;

@@ -270,20 +264,14 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
struct pt_regs *regs)
{
struct rt_sigframe __user *frame;
- int rsig, sig = ksig->sig;
+ int sig = ksig->sig;

frame = get_sigframe(ksig, regs, sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- rsig = sig;
- if (sig < 32 &&
- current_thread_info()->exec_domain &&
- current_thread_info()->exec_domain->signal_invmap)
- rsig = current_thread_info()->exec_domain->signal_invmap[sig];
-
- if (__put_user(rsig, &frame->sig) ||
+ if (__put_user(sig, &frame->sig) ||
__put_user(&frame->info, &frame->pinfo) ||
__put_user(&frame->uc, &frame->puc) ||
copy_siginfo_to_user(&frame->info, &ksig->info))
--
1.8.4.5

2015-04-11 20:52:07

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 14/24] s390: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/s390/include/asm/thread_info.h | 2 --
arch/s390/kernel/asm-offsets.c | 1 -
arch/s390/kernel/compat_signal.c | 14 ++------------
arch/s390/kernel/signal.c | 14 ++------------
4 files changed, 4 insertions(+), 27 deletions(-)

diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index ef1df71..0a6dcff 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -34,7 +34,6 @@
*/
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long sys_call_table; /* System call table address */
unsigned int cpu; /* current CPU */
@@ -51,7 +50,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index e07e916..e52a202 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -34,7 +34,6 @@ int main(void)
DEFINE(__THREAD_per_paid, offsetof(struct task_struct, thread.per_event.paid));
BLANK();
DEFINE(__TI_task, offsetof(struct thread_info, task));
- DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain));
DEFINE(__TI_flags, offsetof(struct thread_info, flags));
DEFINE(__TI_sysc_table, offsetof(struct thread_info, sys_call_table));
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 bc1df12..fe8d692 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)
return (void __user *)((sp - frame_size) & -8ul);
}

-static inline int map_signal(int sig)
-{
- if (current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32)
- return current_thread_info()->exec_domain->signal_invmap[sig];
- else
- return sig;
-}
-
static int setup_frame32(struct ksignal *ksig, sigset_t *set,
struct pt_regs *regs)
{
@@ -449,7 +439,7 @@ static int setup_frame32(struct ksignal *ksig, sigset_t *set,
(regs->psw.mask & ~PSW_MASK_ASC);
regs->psw.addr = (__force __u64) ksig->ka.sa.sa_handler;

- regs->gprs[2] = map_signal(sig);
+ regs->gprs[2] = sig;
regs->gprs[3] = (__force __u64) &frame->sc;

/* We forgot to include these in the sigcontext.
@@ -532,7 +522,7 @@ static int setup_rt_frame32(struct ksignal *ksig, sigset_t *set,
(regs->psw.mask & ~PSW_MASK_ASC);
regs->psw.addr = (__u64 __force) ksig->ka.sa.sa_handler;

- regs->gprs[2] = map_signal(ksig->sig);
+ regs->gprs[2] = ksig->sig;
regs->gprs[3] = (__force __u64) &frame->info;
regs->gprs[4] = (__force __u64) &frame->uc;
regs->gprs[5] = task_thread_info(current)->last_break;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index b3ae6f7..c3f71c4 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -309,16 +309,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
return (void __user *)((sp - frame_size) & -8ul);
}

-static inline int map_signal(int sig)
-{
- if (current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32)
- return current_thread_info()->exec_domain->signal_invmap[sig];
- else
- return sig;
-}
-
static int setup_frame(int sig, struct k_sigaction *ka,
sigset_t *set, struct pt_regs * regs)
{
@@ -386,7 +376,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
(regs->psw.mask & ~PSW_MASK_ASC);
regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE;

- regs->gprs[2] = map_signal(sig);
+ regs->gprs[2] = sig;
regs->gprs[3] = (unsigned long) &frame->sc;

/* We forgot to include these in the sigcontext.
@@ -468,7 +458,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
(regs->psw.mask & ~PSW_MASK_ASC);
regs->psw.addr = (unsigned long) ksig->ka.sa.sa_handler | PSW_ADDR_AMODE;

- regs->gprs[2] = map_signal(ksig->sig);
+ regs->gprs[2] = ksig->sig;
regs->gprs[3] = (unsigned long) &frame->info;
regs->gprs[4] = (unsigned long) &frame->uc;
regs->gprs[5] = task_thread_info(current)->last_break;
--
1.8.4.5

2015-04-11 20:49:27

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 15/24] sh: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/sh/include/asm/thread_info.h | 2 --
arch/sh/kernel/asm-offsets.c | 1 -
arch/sh/kernel/irq.c | 2 --
arch/sh/kernel/signal_32.c | 18 ++----------------
arch/sh/kernel/signal_64.c | 21 ++++-----------------
5 files changed, 6 insertions(+), 38 deletions(-)

diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index 657c039..2afa321 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -27,7 +27,6 @@

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
__u32 status; /* thread synchronous flags */
__u32 cpu;
@@ -56,7 +55,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.status = 0, \
.cpu = 0, \
diff --git a/arch/sh/kernel/asm-offsets.c b/arch/sh/kernel/asm-offsets.c
index 542225f..4bd44da 100644
--- a/arch/sh/kernel/asm-offsets.c
+++ b/arch/sh/kernel/asm-offsets.c
@@ -21,7 +21,6 @@ int main(void)
{
/* offsets into the thread_info struct */
DEFINE(TI_TASK, offsetof(struct thread_info, task));
- DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
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 65a1ecd..eb10ff8 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -124,7 +124,6 @@ void irq_ctx_init(int cpu)

irqctx = (union irq_ctx *)&hardirq_stack[cpu * THREAD_SIZE];
irqctx->tinfo.task = NULL;
- irqctx->tinfo.exec_domain = NULL;
irqctx->tinfo.cpu = cpu;
irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
@@ -133,7 +132,6 @@ void irq_ctx_init(int cpu)

irqctx = (union irq_ctx *)&softirq_stack[cpu * THREAD_SIZE];
irqctx->tinfo.task = NULL;
- irqctx->tinfo.exec_domain = NULL;
irqctx->tinfo.cpu = cpu;
irqctx->tinfo.preempt_count = 0;
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 0b34f2a..ab7b56b 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,
{
struct sigframe __user *frame;
int err = 0, sig = ksig->sig;
- int signal;

frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- signal = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);

if (_NSIG_WORDS > 1)
@@ -313,7 +306,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,

/* Set up registers for signal handler */
regs->regs[15] = (unsigned long) frame;
- regs->regs[4] = signal; /* Arg for signal handler */
+ regs->regs[4] = sig; /* Arg for signal handler */
regs->regs[5] = 0;
regs->regs[6] = (unsigned long) &frame->sc;

@@ -342,19 +335,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
{
struct rt_sigframe __user *frame;
int err = 0, sig = ksig->sig;
- int signal;

frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- signal = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
err |= copy_siginfo_to_user(&frame->info, &ksig->info);

/* Create the ucontext. */
@@ -392,7 +378,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,

/* Set up registers for signal handler */
regs->regs[15] = (unsigned long) frame;
- regs->regs[4] = signal; /* Arg for signal handler */
+ regs->regs[4] = sig; /* Arg for signal handler */
regs->regs[5] = (unsigned long) &frame->info;
regs->regs[6] = (unsigned long) &frame->uc;

diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index 71993c6..76122d6 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
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- signal = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);

/* 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
* All edited pointers are subject to NEFF.
*/
regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame);
- regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
+ regs->regs[REG_ARG1] = sig; /* Arg for signal handler */

/* FIXME:
The glibc profiling support for SH-5 needs to be passed a sigcontext
@@ -461,7 +455,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs

/* Broken %016Lx */
pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n",
- signal, current->comm, current->pid, frame,
+ sig, current->comm, current->pid, frame,
regs->pc >> 32, regs->pc & 0xffffffff,
DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff);

@@ -473,19 +467,12 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set,
{
struct rt_sigframe __user *frame;
int err = 0, sig = ksig->sig;
- int signal;

frame = get_sigframe(&ksig->ka, regs->regs[REG_SP], sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- signal = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
err |= __put_user(&frame->info, &frame->pinfo);
err |= __put_user(&frame->uc, &frame->puc);
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
@@ -542,7 +529,7 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set,
* All edited pointers are subject to NEFF.
*/
regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame);
- regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
+ regs->regs[REG_ARG1] = sig; /* Arg for signal handler */
regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info;
regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext;
regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler);
@@ -550,7 +537,7 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set,
set_fs(USER_DS);

pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n",
- signal, current->comm, current->pid, frame,
+ sig, current->comm, current->pid, frame,
regs->pc >> 32, regs->pc & 0xffffffff,
DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff);

--
1.8.4.5

2015-04-11 20:49:22

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 16/24] sparc: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/sparc/include/asm/thread_info_32.h | 27 ++++++++++++---------------
arch/sparc/include/asm/thread_info_64.h | 26 +++++++++++---------------
arch/sparc/kernel/traps_32.c | 1 -
arch/sparc/kernel/traps_64.c | 2 --
4 files changed, 23 insertions(+), 33 deletions(-)

diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index fd7bd0a..a7a1814 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -27,7 +27,6 @@
struct thread_info {
unsigned long uwinmask;
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable,
@@ -56,7 +55,6 @@ struct thread_info {
{ \
.uwinmask = 0, \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
@@ -85,19 +83,18 @@ register struct thread_info *current_thread_info_reg asm("g6");
*/
#define TI_UWINMASK 0x00 /* uwinmask */
#define TI_TASK 0x04
-#define TI_EXECDOMAIN 0x08 /* exec_domain */
-#define TI_FLAGS 0x0c
-#define TI_CPU 0x10
-#define TI_PREEMPT 0x14 /* preempt_count */
-#define TI_SOFTIRQ 0x18 /* softirq_count */
-#define TI_HARDIRQ 0x1c /* hardirq_count */
-#define TI_KSP 0x20 /* ksp */
-#define TI_KPC 0x24 /* kpc (ldd'ed with kpc) */
-#define TI_KPSR 0x28 /* kpsr */
-#define TI_KWIM 0x2c /* kwim (ldd'ed with kpsr) */
-#define TI_REG_WINDOW 0x30
-#define TI_RWIN_SPTRS 0x230
-#define TI_W_SAVED 0x250
+#define TI_FLAGS 0x08
+#define TI_CPU 0x0c
+#define TI_PREEMPT 0x10 /* preempt_count */
+#define TI_SOFTIRQ 0x14 /* softirq_count */
+#define TI_HARDIRQ 0x18 /* hardirq_count */
+#define TI_KSP 0x1c /* ksp */
+#define TI_KPC 0x20 /* kpc (ldd'ed with kpc) */
+#define TI_KPSR 0x24 /* kpsr */
+#define TI_KWIM 0x28 /* kwim (ldd'ed with kpsr) */
+#define TI_REG_WINDOW 0x2c
+#define TI_RWIN_SPTRS 0x22c
+#define TI_W_SAVED 0x24c

/*
* thread information flag bit numbers
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index ff45516..bde5982 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -31,7 +31,6 @@
#include <asm/types.h>

struct task_struct;
-struct exec_domain;

struct thread_info {
/* D$ line 1 */
@@ -44,7 +43,6 @@ struct thread_info {
/* D$ line 2 */
unsigned long fault_address;
struct pt_regs *kregs;
- struct exec_domain *exec_domain;
int preempt_count; /* 0 => preemptable, <0 => BUG */
__u8 new_child;
__u8 current_ds;
@@ -80,18 +78,17 @@ struct thread_info {
#define TI_KSP 0x00000018
#define TI_FAULT_ADDR 0x00000020
#define TI_KREGS 0x00000028
-#define TI_EXEC_DOMAIN 0x00000030
-#define TI_PRE_COUNT 0x00000038
-#define TI_NEW_CHILD 0x0000003c
-#define TI_CURRENT_DS 0x0000003d
-#define TI_CPU 0x0000003e
-#define TI_UTRAPS 0x00000040
-#define TI_REG_WINDOW 0x00000048
-#define TI_RWIN_SPTRS 0x000003c8
-#define TI_GSR 0x00000400
-#define TI_XFSR 0x00000438
-#define TI_KUNA_REGS 0x00000470
-#define TI_KUNA_INSN 0x00000478
+#define TI_PRE_COUNT 0x00000030
+#define TI_NEW_CHILD 0x00000034
+#define TI_CURRENT_DS 0x00000035
+#define TI_CPU 0x00000036
+#define TI_UTRAPS 0x00000038
+#define TI_REG_WINDOW 0x00000040
+#define TI_RWIN_SPTRS 0x000003c0
+#define TI_GSR 0x000003f8
+#define TI_XFSR 0x00000430
+#define TI_KUNA_REGS 0x00000468
+#define TI_KUNA_INSN 0x00000470
#define TI_FPREGS 0x00000480

/* We embed this in the uppermost byte of thread_info->flags */
@@ -119,7 +116,6 @@ struct thread_info {
{ \
.task = &tsk, \
.current_ds = ASI_P, \
- .exec_domain = &default_exec_domain, \
.preempt_count = INIT_PREEMPT_COUNT, \
}

diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 6fd386c..4f21df7 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -433,7 +433,6 @@ void trap_init(void)
/* Force linker to barf if mismatched */
if (TI_UWINMASK != offsetof(struct thread_info, uwinmask) ||
TI_TASK != offsetof(struct thread_info, task) ||
- TI_EXECDOMAIN != offsetof(struct thread_info, exec_domain) ||
TI_FLAGS != offsetof(struct thread_info, flags) ||
TI_CPU != offsetof(struct thread_info, cpu) ||
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 0e69974..d21cd62 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2691,8 +2691,6 @@ void __init trap_init(void)
fault_address) ||
TI_KREGS != offsetof(struct thread_info, kregs) ||
TI_UTRAPS != offsetof(struct thread_info, utraps) ||
- TI_EXEC_DOMAIN != offsetof(struct thread_info,
- exec_domain) ||
TI_REG_WINDOW != offsetof(struct thread_info,
reg_window) ||
TI_RWIN_SPTRS != offsetof(struct thread_info,
--
1.8.4.5

2015-04-11 20:49:30

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 17/24] tile: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/tile/include/asm/thread_info.h | 2 --
arch/tile/kernel/compat_signal.c | 9 +--------
arch/tile/kernel/signal.c | 9 +--------
3 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h
index 96c14c1..98ee10a 100644
--- a/arch/tile/include/asm/thread_info.h
+++ b/arch/tile/include/asm/thread_info.h
@@ -26,7 +26,6 @@
*/
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */
__u32 homecache_cpu; /* CPU we are homecached on */
@@ -51,7 +50,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c
index 8c5abf2..5cbc864 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,
unsigned long restorer;
struct compat_rt_sigframe __user *frame;
int err = 0, sig = ksig->sig;
- int usig;

frame = compat_get_sigframe(&ksig->ka, regs, sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto err;

- usig = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
/* Always write at least the signal number for the stack backtracer. */
if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
/* At sigreturn time, restore the callee-save registers too. */
@@ -243,7 +236,7 @@ int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set,
regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
regs->sp = ptr_to_compat_reg(frame);
regs->lr = restorer;
- regs->regs[0] = (unsigned long) usig;
+ regs->regs[0] = (unsigned long) sig;
regs->regs[1] = ptr_to_compat_reg(&frame->info);
regs->regs[2] = ptr_to_compat_reg(&frame->uc);
regs->flags |= PT_FLAGS_CALLER_SAVES;
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c
index 8a524e3..87299a6 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,
unsigned long restorer;
struct rt_sigframe __user *frame;
int err = 0, sig = ksig->sig;
- int usig;

frame = get_sigframe(&ksig->ka, regs, sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto err;

- usig = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
/* Always write at least the signal number for the stack backtracer. */
if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
/* At sigreturn time, restore the callee-save registers too. */
@@ -198,7 +191,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
regs->sp = (unsigned long) frame;
regs->lr = restorer;
- regs->regs[0] = (unsigned long) usig;
+ regs->regs[0] = (unsigned long) sig;
regs->regs[1] = (unsigned long) &frame->info;
regs->regs[2] = (unsigned long) &frame->uc;
regs->flags |= PT_FLAGS_CALLER_SAVES;
--
1.8.4.5

2015-04-11 20:51:45

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 18/24] um: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/um/include/asm/thread_info.h | 2 --
arch/x86/um/signal.c | 7 -------
2 files changed, 9 deletions(-)

diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index e04114c..b30c85b 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -14,7 +14,6 @@

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */
int preempt_count; /* 0 => preemptable,
@@ -28,7 +27,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c
index 0c8c32b..592491d 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,
if (err)
return err;

- /* Set up registers for signal handler */
- {
- struct exec_domain *ed = current_thread_info()->exec_domain;
- if (unlikely(ed && ed->signal_invmap && sig < 32))
- sig = ed->signal_invmap[sig];
- }
-
PT_REGS_SP(regs) = (unsigned long) frame;
PT_REGS_DI(regs) = sig;
/* In case the signal handler was declared without prototypes */
--
1.8.4.5

2015-04-11 20:51:24

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 19/24] unicore32: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/unicore32/include/asm/thread_info.h | 3 ---
arch/unicore32/kernel/asm-offsets.c | 1 -
arch/unicore32/kernel/signal.c | 7 -------
3 files changed, 11 deletions(-)

diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h
index 63e2839..e79ad6d 100644
--- a/arch/unicore32/include/asm/thread_info.h
+++ b/arch/unicore32/include/asm/thread_info.h
@@ -24,7 +24,6 @@
#ifndef __ASSEMBLY__

struct task_struct;
-struct exec_domain;

#include <asm/types.h>

@@ -71,7 +70,6 @@ struct thread_info {
/* <0 => bug */
mm_segment_t addr_limit; /* address limit */
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
__u32 cpu; /* cpu */
struct cpu_context_save cpu_context; /* cpu context */
__u32 syscall; /* syscall number */
@@ -84,7 +82,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
.addr_limit = KERNEL_DS, \
diff --git a/arch/unicore32/kernel/asm-offsets.c b/arch/unicore32/kernel/asm-offsets.c
index ffcbe75..80d50c4 100644
--- a/arch/unicore32/kernel/asm-offsets.c
+++ b/arch/unicore32/kernel/asm-offsets.c
@@ -42,7 +42,6 @@ int main(void)
DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
- DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
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 d329f85..4ae51cf 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,
}

/*
- * translate the signal
- */
- if (usig < 32 && thread->exec_domain
- && thread->exec_domain->signal_invmap)
- usig = thread->exec_domain->signal_invmap[usig];
-
- /*
* Set up the stack frame
*/
if (ksig->ka.sa.sa_flags & SA_SIGINFO)
--
1.8.4.5

2015-04-11 20:51:05

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 20/24] x86: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/x86/include/asm/thread_info.h | 3 ---
arch/x86/kernel/signal.c | 16 +---------------
2 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 1d4e4f2..2df52ba 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -19,13 +19,11 @@
*/
#ifndef __ASSEMBLY__
struct task_struct;
-struct exec_domain;
#include <asm/processor.h>
#include <linux/atomic.h>

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
__u32 flags; /* low level flags */
__u32 status; /* thread synchronous flags */
__u32 cpu; /* current CPU */
@@ -39,7 +37,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.saved_preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index e504246..5ddc7ec 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -592,24 +592,10 @@ badframe:
return 0;
}

-/*
- * OK, we're invoking a handler:
- */
-static int signr_convert(int sig)
-{
-#ifdef CONFIG_X86_32
- struct thread_info *info = current_thread_info();
-
- if (info->exec_domain && info->exec_domain->signal_invmap && sig < 32)
- return info->exec_domain->signal_invmap[sig];
-#endif /* CONFIG_X86_32 */
- return sig;
-}
-
static int
setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
{
- int usig = signr_convert(ksig->sig);
+ int usig = ksig->sig;
sigset_t *set = sigmask_to_save();
compat_sigset_t *cset = (compat_sigset_t *) set;

--
1.8.4.5

2015-04-11 20:50:21

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 21/24] xtensa: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/xtensa/include/asm/thread_info.h | 2 --
arch/xtensa/kernel/signal.c | 11 ++---------
2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
index a9b5d3b..d120278 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 {

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */
__u32 cpu; /* current CPU */
@@ -83,7 +82,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index 3d733ba..1785c4d 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,
{
struct rt_sigframe *frame;
int err = 0, sig = ksig->sig;
- int signal;
unsigned long sp, ra, tp;

sp = regs->areg[1];
@@ -354,12 +353,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
return -EFAULT;
}

- signal = current_thread_info()->exec_domain
- && current_thread_info()->exec_domain->signal_invmap
- && sig < 32
- ? current_thread_info()->exec_domain->signal_invmap[sig]
- : sig;
-
if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
}
@@ -400,7 +393,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
* Note: PS.CALLINC is set to one by start_thread
*/
regs->areg[4] = (((unsigned long) ra) & 0x3fffffff) | 0x40000000;
- regs->areg[6] = (unsigned long) signal;
+ regs->areg[6] = (unsigned long) sig;
regs->areg[7] = (unsigned long) &frame->info;
regs->areg[8] = (unsigned long) &frame->uc;
regs->threadptr = tp;
@@ -412,7 +405,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,

#if DEBUG_SIG
printk("SIG rt deliver (%s:%d): signal=%d sp=%p pc=%08x\n",
- current->comm, current->pid, signal, frame, regs->pc);
+ current->comm, current->pid, sig, frame, regs->pc);
#endif

return 0;
--
1.8.4.5

2015-04-11 20:50:19

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 22/24] arc: Remove signal translation and exec_domain

As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/arc/include/asm/thread_info.h | 2 --
arch/arc/kernel/signal.c | 14 +-------------
2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h
index 1163a18..aca0d5a 100644
--- a/arch/arc/include/asm/thread_info.h
+++ b/arch/arc/include/asm/thread_info.h
@@ -43,7 +43,6 @@ struct thread_info {
int preempt_count; /* 0 => preemptable, <0 => BUG */
struct task_struct *task; /* main task structure */
mm_segment_t addr_limit; /* thread address space */
- struct exec_domain *exec_domain;/* execution domain */
__u32 cpu; /* current CPU */
unsigned long thr_ptr; /* TLS ptr */
};
@@ -56,7 +55,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c
index edda76f..2251fb4 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,
return frame;
}

-/*
- * translate the signal
- */
-static inline int map_sig(int sig)
-{
- struct thread_info *thread = current_thread_info();
- if (thread->exec_domain && thread->exec_domain->signal_invmap
- && sig < 32)
- sig = thread->exec_domain->signal_invmap[sig];
- return sig;
-}
-
static int
setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
{
@@ -231,7 +219,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
return err;

/* #1 arg to the user Signal handler */
- regs->r0 = map_sig(ksig->sig);
+ regs->r0 = ksig->sig;

/* setup PC of user space signal handler */
regs->ret = (unsigned long)ksig->ka.sa.sa_handler;
--
1.8.4.5

2015-04-11 20:49:38

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 23/24] arch: Remove exec_domain from remaining archs

Signed-off-by: Richard Weinberger <[email protected]>
---
arch/alpha/include/asm/thread_info.h | 2 --
arch/avr32/include/asm/thread_info.h | 3 ---
arch/avr32/kernel/asm-offsets.c | 1 -
arch/c6x/include/asm/thread_info.h | 2 --
arch/cris/arch-v10/kernel/signal.c | 2 --
arch/cris/arch-v32/kernel/signal.c | 2 --
arch/cris/include/asm/thread_info.h | 2 --
arch/hexagon/include/asm/thread_info.h | 2 --
arch/ia64/include/asm/thread_info.h | 2 --
arch/metag/include/asm/thread_info.h | 2 --
arch/metag/kernel/irq.c | 2 --
arch/mips/include/asm/thread_info.h | 2 --
arch/mips/kernel/asm-offsets.c | 1 -
arch/nios2/include/asm/thread_info.h | 2 --
arch/openrisc/include/asm/thread_info.h | 2 --
arch/openrisc/kernel/signal.c | 2 --
arch/parisc/include/asm/thread_info.h | 2 --
arch/parisc/kernel/asm-offsets.c | 1 -
arch/powerpc/include/asm/thread_info.h | 2 --
arch/score/include/asm/thread_info.h | 2 --
arch/score/kernel/asm-offsets.c | 1 -
21 files changed, 39 deletions(-)

diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index d5b98ab..32e920a 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -18,7 +18,6 @@ struct thread_info {
unsigned int flags; /* low level flags */
unsigned int ieee_state; /* see fpu.h */

- struct exec_domain *exec_domain; /* execution domain */
mm_segment_t addr_limit; /* thread address space */
unsigned cpu; /* current CPU */
int preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -35,7 +34,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.addr_limit = KERNEL_DS, \
.preempt_count = INIT_PREEMPT_COUNT, \
}
diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
index d56afa9..d4d3079 100644
--- a/arch/avr32/include/asm/thread_info.h
+++ b/arch/avr32/include/asm/thread_info.h
@@ -17,11 +17,9 @@
#include <asm/types.h>

struct task_struct;
-struct exec_domain;

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
__u32 cpu;
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -36,7 +34,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/avr32/kernel/asm-offsets.c b/arch/avr32/kernel/asm-offsets.c
index e41c845..2c9764f 100644
--- a/arch/avr32/kernel/asm-offsets.c
+++ b/arch/avr32/kernel/asm-offsets.c
@@ -12,7 +12,6 @@
void foo(void)
{
OFFSET(TI_task, thread_info, task);
- OFFSET(TI_exec_domain, thread_info, exec_domain);
OFFSET(TI_flags, thread_info, flags);
OFFSET(TI_cpu, thread_info, cpu);
OFFSET(TI_preempt_count, thread_info, preempt_count);
diff --git a/arch/c6x/include/asm/thread_info.h b/arch/c6x/include/asm/thread_info.h
index 584e253..acc70c1 100644
--- a/arch/c6x/include/asm/thread_info.h
+++ b/arch/c6x/include/asm/thread_info.h
@@ -40,7 +40,6 @@ typedef struct {
*/
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */
int preempt_count; /* 0 = preemptable, <0 = BUG */
@@ -55,7 +54,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 74d7ba3..7122d97 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,
if (err)
return -EFAULT;

- /* TODO what is the current->exec_domain stuff and invmap ? */
-
/* Set up registers for signal handler */

/* What we enter NOW */
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index 870e3e0..0c9ce9e 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)
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;

- /* TODO: what is the current->exec_domain stuff and invmap ? */
-
err |= __put_user(&frame->info, &frame->pinfo);
err |= __put_user(&frame->uc, &frame->puc);
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 7286db5..4ead1b4 100644
--- a/arch/cris/include/asm/thread_info.h
+++ b/arch/cris/include/asm/thread_info.h
@@ -28,7 +28,6 @@
#ifndef __ASSEMBLY__
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */
int preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -50,7 +49,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/hexagon/include/asm/thread_info.h b/arch/hexagon/include/asm/thread_info.h
index bacd3d6..b80fe1d 100644
--- a/arch/hexagon/include/asm/thread_info.h
+++ b/arch/hexagon/include/asm/thread_info.h
@@ -47,7 +47,6 @@ typedef struct {

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
__u32 cpu; /* current cpu */
int preempt_count; /* 0=>preemptible,<0=>BUG */
@@ -77,7 +76,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = 1, \
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index c16f21a..aa995b6 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -20,7 +20,6 @@
*/
struct thread_info {
struct task_struct *task; /* XXX not really needed, except for dup_task_struct() */
- struct exec_domain *exec_domain;/* execution domain */
__u32 flags; /* thread_info flags (see TIF_*) */
__u32 cpu; /* current CPU */
__u32 last_cpu; /* Last CPU thread ran on */
@@ -40,7 +39,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.addr_limit = KERNEL_DS, \
diff --git a/arch/metag/include/asm/thread_info.h b/arch/metag/include/asm/thread_info.h
index afb3ca4..32677cc 100644
--- a/arch/metag/include/asm/thread_info.h
+++ b/arch/metag/include/asm/thread_info.h
@@ -28,7 +28,6 @@
/* This must be 8 byte aligned so we can ensure stack alignment. */
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */
u32 cpu; /* current CPU */
@@ -68,7 +67,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/metag/kernel/irq.c b/arch/metag/kernel/irq.c
index 5385dd1..4f8f1f8 100644
--- a/arch/metag/kernel/irq.c
+++ b/arch/metag/kernel/irq.c
@@ -132,7 +132,6 @@ void irq_ctx_init(int cpu)

irqctx = (union irq_ctx *) &hardirq_stack[cpu * THREAD_SIZE];
irqctx->tinfo.task = NULL;
- irqctx->tinfo.exec_domain = NULL;
irqctx->tinfo.cpu = cpu;
irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
@@ -141,7 +140,6 @@ void irq_ctx_init(int cpu)

irqctx = (union irq_ctx *) &softirq_stack[cpu * THREAD_SIZE];
irqctx->tinfo.task = NULL;
- irqctx->tinfo.exec_domain = NULL;
irqctx->tinfo.cpu = cpu;
irqctx->tinfo.preempt_count = 0;
irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 55ed660..8408a30 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -23,7 +23,6 @@
*/
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long tp_value; /* thread pointer */
__u32 cpu; /* current CPU */
@@ -44,7 +43,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = _TIF_FIXADE, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 750d67a..8f89102 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)
{
COMMENT("MIPS thread_info offsets.");
OFFSET(TI_TASK, thread_info, task);
- OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
OFFSET(TI_FLAGS, thread_info, flags);
OFFSET(TI_TP_VALUE, thread_info, tp_value);
OFFSET(TI_CPU, thread_info, cpu);
diff --git a/arch/nios2/include/asm/thread_info.h b/arch/nios2/include/asm/thread_info.h
index 1f26657..faf97e6 100644
--- a/arch/nios2/include/asm/thread_info.h
+++ b/arch/nios2/include/asm/thread_info.h
@@ -39,7 +39,6 @@ typedef struct {
*/
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */
int preempt_count; /* 0 => preemptable,<0 => BUG */
@@ -59,7 +58,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
diff --git a/arch/openrisc/include/asm/thread_info.h b/arch/openrisc/include/asm/thread_info.h
index 875f084..6e619a7 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;

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */
@@ -73,7 +72,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.preempt_count = 1, \
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c
index 4112175b..c82be69 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,
if (err)
return -EFAULT;

- /* TODO what is the current->exec_domain stuff and invmap ? */
-
/* Set up registers for signal handler */
regs->pc = (unsigned long)ksig->ka.sa.sa_handler; /* what we enter NOW */
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 fb13e38..e96e693 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -9,7 +9,6 @@

struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain;/* execution domain */
unsigned long flags; /* thread_info flags (see TIF_*) */
mm_segment_t addr_limit; /* user-level address space limit */
__u32 cpu; /* current CPU */
@@ -19,7 +18,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.flags = 0, \
.cpu = 0, \
.addr_limit = KERNEL_DS, \
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index dcd5510..59001ce 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -242,7 +242,6 @@ int main(void)
DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN));
BLANK();
DEFINE(TI_TASK, offsetof(struct thread_info, task));
- DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
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 7248979..7efee4a 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -39,7 +39,6 @@
*/
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable,
<0 => BUG */
@@ -55,7 +54,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
.flags = 0, \
diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h
index 33864fa..7d9ffb1 100644
--- a/arch/score/include/asm/thread_info.h
+++ b/arch/score/include/asm/thread_info.h
@@ -28,7 +28,6 @@
*/
struct thread_info {
struct task_struct *task; /* main task structure */
- struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */
unsigned long tp_value; /* thread pointer */
__u32 cpu; /* current CPU */
@@ -53,7 +52,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
- .exec_domain = &default_exec_domain, \
.cpu = 0, \
.preempt_count = 1, \
.addr_limit = KERNEL_DS, \
diff --git a/arch/score/kernel/asm-offsets.c b/arch/score/kernel/asm-offsets.c
index b4d5214..52794f9 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)
{
COMMENT("SCORE thread_info offsets.");
OFFSET(TI_TASK, thread_info, task);
- OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
OFFSET(TI_FLAGS, thread_info, flags);
OFFSET(TI_TP_VALUE, thread_info, tp_value);
OFFSET(TI_CPU, thread_info, cpu);
--
1.8.4.5

2015-04-11 20:49:42

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 24/24] Remove rest of exec domains.

It is gone from all archs, now we can remove
the final bits.

Signed-off-by: Richard Weinberger <[email protected]>
---
include/linux/personality.h | 40 +---------------------------------------
include/linux/sched.h | 6 ------
kernel/exec_domain.c | 37 -------------------------------------
3 files changed, 1 insertion(+), 82 deletions(-)

diff --git a/include/linux/personality.h b/include/linux/personality.h
index 646c0a7..aeb7892 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -3,52 +3,14 @@

#include <uapi/linux/personality.h>

-
-/*
- * Handling of different ABIs (personalities).
- */
-
-struct exec_domain;
-struct pt_regs;
-
-extern int register_exec_domain(struct exec_domain *);
-extern int unregister_exec_domain(struct exec_domain *);
-extern int __set_personality(unsigned int);
-
-
-/*
- * Description of an execution domain.
- *
- * The first two members are refernced from assembly source
- * and should stay where they are unless explicitly needed.
- */
-typedef void (*handler_t)(int, struct pt_regs *);
-
-struct exec_domain {
- const char *name; /* name of the execdomain */
- handler_t handler; /* handler for syscalls */
- unsigned char pers_low; /* lowest personality */
- unsigned char pers_high; /* highest personality */
- unsigned long *signal_map; /* signal mapping */
- unsigned long *signal_invmap; /* reverse signal mapping */
- struct map_segment *err_map; /* error mapping */
- struct map_segment *socktype_map; /* socket type mapping */
- struct map_segment *sockopt_map; /* socket option mapping */
- struct map_segment *af_map; /* address family mapping */
- struct module *module; /* module context of the ed. */
- struct exec_domain *next; /* linked list (internal) */
-};
-
/*
* Return the base personality without flags.
*/
#define personality(pers) (pers & PER_MASK)

-
/*
* Change personality of the currently running process.
*/
-#define set_personality(pers) \
- ((current->personality == (pers)) ? 0 : __set_personality(pers))
+#define set_personality(pers) (current->personality = (pers))

#endif /* _LINUX_PERSONALITY_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a419b65..14d9117 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -125,7 +125,6 @@ struct sched_attr {
u64 sched_period;
};

-struct exec_domain;
struct futex_pi_state;
struct robust_list_head;
struct bio_list;
@@ -2288,11 +2287,6 @@ extern void set_curr_task(int cpu, struct task_struct *p);

void yield(void);

-/*
- * The default (Linux) execution domain.
- */
-extern struct exec_domain default_exec_domain;
-
union thread_union {
struct thread_info thread_info;
unsigned long stack[THREAD_SIZE/sizeof(long)];
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
index b2fb57d..6873bb3 100644
--- a/kernel/exec_domain.c
+++ b/kernel/exec_domain.c
@@ -20,43 +20,6 @@
#include <linux/types.h>
#include <linux/fs_struct.h>

-static void default_handler(int, struct pt_regs *);
-static unsigned long ident_map[32] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31
-};
-
-struct exec_domain default_exec_domain = {
- .name = "Linux", /* name */
- .handler = default_handler, /* lcall7 causes a seg fault. */
- .pers_low = 0, /* PER_LINUX personality. */
- .pers_high = 0, /* PER_LINUX personality. */
- .signal_map = ident_map, /* Identity map signals. */
- .signal_invmap = ident_map, /* - both ways. */
-};
-
-
-static void
-default_handler(int segment, struct pt_regs *regp)
-{
- set_personality(0);
-
- if (current_thread_info()->exec_domain->handler != default_handler)
- current_thread_info()->exec_domain->handler(segment, regp);
- else
- send_sig(SIGSEGV, current, 1);
-}
-
-int __set_personality(unsigned int personality)
-{
- current->personality = personality;
-
- return 0;
-}
-EXPORT_SYMBOL(__set_personality);
-
#ifdef CONFIG_PROC_FS
static int execdomains_proc_show(struct seq_file *m, void *v)
{
--
1.8.4.5

2015-04-11 20:52:29

by Linus Torvalds

[permalink] [raw]
Subject: Re: Remove execution domain support

On Sat, Apr 11, 2015 at 1:47 PM, Richard Weinberger <[email protected]> wrote:
>
> The removal will make architecutre specific signal handling easier
> and there is no need to keep execuction domains as this feature is
> obviously incomplete and abandoned

Ack. The whole exec domain made some code code pretty inscrutable.

So I'd certainly be willing to pull this during the 4.1 merge window
if nobody complains.

Anybody?

Linus

2015-04-11 21:04:47

by Al Viro

[permalink] [raw]
Subject: Re: Remove execution domain support

On Sat, Apr 11, 2015 at 01:52:21PM -0700, Linus Torvalds wrote:
> On Sat, Apr 11, 2015 at 1:47 PM, Richard Weinberger <[email protected]> wrote:
> >
> > The removal will make architecutre specific signal handling easier
> > and there is no need to keep execuction domains as this feature is
> > obviously incomplete and abandoned
>
> Ack. The whole exec domain made some code code pretty inscrutable.
>
> So I'd certainly be willing to pull this during the 4.1 merge window
> if nobody complains.
>
> Anybody?

IIRC, only two places really used that thing - iBCS2 shite and RISCOS
compat one. The former isnot in the tree at all, and I've no idea
how many users does the latter one have. Probably not many, judging by this:
config ARTHUR
tristate "RISC OS personality"
depends on !AEABI
help
Say Y here to include the kernel code necessary if you want to run
Acorn RISC OS/Arthur binaries under Linux. This code is still very
experimental; if this sounds frightening, say N and sleep in peace.
You can also say M here to compile this support as a module (which
will be called arthur).

rmk might have a better idea of whether anyone gives a damn...

2015-04-11 21:08:47

by Richard Weinberger

[permalink] [raw]
Subject: Re: Remove execution domain support

Am 11.04.2015 um 23:04 schrieb Al Viro:
> On Sat, Apr 11, 2015 at 01:52:21PM -0700, Linus Torvalds wrote:
>> On Sat, Apr 11, 2015 at 1:47 PM, Richard Weinberger <[email protected]> wrote:
>>>
>>> The removal will make architecutre specific signal handling easier
>>> and there is no need to keep execuction domains as this feature is
>>> obviously incomplete and abandoned
>>
>> Ack. The whole exec domain made some code code pretty inscrutable.
>>
>> So I'd certainly be willing to pull this during the 4.1 merge window
>> if nobody complains.
>>
>> Anybody?
>
> IIRC, only two places really used that thing - iBCS2 shite and RISCOS
> compat one. The former isnot in the tree at all, and I've no idea
> how many users does the latter one have. Probably not many, judging by this:
> config ARTHUR
> tristate "RISC OS personality"
> depends on !AEABI
> help
> Say Y here to include the kernel code necessary if you want to run
> Acorn RISC OS/Arthur binaries under Linux. This code is still very
> experimental; if this sounds frightening, say N and sleep in peace.
> You can also say M here to compile this support as a module (which
> will be called arthur).
>
> rmk might have a better idea of whether anyone gives a damn...

Many moons ago I've sent a patch to remove RISOS support.
He liked it:
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/274298.html

Thanks,
//richard

2015-04-11 21:12:56

by Richard Weinberger

[permalink] [raw]
Subject: Re: Remove execution domain support

Am 11.04.2015 um 22:52 schrieb Linus Torvalds:
> On Sat, Apr 11, 2015 at 1:47 PM, Richard Weinberger <[email protected]> wrote:
>>
>> The removal will make architecutre specific signal handling easier
>> and there is no need to keep execuction domains as this feature is
>> obviously incomplete and abandoned
>
> Ack. The whole exec domain made some code code pretty inscrutable.
>
> So I'd certainly be willing to pull this during the 4.1 merge window
> if nobody complains.
>
> Anybody?

It would be great to have an Ack from sparc folks.
I had to recalculate the values of their TI_* constants
and I don't have a sparc box to test it.

Using asm-offsets.c for that seems to be impossible on sparc
as sparc's asm-offsets.c depends on sched.h which depends again
on thread_info.h...
Resolving this circular dependency without the ability to run-time
test my changes was too risky for me.

Thanks,
//richard

2015-04-11 22:22:06

by David Miller

[permalink] [raw]
Subject: Re: Remove execution domain support

From: Richard Weinberger <[email protected]>
Date: Sat, 11 Apr 2015 23:12:47 +0200

> Am 11.04.2015 um 22:52 schrieb Linus Torvalds:
>> On Sat, Apr 11, 2015 at 1:47 PM, Richard Weinberger <[email protected]> wrote:
>>>
>>> The removal will make architecutre specific signal handling easier
>>> and there is no need to keep execuction domains as this feature is
>>> obviously incomplete and abandoned
>>
>> Ack. The whole exec domain made some code code pretty inscrutable.
>>
>> So I'd certainly be willing to pull this during the 4.1 merge window
>> if nobody complains.
>>
>> Anybody?
>
> It would be great to have an Ack from sparc folks.
> I had to recalculate the values of their TI_* constants
> and I don't have a sparc box to test it.

I'm fine with it, I'll fix it up if needed:

Acked-by: David S. Miller <[email protected]>


2015-04-11 23:28:45

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Remove execution domain support

On Sat, 2015-04-11 at 23:12 +0200, Richard Weinberger wrote:
> Am 11.04.2015 um 22:52 schrieb Linus Torvalds:
> > On Sat, Apr 11, 2015 at 1:47 PM, Richard Weinberger <[email protected]> wrote:
> >>
> >> The removal will make architecutre specific signal handling easier
> >> and there is no need to keep execuction domains as this feature is
> >> obviously incomplete and abandoned
> >
> > Ack. The whole exec domain made some code code pretty inscrutable.
> >
> > So I'd certainly be willing to pull this during the 4.1 merge window
> > if nobody complains.
> >
> > Anybody?
>
> It would be great to have an Ack from sparc folks.
> I had to recalculate the values of their TI_* constants
> and I don't have a sparc box to test it.

That's what qemu is for :-)

> Using asm-offsets.c for that seems to be impossible on sparc
> as sparc's asm-offsets.c depends on sched.h which depends again
> on thread_info.h...
> Resolving this circular dependency without the ability to run-time
> test my changes was too risky for me.
>
> Thanks,
> //richard
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arch" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2015-04-11 23:30:13

by Stephen Rothwell

[permalink] [raw]
Subject: Re: Remove execution domain support

Hi Linus,

On Sat, 11 Apr 2015 13:52:21 -0700 Linus Torvalds <[email protected]> wrote:
>
> On Sat, Apr 11, 2015 at 1:47 PM, Richard Weinberger <[email protected]> wrote:
> >
> > The removal will make architecutre specific signal handling easier
> > and there is no need to keep execuction domains as this feature is
> > obviously incomplete and abandoned
>
> Ack. The whole exec domain made some code code pretty inscrutable.
>
> So I'd certainly be willing to pull this during the 4.1 merge window
> if nobody complains.
>
> Anybody?

How about we put it in linux-next for a day or two before it gets
pulled into your tree just to shake out any obvious compile/conflict
problems?

/me volunteers for more late nights :-(
--
Cheers,
Stephen Rothwell [email protected]


Attachments:
(No filename) (819.00 B)
OpenPGP digital signature

2015-04-12 00:06:26

by Stephen Rothwell

[permalink] [raw]
Subject: Re: Remove execution domain support

Hi Richard,

On Sun, 12 Apr 2015 09:30:01 +1000 Stephen Rothwell
<[email protected]> wrote:
>
> How about we put it in linux-next for a day or two before it gets
> pulled into your tree just to shake out any obvious compile/conflict
> problems?

For example, this new warning in the arm multi_v7_defconfig build (I
did a test merge on top of the latest linux-next and some simple
builds):

arch/arm/kernel/traps.c: In function 'bad_syscall':
arch/arm/kernel/traps.c:508:22: warning: unused variable 'thread' [-Wunused-variable]
struct thread_info *thread = current_thread_info();
^

The merge produced no conflicts needing manual resolution.
--
Cheers,
Stephen Rothwell [email protected]


Attachments:
(No filename) (819.00 B)
OpenPGP digital signature

2015-04-12 02:03:27

by Guenter Roeck

[permalink] [raw]
Subject: Re: Remove execution domain support

On Sat, Apr 11, 2015 at 10:47:39PM +0200, Richard Weinberger wrote:

[ ... ]
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git exec_domain_rip_v1
>

Build results:
total: 121 pass: 121 fail: 0
Qemu test results:
total: 30 pass: 27 fail: 3
Failed tests:
sparc32:sparc_defconfig
sparc32:sparc_smp_defconfig
xtensa:xtensa_defconfig

Sparc crashes, xtensa hangs.

Details (with logs) ara available at http://server.roeck-us.net:8010/builders,
in the 'testing' column.

Guenter

2015-04-12 20:57:33

by Richard Weinberger

[permalink] [raw]
Subject: Remove execution domain support v2

This is v2 of the exec domain removal series I've posted yesterday:
https://lkml.org/lkml/2015/4/11/181
I've omitted resending all patches again to lower the churn on LKML.

The whole series can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git exec_domain_rip_v2

Changes since v1:
- Fixed sparc and xtensa thread info offsets
Special thanks to Guenter Roeck for reporting and testing!
- Fixed an unused variable on arm
Thanks to Stephen Rothwell!
- Added David Millers ACK

Stephen, can you please add the tree to -next?

Original description:

A long time ago there was the idea to support different ABIs on Linux
Such that someone could use for example SCO UNIX binaries on Linux
without emulation. While the linux-abi project existed mostly as
out-of-tree patch it's core component, execution domains,
went mainline. An execution domain allows to specify mappings between
different ABIs, these mappings consist of signal, error, socket type,
socket options and addess familiy mappings.
Mainline has only support for signal mappings.
The signal mapping happens in the architecutre specific signal code.
Some archs support it, some not, most of them copy&pasted from i386.

While the mapping support is incomplete we have two in-kernel users of
execution domains.

1. RISC OS personality on ARM.
The Kconfig help message states that this feature is very experimental
and it is likely that it never worked as expected.
Russel is fine with the removal.

2. ia32 support on ia64.
This is a left over from:
commit 32974ad4907cdde6c9de612cd1b2ee0568fb9409 ([IA64] Remove COMPAT_IA32 support)
It registers a dummy Linux/x86 execdomain to make calls to
personality(PER_LINUX32) faster as the execution domain core code
would try to load a module.

As both users can be removed there is no user left and we can remove
execution domains support at all from the kernel.
The removal will make architecutre specific signal handling easier
and there is no need to keep execuction domains as this feature is
obviously incomplete and abandoned.

Guenter Roeck (1):
sparc: Fix execution domain removal

Richard Weinberger (25):
arm: Remove RISC OS personality
ia64: Remove Linux/x86 exec domain support
Remove execution domain support
arm: Remove signal translation and exec_domain
arm64: Remove signal translation and exec_domain
blackfin: Autogenerate offsets in struct thread_info
blackfin: Remove exec_domain usage
frv: Remove signal translation and exec_domain
m32r: Autogenerate offsets in struct thread_info
m32r: Remove signal translation and exec_domain
m68k: Remove signal translation and exec_domain
microblaze: Remove signal translation and exec_domain
mn10300: Remove signal translation and exec_domain
s390: Remove signal translation and exec_domain
sh: Remove signal translation and exec_domain
sparc: Remove signal translation and exec_domain
tile: Remove signal translation and exec_domain
um: Remove signal translation and exec_domain
unicore32: Remove signal translation and exec_domain
x86: Remove signal translation and exec_domain
xtensa: Autogenerate offsets in struct thread_info
xtensa: Remove signal translation and exec_domain
arc: Remove signal translation and exec_domain
arch: Remove exec_domain from remaining archs
Remove rest of exec domains.

Thanks,
//richard

2015-04-12 21:13:24

by Stephen Rothwell

[permalink] [raw]
Subject: Re: Remove execution domain support v2

Hi Richard,

On Sun, 12 Apr 2015 22:57:01 +0200 Richard Weinberger <[email protected]> wrote:
>
> Stephen, can you please add the tree to -next?

Added from today. I'll remove it after Linus merges it, OK?

Thanks for adding your subsystem tree as a participant of linux-next. As
you may know, this is not a judgment of your code. The purpose of
linux-next is for integration testing and to lower the impact of
conflicts between subsystems in the next merge window.

You will need to ensure that the patches/commits in your tree/series have
been:
* submitted under GPL v2 (or later) and include the Contributor's
Signed-off-by,
* posted to the relevant mailing list,
* reviewed by you (or another maintainer of your subsystem tree),
* successfully unit tested, and
* destined for the current or next Linux merge window.

Basically, this should be just what you would send to Linus (or ask him
to fetch). It is allowed to be rebased if you deem it necessary.

--
Cheers,
Stephen Rothwell
[email protected]


Attachments:
(No filename) (819.00 B)
OpenPGP digital signature

2015-04-12 21:17:20

by Richard Weinberger

[permalink] [raw]
Subject: Re: Remove execution domain support v2

Stephen,

Am 12.04.2015 um 23:13 schrieb Stephen Rothwell:
> Hi Richard,
>
> On Sun, 12 Apr 2015 22:57:01 +0200 Richard Weinberger <[email protected]> wrote:
>>
>> Stephen, can you please add the tree to -next?
>
> Added from today. I'll remove it after Linus merges it, OK?

sure.

Thanks,
//richard

2015-04-12 21:56:20

by Linus Torvalds

[permalink] [raw]
Subject: Re: Remove execution domain support v2

On Sun, Apr 12, 2015 at 2:17 PM, Richard Weinberger <[email protected]> wrote:
>>
>> On Sun, 12 Apr 2015 22:57:01 +0200 Richard Weinberger <[email protected]> wrote:
>>>
>>> Stephen, can you please add the tree to -next?
>>
>> Added from today. I'll remove it after Linus merges it, OK?
>
> sure.

Richard, I'll do 4.0 today and start merging, but since this is going
into -next, let's wait a few days to verify that there are no issues,
and then please send me a "final" pull request mid next weeks or so.

Otherwise I'll probably forget in the chaos that is the early merge
window for me.

Ok?

Linus

2015-04-12 22:06:54

by Richard Weinberger

[permalink] [raw]
Subject: Re: Remove execution domain support v2

Am 12.04.2015 um 23:56 schrieb Linus Torvalds:
> Richard, I'll do 4.0 today and start merging, but since this is going
> into -next, let's wait a few days to verify that there are no issues,
> and then please send me a "final" pull request mid next weeks or so.
>
> Otherwise I'll probably forget in the chaos that is the early merge
> window for me.
>
> Ok?

Okay, will do!

Thanks,
//richard

2015-04-12 23:00:45

by Guenter Roeck

[permalink] [raw]
Subject: Re: Remove execution domain support v2

On 04/12/2015 01:57 PM, Richard Weinberger wrote:
> This is v2 of the exec domain removal series I've posted yesterday:
> https://lkml.org/lkml/2015/4/11/181
> I've omitted resending all patches again to lower the churn on LKML.
>
> The whole series can be found at:
> git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git exec_domain_rip_v2
>
> Changes since v1:
> - Fixed sparc and xtensa thread info offsets
> Special thanks to Guenter Roeck for reporting and testing!
> - Fixed an unused variable on arm
> Thanks to Stephen Rothwell!
> - Added David Millers ACK
>
> Stephen, can you please add the tree to -next?
>
> Original description:
>
> A long time ago there was the idea to support different ABIs on Linux
> Such that someone could use for example SCO UNIX binaries on Linux
> without emulation. While the linux-abi project existed mostly as
> out-of-tree patch it's core component, execution domains,
> went mainline. An execution domain allows to specify mappings between
> different ABIs, these mappings consist of signal, error, socket type,
> socket options and addess familiy mappings.
> Mainline has only support for signal mappings.
> The signal mapping happens in the architecutre specific signal code.
> Some archs support it, some not, most of them copy&pasted from i386.
>
> While the mapping support is incomplete we have two in-kernel users of
> execution domains.
>
> 1. RISC OS personality on ARM.
> The Kconfig help message states that this feature is very experimental
> and it is likely that it never worked as expected.
> Russel is fine with the removal.
>
> 2. ia32 support on ia64.
> This is a left over from:
> commit 32974ad4907cdde6c9de612cd1b2ee0568fb9409 ([IA64] Remove COMPAT_IA32 support)
> It registers a dummy Linux/x86 execdomain to make calls to
> personality(PER_LINUX32) faster as the execution domain core code
> would try to load a module.
>
> As both users can be removed there is no user left and we can remove
> execution domains support at all from the kernel.
> The removal will make architecutre specific signal handling easier
> and there is no need to keep execuction domains as this feature is
> obviously incomplete and abandoned.
>
> Guenter Roeck (1):
> sparc: Fix execution domain removal
>
> Richard Weinberger (25):
> arm: Remove RISC OS personality
> ia64: Remove Linux/x86 exec domain support
> Remove execution domain support
> arm: Remove signal translation and exec_domain
> arm64: Remove signal translation and exec_domain
> blackfin: Autogenerate offsets in struct thread_info
> blackfin: Remove exec_domain usage
> frv: Remove signal translation and exec_domain
> m32r: Autogenerate offsets in struct thread_info
> m32r: Remove signal translation and exec_domain
> m68k: Remove signal translation and exec_domain
> microblaze: Remove signal translation and exec_domain
> mn10300: Remove signal translation and exec_domain
> s390: Remove signal translation and exec_domain
> sh: Remove signal translation and exec_domain
> sparc: Remove signal translation and exec_domain
> tile: Remove signal translation and exec_domain
> um: Remove signal translation and exec_domain
> unicore32: Remove signal translation and exec_domain
> x86: Remove signal translation and exec_domain
> xtensa: Autogenerate offsets in struct thread_info
> xtensa: Remove signal translation and exec_domain
> arc: Remove signal translation and exec_domain
> arch: Remove exec_domain from remaining archs
> Remove rest of exec domains.
>

Looking good this time.

Build results:
total: 121 pass: 121 fail: 0
Qemu test results:
total: 30 pass: 30 fail: 0

Guenter

2015-04-13 08:19:27

by Jesper Nilsson

[permalink] [raw]
Subject: Re: [PATCH 23/24] arch: Remove exec_domain from remaining archs

On Sat, Apr 11, 2015 at 10:48:02PM +0200, Richard Weinberger wrote:
> Signed-off-by: Richard Weinberger <[email protected]>
> arch/cris/arch-v10/kernel/signal.c | 2 --
> arch/cris/arch-v32/kernel/signal.c | 2 --
> arch/cris/include/asm/thread_info.h | 2 --

For the CRIS parts:

Acked-by: Jesper Nilsson <[email protected]>

/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]

2015-04-13 13:53:36

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 05/24] arm64: Remove signal translation and exec_domain

On Sat, Apr 11, 2015 at 10:47:44PM +0200, Richard Weinberger wrote:
[...]
> diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
> index 660ccf9..9f28eaa 100644
> --- a/arch/arm64/kernel/signal.c
> +++ b/arch/arm64/kernel/signal.c
> @@ -294,12 +294,6 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
> int ret;
>
> /*
> - * translate the signal
> - */
> - if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
> - usig = thread->exec_domain->signal_invmap[usig];
> -
> - /*

This hunk triggers a warning in linux-next about the thread variable now
being unused.

Thierry


Attachments:
(No filename) (642.00 B)
(No filename) (819.00 B)
Download all attachments
Subject: Re: [PATCH 23/24] arch: Remove exec_domain from remaining archs

Around Sat 11 Apr 2015 22:48:02 +0200 or thereabout, Richard Weinberger wrote:
> Signed-off-by: Richard Weinberger <[email protected]>
> ---
> arch/alpha/include/asm/thread_info.h | 2 --
> arch/avr32/include/asm/thread_info.h | 3 ---
> arch/avr32/kernel/asm-offsets.c | 1 -

For the AVR32 related bits.

Acked-by: Hans-Christian Egtvedt <[email protected]>

> arch/c6x/include/asm/thread_info.h | 2 --
> arch/cris/arch-v10/kernel/signal.c | 2 --
> arch/cris/arch-v32/kernel/signal.c | 2 --
> arch/cris/include/asm/thread_info.h | 2 --
> arch/hexagon/include/asm/thread_info.h | 2 --
> arch/ia64/include/asm/thread_info.h | 2 --
> arch/metag/include/asm/thread_info.h | 2 --
> arch/metag/kernel/irq.c | 2 --
> arch/mips/include/asm/thread_info.h | 2 --
> arch/mips/kernel/asm-offsets.c | 1 -
> arch/nios2/include/asm/thread_info.h | 2 --
> arch/openrisc/include/asm/thread_info.h | 2 --
> arch/openrisc/kernel/signal.c | 2 --
> arch/parisc/include/asm/thread_info.h | 2 --
> arch/parisc/kernel/asm-offsets.c | 1 -
> arch/powerpc/include/asm/thread_info.h | 2 --
> arch/score/include/asm/thread_info.h | 2 --
> arch/score/kernel/asm-offsets.c | 1 -
> 21 files changed, 39 deletions(-)

<snipp diff>

--
BR, HcE

2015-04-14 01:21:56

by Andy Lutomirski

[permalink] [raw]
Subject: Re: Remove execution domain support

On 04/11/2015 01:47 PM, Richard Weinberger wrote:
> A long time ago there was the idea to support different ABIs on Linux
> Such that someone could use for example SCO UNIX binaries on Linux
> without emulation. While the linux-abi project existed mostly as
> out-of-tree patch it's core component, execution domains,
> went mainline. An execution domain allows to specify mappings between
> different ABIs, these mappings consist of signal, error, socket type,
> socket options and addess familiy mappings.
> Mainline has only support for signal mappings.
> The signal mapping happens in the architecutre specific signal code.
> Some archs support it, some not, most of them copy&pasted from i386.
>
> While the mapping support is incomplete we have two in-kernel users of
> execution domains.
>
> 1. RISC OS personality on ARM.
> The Kconfig help message states that this feature is very experimental
> and it is likely that it never worked as expected.
> Russel is fine with the removal.
>
> 2. ia32 support on ia64.
> This is a left over from:
> commit 32974ad4907cdde6c9de612cd1b2ee0568fb9409 ([IA64] Remove COMPAT_IA32 support)
> It registers a dummy Linux/x86 execdomain to make calls to
> personality(PER_LINUX32) faster as the execution domain core code
> would try to load a module.
>
> As both users can be removed there is no user left and we can remove
> execution domains support at all from the kernel.
> The removal will make architecutre specific signal handling easier
> and there is no need to keep execuction domains as this feature is
> obviously incomplete and abandoned.

I like this.

FWIW, we recently removed restart_block from thread_info, so I'm not too
worried about fallout from removing another field.

--Andy

2015-04-14 07:49:04

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 11/24] m68k: Remove signal translation and exec_domain

On Sat, Apr 11, 2015 at 10:47 PM, Richard Weinberger <[email protected]> wrote:
> As execution domain support is gone we can remove
> signal translation from the signal code and remove
> exec_domain from thread_info.
>
> Signed-off-by: Richard Weinberger <[email protected]>

For the m68k changes:

Acked-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds