diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:26:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:05 -0400 |
commit | 42fda66387daa53538ae13a2c858396aaf037158 (patch) | |
tree | 77955a91a958fde7be47cb0ff23ac9e1248217db /arch/um/kernel/um_arch.c | |
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/kernel/um_arch.c')
-rw-r--r-- | arch/um/kernel/um_arch.c | 113 |
1 files changed, 4 insertions, 109 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index ecc458fe51b9..aa7b067565d9 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -38,9 +38,7 @@ | |||
38 | #include "choose-mode.h" | 38 | #include "choose-mode.h" |
39 | #include "mode_kern.h" | 39 | #include "mode_kern.h" |
40 | #include "mode.h" | 40 | #include "mode.h" |
41 | #ifdef UML_CONFIG_MODE_SKAS | ||
42 | #include "skas.h" | 41 | #include "skas.h" |
43 | #endif | ||
44 | 42 | ||
45 | #define DEFAULT_COMMAND_LINE "root=98:0" | 43 | #define DEFAULT_COMMAND_LINE "root=98:0" |
46 | 44 | ||
@@ -132,43 +130,12 @@ unsigned long end_vm; | |||
132 | /* Set in uml_ncpus_setup */ | 130 | /* Set in uml_ncpus_setup */ |
133 | int ncpus = 1; | 131 | int ncpus = 1; |
134 | 132 | ||
135 | #ifdef CONFIG_CMDLINE_ON_HOST | ||
136 | /* Pointer set in linux_main, the array itself is private to each thread, | ||
137 | * and changed at address space creation time so this poses no concurrency | ||
138 | * problems. | ||
139 | */ | ||
140 | static char *argv1_begin = NULL; | ||
141 | static char *argv1_end = NULL; | ||
142 | #endif | ||
143 | |||
144 | /* Set in early boot */ | 133 | /* Set in early boot */ |
145 | static int have_root __initdata = 0; | 134 | static int have_root __initdata = 0; |
146 | 135 | ||
147 | /* Set in uml_mem_setup and modified in linux_main */ | 136 | /* Set in uml_mem_setup and modified in linux_main */ |
148 | long long physmem_size = 32 * 1024 * 1024; | 137 | long long physmem_size = 32 * 1024 * 1024; |
149 | 138 | ||
150 | void set_cmdline(char *cmd) | ||
151 | { | ||
152 | #ifdef CONFIG_CMDLINE_ON_HOST | ||
153 | char *umid, *ptr; | ||
154 | |||
155 | if(CHOOSE_MODE(honeypot, 0)) return; | ||
156 | |||
157 | umid = get_umid(); | ||
158 | if(*umid != '\0'){ | ||
159 | snprintf(argv1_begin, | ||
160 | (argv1_end - argv1_begin) * sizeof(*ptr), | ||
161 | "(%s) ", umid); | ||
162 | ptr = &argv1_begin[strlen(argv1_begin)]; | ||
163 | } | ||
164 | else ptr = argv1_begin; | ||
165 | |||
166 | snprintf(ptr, (argv1_end - ptr) * sizeof(*ptr), "[%s]", cmd); | ||
167 | memset(argv1_begin + strlen(argv1_begin), '\0', | ||
168 | argv1_end - argv1_begin - strlen(argv1_begin)); | ||
169 | #endif | ||
170 | } | ||
171 | |||
172 | static char *usage_string = | 139 | static char *usage_string = |
173 | "User Mode Linux v%s\n" | 140 | "User Mode Linux v%s\n" |
174 | " available at http://user-mode-linux.sourceforge.net/\n\n"; | 141 | " available at http://user-mode-linux.sourceforge.net/\n\n"; |
@@ -201,13 +168,10 @@ __uml_setup("root=", uml_root_setup, | |||
201 | " root=/dev/ubd5\n\n" | 168 | " root=/dev/ubd5\n\n" |
202 | ); | 169 | ); |
203 | 170 | ||
204 | #ifndef CONFIG_MODE_TT | ||
205 | |||
206 | static int __init no_skas_debug_setup(char *line, int *add) | 171 | static int __init no_skas_debug_setup(char *line, int *add) |
207 | { | 172 | { |
208 | printf("'debug' is not necessary to gdb UML in skas mode - run \n"); | 173 | printf("'debug' is not necessary to gdb UML in skas mode - run \n"); |
209 | printf("'gdb linux' and disable CONFIG_CMDLINE_ON_HOST if gdb \n"); | 174 | printf("'gdb linux'"); |
210 | printf("doesn't work as expected\n"); | ||
211 | 175 | ||
212 | return 0; | 176 | return 0; |
213 | } | 177 | } |
@@ -217,8 +181,6 @@ __uml_setup("debug", no_skas_debug_setup, | |||
217 | " this flag is not needed to run gdb on UML in skas mode\n\n" | 181 | " this flag is not needed to run gdb on UML in skas mode\n\n" |
218 | ); | 182 | ); |
219 | 183 | ||
220 | #endif | ||
221 | |||
222 | #ifdef CONFIG_SMP | 184 | #ifdef CONFIG_SMP |
223 | static int __init uml_ncpus_setup(char *line, int *add) | 185 | static int __init uml_ncpus_setup(char *line, int *add) |
224 | { | 186 | { |
@@ -236,52 +198,6 @@ __uml_setup("ncpus=", uml_ncpus_setup, | |||
236 | ); | 198 | ); |
237 | #endif | 199 | #endif |
238 | 200 | ||
239 | static int force_tt = 0; | ||
240 | |||
241 | #if defined(CONFIG_MODE_TT) && defined(CONFIG_MODE_SKAS) | ||
242 | #define DEFAULT_TT 0 | ||
243 | |||
244 | static int __init mode_tt_setup(char *line, int *add) | ||
245 | { | ||
246 | force_tt = 1; | ||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | #else | ||
251 | #ifdef CONFIG_MODE_SKAS | ||
252 | |||
253 | #define DEFAULT_TT 0 | ||
254 | |||
255 | static int __init mode_tt_setup(char *line, int *add) | ||
256 | { | ||
257 | printf("CONFIG_MODE_TT disabled - 'mode=tt' ignored\n"); | ||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | #else | ||
262 | #ifdef CONFIG_MODE_TT | ||
263 | |||
264 | #define DEFAULT_TT 1 | ||
265 | |||
266 | static int __init mode_tt_setup(char *line, int *add) | ||
267 | { | ||
268 | printf("CONFIG_MODE_SKAS disabled - 'mode=tt' redundant\n"); | ||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | #endif | ||
273 | #endif | ||
274 | #endif | ||
275 | |||
276 | __uml_setup("mode=tt", mode_tt_setup, | ||
277 | "mode=tt\n" | ||
278 | " When both CONFIG_MODE_TT and CONFIG_MODE_SKAS are enabled, this option\n" | ||
279 | " forces UML to run in tt (tracing thread) mode. It is not the default\n" | ||
280 | " because it's slower and less secure than skas mode.\n\n" | ||
281 | ); | ||
282 | |||
283 | int mode_tt = DEFAULT_TT; | ||
284 | |||
285 | static int __init Usage(char *line, int *add) | 201 | static int __init Usage(char *line, int *add) |
286 | { | 202 | { |
287 | const char **p; | 203 | const char **p; |
@@ -357,29 +273,13 @@ int __init linux_main(int argc, char **argv) | |||
357 | add_arg(DEFAULT_COMMAND_LINE); | 273 | add_arg(DEFAULT_COMMAND_LINE); |
358 | 274 | ||
359 | os_early_checks(); | 275 | os_early_checks(); |
360 | if (force_tt) | ||
361 | clear_can_do_skas(); | ||
362 | mode_tt = force_tt ? 1 : !can_do_skas(); | ||
363 | #ifndef CONFIG_MODE_TT | ||
364 | if (mode_tt) { | ||
365 | /*Since CONFIG_MODE_TT is #undef'ed, force_tt cannot be 1. So, | ||
366 | * can_do_skas() returned 0, and the message is correct. */ | ||
367 | printf("Support for TT mode is disabled, and no SKAS support is present on the host.\n"); | ||
368 | exit(1); | ||
369 | } | ||
370 | #endif | ||
371 | 276 | ||
372 | #ifndef CONFIG_MODE_SKAS | 277 | can_do_skas(); |
373 | mode = "TT"; | 278 | |
374 | #else | 279 | if (proc_mm && ptrace_faultinfo) |
375 | /* Show to the user the result of selection */ | ||
376 | if (mode_tt) | ||
377 | mode = "TT"; | ||
378 | else if (proc_mm && ptrace_faultinfo) | ||
379 | mode = "SKAS3"; | 280 | mode = "SKAS3"; |
380 | else | 281 | else |
381 | mode = "SKAS0"; | 282 | mode = "SKAS0"; |
382 | #endif | ||
383 | 283 | ||
384 | printf("UML running in %s mode\n", mode); | 284 | printf("UML running in %s mode\n", mode); |
385 | 285 | ||
@@ -411,11 +311,6 @@ int __init linux_main(int argc, char **argv) | |||
411 | 311 | ||
412 | setup_machinename(init_utsname()->machine); | 312 | setup_machinename(init_utsname()->machine); |
413 | 313 | ||
414 | #ifdef CONFIG_CMDLINE_ON_HOST | ||
415 | argv1_begin = argv[1]; | ||
416 | argv1_end = &argv[1][strlen(argv[1])]; | ||
417 | #endif | ||
418 | |||
419 | highmem = 0; | 314 | highmem = 0; |
420 | iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; | 315 | iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; |
421 | max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC; | 316 | max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC; |