diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 01:26:50 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 09:43:05 -0700 |
commit | 42fda66387daa53538ae13a2c858396aaf037158 (patch) | |
tree | 77955a91a958fde7be47cb0ff23ac9e1248217db /arch/um/os-Linux | |
parent | a1ff5878d2628bbe1e42821c024c96f48318f683 (diff) |
uml: throw out CONFIG_MODE_TT
This patchset throws out tt mode, which has been non-functional for a while.
This is done in phases, interspersed with code cleanups on the affected files.
The removal is done as follows:
remove all code, config options, and files which depend on
CONFIG_MODE_TT
get rid of the CHOOSE_MODE macro, which decided whether to
call tt-mode or skas-mode code, and replace invocations with their
skas portions
replace all now-trivial procedures with their skas equivalents
There are now a bunch of now-redundant pieces of data structures, including
mode-specific pieces of the thread structure, pt_regs, and mm_context. These
are all replaced with their skas-specific contents.
As part of the ongoing style compliance project, I made a style pass over all
files that were changed. There are three such patches, one for each phase,
covering the files affected by that phase but no later ones.
I noticed that we weren't freeing the LDT state associated with a process when
it exited, so that's fixed in one of the later patches.
The last patch is a tidying patch which I've had for a while, but which caused
inexplicable crashes under tt mode. Since that is no longer a problem, this
can now go in.
This patch:
Start getting rid of tt mode support.
This patch throws out CONFIG_MODE_TT and all config options, code, and files
which depend on it.
CONFIG_MODE_SKAS is gone and everything that depends on it is included
unconditionally.
The few changed lines are in re-written Kconfig help, lines which needed
something skas-related removed from them, and a few more which weren't
strictly deletions.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r-- | arch/um/os-Linux/Makefile | 7 | ||||
-rw-r--r-- | arch/um/os-Linux/main.c | 32 | ||||
-rw-r--r-- | arch/um/os-Linux/process.c | 31 | ||||
-rw-r--r-- | arch/um/os-Linux/start_up.c | 10 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-i386/Makefile | 2 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-x86_64/Makefile | 2 | ||||
-rw-r--r-- | arch/um/os-Linux/time.c | 19 | ||||
-rw-r--r-- | arch/um/os-Linux/tls.c | 36 |
8 files changed, 3 insertions, 136 deletions
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile index f1bb58fe3207..1dbb45dfc49b 100644 --- a/arch/um/os-Linux/Makefile +++ b/arch/um/os-Linux/Makefile @@ -5,12 +5,7 @@ obj-y = aio.o elf_aux.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ registers.o sigio.o signal.o start_up.o time.o trap.o tty.o uaccess.o \ - umid.o tls.o user_syms.o util.o drivers/ sys-$(SUBARCH)/ - -obj-$(CONFIG_MODE_SKAS) += skas/ - -obj-$(CONFIG_MODE_TT) += tt.o -user-objs-$(CONFIG_MODE_TT) += tt.o + umid.o tls.o user_syms.o util.o drivers/ sys-$(SUBARCH)/ skas/ obj-$(CONFIG_TTY_LOG) += tty_log.o user-objs-$(CONFIG_TTY_LOG) += tty_log.o diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 919c25be254a..425aa8960649 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -25,9 +25,6 @@ #include "um_malloc.h" #include "kern_constants.h" -/* Set in main, unchanged thereafter */ -char *linux_prog; - #define PGD_BOUND (4 * 1024 * 1024) #define STACKSIZE (8 * 1024 * 1024) #define THREAD_NAME_LEN (256) @@ -125,35 +122,6 @@ int __init main(int argc, char **argv, char **envp) char **new_argv; int ret, i, err; -#ifdef UML_CONFIG_CMDLINE_ON_HOST - /* Allocate memory for thread command lines */ - if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){ - - char padding[THREAD_NAME_LEN] = { - [ 0 ... THREAD_NAME_LEN - 2] = ' ', '\0' - }; - - new_argv = malloc((argc + 2) * sizeof(char*)); - if(!new_argv) { - perror("Allocating extended argv"); - exit(1); - } - - new_argv[0] = argv[0]; - new_argv[1] = padding; - - for(i = 2; i <= argc; i++) - new_argv[i] = argv[i - 1]; - new_argv[argc + 1] = NULL; - - execvp(new_argv[0], new_argv); - perror("execing with extended args"); - exit(1); - } -#endif - - linux_prog = argv[0]; - set_stklim(); setup_env_path(); diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index e9c143297512..d5fef4ce0112 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -133,13 +133,6 @@ void os_kill_ptraced_process(int pid, int reap_child) CATCH_EINTR(waitpid(pid, NULL, 0)); } -#ifdef UML_CONFIG_MODE_TT -void os_usr1_process(int pid) -{ - kill(pid, SIGUSR1); -} -#endif - /* Don't use the glibc version, which caches the result in TLS. It misses some * syscalls, and also breaks with clone(), which does not unshare the TLS. */ @@ -239,30 +232,6 @@ out: return ok; } -#ifdef UML_CONFIG_MODE_TT -void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) -{ - int flags = 0, pages; - - if(sig_stack != NULL){ - pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER); - set_sigstack(sig_stack, pages * UM_KERN_PAGE_SIZE); - flags = SA_ONSTACK; - } - if(usr1_handler){ - struct sigaction sa; - - sa.sa_handler = usr1_handler; - sigemptyset(&sa.sa_mask); - sa.sa_flags = flags; - sa.sa_restorer = NULL; - if(sigaction(SIGUSR1, &sa, NULL) < 0) - panic("init_new_thread_stack - sigaction failed - " - "errno = %d\n", errno); - } -} -#endif - void init_new_thread_signals(void) { set_handler(SIGSEGV, (__sighandler_t) sig_handler, SA_ONSTACK, diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index f4f2981f74b9..acf52ea4ff52 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c @@ -35,12 +35,9 @@ #include "mode.h" #include "tempfile.h" #include "kern_constants.h" - -#ifdef UML_CONFIG_MODE_SKAS #include "skas.h" #include "skas_ptrace.h" #include "registers.h" -#endif static int ptrace_child(void *arg) { @@ -407,7 +404,6 @@ __uml_setup("noptraceldt", noptraceldt_cmd_param, " To support PTRACE_LDT, the host needs to be patched using\n" " the current skas3 patch.\n\n"); -#ifdef UML_CONFIG_MODE_SKAS static inline void check_skas3_ptrace_faultinfo(void) { struct ptrace_faultinfo fi; @@ -504,12 +500,6 @@ int can_do_skas(void) return 1; } -#else -int can_do_skas(void) -{ - return 0; -} -#endif int __init parse_iomem(char *str, int *add) { diff --git a/arch/um/os-Linux/sys-i386/Makefile b/arch/um/os-Linux/sys-i386/Makefile index 37806621b25d..dc7208f0b741 100644 --- a/arch/um/os-Linux/sys-i386/Makefile +++ b/arch/um/os-Linux/sys-i386/Makefile @@ -3,7 +3,7 @@ # Licensed under the GPL # -obj-$(CONFIG_MODE_SKAS) = registers.o signal.o tls.o +obj-y = registers.o signal.o tls.o USER_OBJS := $(obj-y) diff --git a/arch/um/os-Linux/sys-x86_64/Makefile b/arch/um/os-Linux/sys-x86_64/Makefile index eac8c0db3001..a42a4ef02e1e 100644 --- a/arch/um/os-Linux/sys-x86_64/Makefile +++ b/arch/um/os-Linux/sys-x86_64/Makefile @@ -3,7 +3,7 @@ # Licensed under the GPL # -obj-$(CONFIG_MODE_SKAS) = registers.o prctl.o signal.o +obj-y = registers.o prctl.o signal.o USER_OBJS := $(obj-y) diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index 5de169b168f6..5eb32d24ba58 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c @@ -30,13 +30,6 @@ int set_interval(int is_virtual) return 0; } -#ifdef UML_CONFIG_MODE_TT -void enable_timer(void) -{ - set_interval(1); -} -#endif - void disable_timer(void) { struct itimerval disable = ((struct itimerval) { { 0, 0 }, { 0, 0 }}); @@ -71,18 +64,6 @@ void switch_timers(int to_real) errno); } -#ifdef UML_CONFIG_MODE_TT -void uml_idle_timer(void) -{ - if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR) - panic("Couldn't unset SIGVTALRM handler"); - - set_handler(SIGALRM, (__sighandler_t) alarm_handler, - SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1); - set_interval(0); -} -#endif - unsigned long long os_nsecs(void) { struct timeval tv; diff --git a/arch/um/os-Linux/tls.c b/arch/um/os-Linux/tls.c index 16215b990804..282bd25e19ef 100644 --- a/arch/um/os-Linux/tls.c +++ b/arch/um/os-Linux/tls.c @@ -8,11 +8,6 @@ /* TLS support - we basically rely on the host's one.*/ -/* In TT mode, this should be called only by the tracing thread, and makes sense - * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally. - * - */ - #ifndef PTRACE_GET_THREAD_AREA #define PTRACE_GET_THREAD_AREA 25 #endif @@ -32,8 +27,6 @@ int os_set_thread_area(user_desc_t *info, int pid) return ret; } -#ifdef UML_CONFIG_MODE_SKAS - int os_get_thread_area(user_desc_t *info, int pid) { int ret; @@ -44,32 +37,3 @@ int os_get_thread_area(user_desc_t *info, int pid) ret = -errno; return ret; } - -#endif - -#ifdef UML_CONFIG_MODE_TT -#include "linux/unistd.h" - -int do_set_thread_area_tt(user_desc_t *info) -{ - int ret; - - ret = syscall(__NR_set_thread_area,info); - if (ret < 0) { - ret = -errno; - } - return ret; -} - -int do_get_thread_area_tt(user_desc_t *info) -{ - int ret; - - ret = syscall(__NR_get_thread_area,info); - if (ret < 0) { - ret = -errno; - } - return ret; -} - -#endif /* UML_CONFIG_MODE_TT */ |