aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:26:50 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:05 -0400
commit42fda66387daa53538ae13a2c858396aaf037158 (patch)
tree77955a91a958fde7be47cb0ff23ac9e1248217db /arch/um/sys-x86_64
parenta1ff5878d2628bbe1e42821c024c96f48318f683 (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/sys-x86_64')
-rw-r--r--arch/um/sys-x86_64/Makefile9
-rw-r--r--arch/um/sys-x86_64/signal.c50
-rw-r--r--arch/um/sys-x86_64/syscalls.c31
-rw-r--r--arch/um/sys-x86_64/unmap.c25
4 files changed, 2 insertions, 113 deletions
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index ea8185d85404..002bb020f96a 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -5,10 +5,9 @@
5# 5#
6 6
7obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \ 7obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
8 setjmp.o sigcontext.o signal.o syscalls.o syscall_table.o sysrq.o \ 8 setjmp.o sigcontext.o signal.o stub.o stub_segv.o syscalls.o \
9 ksyms.o tls.o 9 syscall_table.o sysrq.o ksyms.o tls.o
10 10
11obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o
12obj-$(CONFIG_MODULES) += um_module.o 11obj-$(CONFIG_MODULES) += um_module.o
13 12
14subarch-obj-y = lib/bitops_64.o lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o 13subarch-obj-y = lib/bitops_64.o lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o
@@ -21,11 +20,7 @@ USER_OBJS := ptrace_user.o sigcontext.o
21USER_OBJS += user-offsets.s 20USER_OBJS += user-offsets.s
22extra-y += user-offsets.s 21extra-y += user-offsets.s
23 22
24extra-$(CONFIG_MODE_TT) += unmap.o
25
26UNPROFILE_OBJS := stub_segv.o 23UNPROFILE_OBJS := stub_segv.o
27CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) 24CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)
28 25
29include arch/um/scripts/Makefile.rules 26include arch/um/scripts/Makefile.rules
30
31$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS))
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index fe8ec04d35bb..c18d929e69bc 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -15,9 +15,6 @@
15#include "choose-mode.h" 15#include "choose-mode.h"
16#include "sysdep/ptrace.h" 16#include "sysdep/ptrace.h"
17#include "frame_kern.h" 17#include "frame_kern.h"
18
19#ifdef CONFIG_MODE_SKAS
20
21#include "skas.h" 18#include "skas.h"
22 19
23void copy_sc(union uml_pt_regs *regs, void *from) 20void copy_sc(union uml_pt_regs *regs, void *from)
@@ -134,53 +131,6 @@ int copy_sc_to_user_skas(struct sigcontext __user *to,
134 return(err); 131 return(err);
135} 132}
136 133
137#endif
138
139#ifdef CONFIG_MODE_TT
140int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
141 int fpsize)
142{
143 struct _fpstate *to_fp;
144 struct _fpstate __user *from_fp;
145 unsigned long sigs;
146 int err;
147
148 to_fp = to->fpstate;
149 sigs = to->oldmask;
150 err = copy_from_user(to, from, sizeof(*to));
151 from_fp = to->fpstate;
152 to->fpstate = to_fp;
153 to->oldmask = sigs;
154 if(to_fp != NULL)
155 err |= copy_from_user(to_fp, from_fp, fpsize);
156 return(err);
157}
158
159int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp,
160 struct sigcontext *from, int fpsize, unsigned long sp)
161{
162 struct _fpstate __user *to_fp;
163 struct _fpstate *from_fp;
164 int err;
165
166 to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1));
167 from_fp = from->fpstate;
168 err = copy_to_user(to, from, sizeof(*to));
169 /* The SP in the sigcontext is the updated one for the signal
170 * delivery. The sp passed in is the original, and this needs
171 * to be restored, so we stick it in separately.
172 */
173 err |= copy_to_user(&SC_SP(to), &sp, sizeof(sp));
174
175 if(from_fp != NULL){
176 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
177 err |= copy_to_user(to_fp, from_fp, fpsize);
178 }
179 return err;
180}
181
182#endif
183
184static int copy_sc_from_user(struct pt_regs *to, void __user *from) 134static int copy_sc_from_user(struct pt_regs *to, void __user *from)
185{ 135{
186 int ret; 136 int ret;
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index b3f6350cac44..d0ff832c9eaf 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -29,36 +29,6 @@ asmlinkage long sys_uname64(struct new_utsname __user * name)
29 return err ? -EFAULT : 0; 29 return err ? -EFAULT : 0;
30} 30}
31 31
32#ifdef CONFIG_MODE_TT
33extern long arch_prctl(int code, unsigned long addr);
34
35static long arch_prctl_tt(int code, unsigned long addr)
36{
37 unsigned long tmp;
38 long ret;
39
40 switch(code){
41 case ARCH_SET_GS:
42 case ARCH_SET_FS:
43 ret = arch_prctl(code, addr);
44 break;
45 case ARCH_GET_FS:
46 case ARCH_GET_GS:
47 ret = arch_prctl(code, (unsigned long) &tmp);
48 if(!ret)
49 ret = put_user(tmp, (long __user *)addr);
50 break;
51 default:
52 ret = -EINVAL;
53 break;
54 }
55
56 return(ret);
57}
58#endif
59
60#ifdef CONFIG_MODE_SKAS
61
62long arch_prctl_skas(struct task_struct *task, int code, 32long arch_prctl_skas(struct task_struct *task, int code,
63 unsigned long __user *addr) 33 unsigned long __user *addr)
64{ 34{
@@ -119,7 +89,6 @@ long arch_prctl_skas(struct task_struct *task, int code,
119 89
120 return ret; 90 return ret;
121} 91}
122#endif
123 92
124long sys_arch_prctl(int code, unsigned long addr) 93long sys_arch_prctl(int code, unsigned long addr)
125{ 94{
diff --git a/arch/um/sys-x86_64/unmap.c b/arch/um/sys-x86_64/unmap.c
deleted file mode 100644
index f4a4bffd8a18..000000000000
--- a/arch/um/sys-x86_64/unmap.c
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <linux/mman.h>
7#include <asm/unistd.h>
8
9static int errno;
10
11static inline _syscall2(int,munmap,void *,start,size_t,len)
12static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
13int switcheroo(int fd, int prot, void *from, void *to, int size)
14{
15 if(munmap(to, size) < 0){
16 return(-1);
17 }
18 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1){
19 return(-1);
20 }
21 if(munmap(from, size) < 0){
22 return(-1);
23 }
24 return(0);
25}