diff options
Diffstat (limited to 'arch/um')
| -rw-r--r-- | arch/um/Makefile | 2 | ||||
| -rw-r--r-- | arch/um/Makefile-i386 | 1 | ||||
| -rw-r--r-- | arch/um/drivers/cow.h | 4 | ||||
| -rw-r--r-- | arch/um/drivers/hostaudio_kern.c | 4 | ||||
| -rw-r--r-- | arch/um/kernel/helper.c | 14 | ||||
| -rw-r--r-- | arch/um/kernel/process.c | 35 | ||||
| -rw-r--r-- | arch/um/kernel/skas/syscall_user.c | 4 | ||||
| -rw-r--r-- | arch/um/kernel/um_arch.c | 19 | ||||
| -rw-r--r-- | arch/um/os-Linux/elf_aux.c | 1 |
9 files changed, 55 insertions, 29 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile index eb4ac403bd93..f5a83a72aa75 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
| @@ -245,7 +245,7 @@ $(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h $(ARCH_DIR)/kernel-offsets.h FOR | |||
| 245 | $(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE | 245 | $(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE |
| 246 | $(Q)$(MAKE) $(build)=$@ | 246 | $(Q)$(MAKE) $(build)=$@ |
| 247 | 247 | ||
| 248 | $(ARCH_DIR)/os-$(OS)/util: scripts_basic FORCE | 248 | $(ARCH_DIR)/os-$(OS)/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE |
| 249 | $(Q)$(MAKE) $(build)=$@ | 249 | $(Q)$(MAKE) $(build)=$@ |
| 250 | 250 | ||
| 251 | export SUBARCH USER_CFLAGS OS | 251 | export SUBARCH USER_CFLAGS OS |
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 93d0818fa816..a777e57dbf89 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 | |||
| @@ -33,6 +33,7 @@ ifneq ($(CONFIG_GPROF),y) | |||
| 33 | ARCH_CFLAGS += -DUM_FASTCALL | 33 | ARCH_CFLAGS += -DUM_FASTCALL |
| 34 | endif | 34 | endif |
| 35 | 35 | ||
| 36 | SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util | ||
| 36 | SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h | 37 | SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h |
| 37 | 38 | ||
| 38 | prepare: $(SYS_HEADERS) | 39 | prepare: $(SYS_HEADERS) |
diff --git a/arch/um/drivers/cow.h b/arch/um/drivers/cow.h index 4fcbe8b1b77e..4fcf3a8d13f4 100644 --- a/arch/um/drivers/cow.h +++ b/arch/um/drivers/cow.h | |||
| @@ -3,10 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
| 5 | 5 | ||
| 6 | #if __BYTE_ORDER == __BIG_ENDIAN | 6 | #if defined(__BIG_ENDIAN) |
| 7 | # define ntohll(x) (x) | 7 | # define ntohll(x) (x) |
| 8 | # define htonll(x) (x) | 8 | # define htonll(x) (x) |
| 9 | #elif __BYTE_ORDER == __LITTLE_ENDIAN | 9 | #elif defined(__LITTLE_ENDIAN) |
| 10 | # define ntohll(x) bswap_64(x) | 10 | # define ntohll(x) bswap_64(x) |
| 11 | # define htonll(x) bswap_64(x) | 11 | # define htonll(x) bswap_64(x) |
| 12 | #else | 12 | #else |
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index d5742783e19d..59602b81b240 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c | |||
| @@ -57,10 +57,10 @@ __uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP); | |||
| 57 | 57 | ||
| 58 | #else /*MODULE*/ | 58 | #else /*MODULE*/ |
| 59 | 59 | ||
| 60 | MODULE_PARM(dsp, "s"); | 60 | module_param(dsp, charp, 0644); |
| 61 | MODULE_PARM_DESC(dsp, DSP_HELP); | 61 | MODULE_PARM_DESC(dsp, DSP_HELP); |
| 62 | 62 | ||
| 63 | MODULE_PARM(mixer, "s"); | 63 | module_param(mixer, charp, 0644); |
| 64 | MODULE_PARM_DESC(mixer, MIXER_HELP); | 64 | MODULE_PARM_DESC(mixer, MIXER_HELP); |
| 65 | 65 | ||
| 66 | #endif | 66 | #endif |
diff --git a/arch/um/kernel/helper.c b/arch/um/kernel/helper.c index 13b1f5c2f7ee..f83e1e8e2392 100644 --- a/arch/um/kernel/helper.c +++ b/arch/um/kernel/helper.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include "user.h" | 13 | #include "user.h" |
| 14 | #include "kern_util.h" | 14 | #include "kern_util.h" |
| 15 | #include "user_util.h" | 15 | #include "user_util.h" |
| 16 | #include "helper.h" | ||
| 16 | #include "os.h" | 17 | #include "os.h" |
| 17 | 18 | ||
| 18 | struct helper_data { | 19 | struct helper_data { |
| @@ -149,7 +150,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, | |||
| 149 | return(pid); | 150 | return(pid); |
| 150 | } | 151 | } |
| 151 | 152 | ||
| 152 | int helper_wait(int pid, int block) | 153 | int helper_wait(int pid) |
| 153 | { | 154 | { |
| 154 | int ret; | 155 | int ret; |
| 155 | 156 | ||
| @@ -160,14 +161,3 @@ int helper_wait(int pid, int block) | |||
| 160 | } | 161 | } |
| 161 | return(ret); | 162 | return(ret); |
| 162 | } | 163 | } |
| 163 | |||
| 164 | /* | ||
| 165 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 166 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 167 | * adjust the settings for this buffer only. This must remain at the end | ||
| 168 | * of the file. | ||
| 169 | * --------------------------------------------------------------------------- | ||
| 170 | * Local variables: | ||
| 171 | * c-file-style: "linux" | ||
| 172 | * End: | ||
| 173 | */ | ||
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index c45a60e9c92d..8b01a5584e80 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
| @@ -212,12 +212,26 @@ static int stop_ptraced_child(int pid, int exitcode, int mustexit) | |||
| 212 | 212 | ||
| 213 | static int force_sysemu_disabled = 0; | 213 | static int force_sysemu_disabled = 0; |
| 214 | 214 | ||
| 215 | int ptrace_faultinfo = 1; | ||
| 216 | int proc_mm = 1; | ||
| 217 | |||
| 218 | static int __init skas0_cmd_param(char *str, int* add) | ||
| 219 | { | ||
| 220 | ptrace_faultinfo = proc_mm = 0; | ||
| 221 | return 0; | ||
| 222 | } | ||
| 223 | |||
| 215 | static int __init nosysemu_cmd_param(char *str, int* add) | 224 | static int __init nosysemu_cmd_param(char *str, int* add) |
| 216 | { | 225 | { |
| 217 | force_sysemu_disabled = 1; | 226 | force_sysemu_disabled = 1; |
| 218 | return 0; | 227 | return 0; |
| 219 | } | 228 | } |
| 220 | 229 | ||
| 230 | __uml_setup("skas0", skas0_cmd_param, | ||
| 231 | "skas0\n" | ||
| 232 | " Disables SKAS3 usage, so that SKAS0 is used, unless you \n" | ||
| 233 | " specify mode=tt.\n\n"); | ||
| 234 | |||
| 221 | __uml_setup("nosysemu", nosysemu_cmd_param, | 235 | __uml_setup("nosysemu", nosysemu_cmd_param, |
| 222 | "nosysemu\n" | 236 | "nosysemu\n" |
| 223 | " Turns off syscall emulation patch for ptrace (SYSEMU) on.\n" | 237 | " Turns off syscall emulation patch for ptrace (SYSEMU) on.\n" |
| @@ -359,12 +373,10 @@ void forward_pending_sigio(int target) | |||
| 359 | kill(target, SIGIO); | 373 | kill(target, SIGIO); |
| 360 | } | 374 | } |
| 361 | 375 | ||
| 362 | int ptrace_faultinfo = 0; | ||
| 363 | int proc_mm = 1; | ||
| 364 | |||
| 365 | extern void *__syscall_stub_start, __syscall_stub_end; | 376 | extern void *__syscall_stub_start, __syscall_stub_end; |
| 366 | 377 | ||
| 367 | #ifdef UML_CONFIG_MODE_SKAS | 378 | #ifdef UML_CONFIG_MODE_SKAS |
| 379 | |||
| 368 | static inline void check_skas3_ptrace_support(void) | 380 | static inline void check_skas3_ptrace_support(void) |
| 369 | { | 381 | { |
| 370 | struct ptrace_faultinfo fi; | 382 | struct ptrace_faultinfo fi; |
| @@ -375,6 +387,7 @@ static inline void check_skas3_ptrace_support(void) | |||
| 375 | 387 | ||
| 376 | n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); | 388 | n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); |
| 377 | if (n < 0) { | 389 | if (n < 0) { |
| 390 | ptrace_faultinfo = 0; | ||
| 378 | if(errno == EIO) | 391 | if(errno == EIO) |
| 379 | printf("not found\n"); | 392 | printf("not found\n"); |
| 380 | else { | 393 | else { |
| @@ -382,8 +395,10 @@ static inline void check_skas3_ptrace_support(void) | |||
| 382 | } | 395 | } |
| 383 | } | 396 | } |
| 384 | else { | 397 | else { |
| 385 | ptrace_faultinfo = 1; | 398 | if (!ptrace_faultinfo) |
| 386 | printf("found\n"); | 399 | printf("found but disabled on command line\n"); |
| 400 | else | ||
| 401 | printf("found\n"); | ||
| 387 | } | 402 | } |
| 388 | 403 | ||
| 389 | init_registers(pid); | 404 | init_registers(pid); |
| @@ -396,13 +411,13 @@ int can_do_skas(void) | |||
| 396 | if (os_access("/proc/mm", OS_ACC_W_OK) < 0) { | 411 | if (os_access("/proc/mm", OS_ACC_W_OK) < 0) { |
| 397 | proc_mm = 0; | 412 | proc_mm = 0; |
| 398 | printf("not found\n"); | 413 | printf("not found\n"); |
| 399 | goto out; | 414 | } else { |
| 400 | } | 415 | if (!proc_mm) |
| 401 | else { | 416 | printf("found but disabled on command line\n"); |
| 402 | printf("found\n"); | 417 | else |
| 418 | printf("found\n"); | ||
| 403 | } | 419 | } |
| 404 | 420 | ||
| 405 | out: | ||
| 406 | check_skas3_ptrace_support(); | 421 | check_skas3_ptrace_support(); |
| 407 | return 1; | 422 | return 1; |
| 408 | } | 423 | } |
diff --git a/arch/um/kernel/skas/syscall_user.c b/arch/um/kernel/skas/syscall_user.c index 2828e6e37721..6b0664970147 100644 --- a/arch/um/kernel/skas/syscall_user.c +++ b/arch/um/kernel/skas/syscall_user.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | void handle_syscall(union uml_pt_regs *regs) | 15 | void handle_syscall(union uml_pt_regs *regs) |
| 16 | { | 16 | { |
| 17 | long result; | 17 | long result; |
| 18 | #if UML_CONFIG_SYSCALL_DEBUG | 18 | #ifdef UML_CONFIG_SYSCALL_DEBUG |
| 19 | int index; | 19 | int index; |
| 20 | 20 | ||
| 21 | index = record_syscall_start(UPT_SYSCALL_NR(regs)); | 21 | index = record_syscall_start(UPT_SYSCALL_NR(regs)); |
| @@ -27,7 +27,7 @@ void handle_syscall(union uml_pt_regs *regs) | |||
| 27 | REGS_SET_SYSCALL_RETURN(regs->skas.regs, result); | 27 | REGS_SET_SYSCALL_RETURN(regs->skas.regs, result); |
| 28 | 28 | ||
| 29 | syscall_trace(regs, 1); | 29 | syscall_trace(regs, 1); |
| 30 | #if UML_CONFIG_SYSCALL_DEBUG | 30 | #ifdef UML_CONFIG_SYSCALL_DEBUG |
| 31 | record_syscall_end(index, result); | 31 | record_syscall_end(index, result); |
| 32 | #endif | 32 | #endif |
| 33 | } | 33 | } |
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 8736d098f0ee..ca2bb6f09a7d 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
| @@ -38,6 +38,9 @@ | |||
| 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" | ||
| 43 | #endif | ||
| 41 | 44 | ||
| 42 | #define DEFAULT_COMMAND_LINE "root=98:0" | 45 | #define DEFAULT_COMMAND_LINE "root=98:0" |
| 43 | 46 | ||
| @@ -318,6 +321,7 @@ int linux_main(int argc, char **argv) | |||
| 318 | unsigned long avail, diff; | 321 | unsigned long avail, diff; |
| 319 | unsigned long virtmem_size, max_physmem; | 322 | unsigned long virtmem_size, max_physmem; |
| 320 | unsigned int i, add; | 323 | unsigned int i, add; |
| 324 | char * mode; | ||
| 321 | 325 | ||
| 322 | for (i = 1; i < argc; i++){ | 326 | for (i = 1; i < argc; i++){ |
| 323 | if((i == 1) && (argv[i][0] == ' ')) continue; | 327 | if((i == 1) && (argv[i][0] == ' ')) continue; |
| @@ -338,6 +342,21 @@ int linux_main(int argc, char **argv) | |||
| 338 | exit(1); | 342 | exit(1); |
| 339 | } | 343 | } |
| 340 | #endif | 344 | #endif |
| 345 | |||
| 346 | #ifndef CONFIG_MODE_SKAS | ||
| 347 | mode = "TT"; | ||
| 348 | #else | ||
| 349 | /* Show to the user the result of selection */ | ||
| 350 | if (mode_tt) | ||
| 351 | mode = "TT"; | ||
| 352 | else if (proc_mm && ptrace_faultinfo) | ||
| 353 | mode = "SKAS3"; | ||
| 354 | else | ||
| 355 | mode = "SKAS0"; | ||
| 356 | #endif | ||
| 357 | |||
| 358 | printf("UML running in %s mode\n", mode); | ||
| 359 | |||
| 341 | uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, | 360 | uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, |
| 342 | &host_task_size, &task_size); | 361 | &host_task_size, &task_size); |
| 343 | 362 | ||
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index f0d6060e3e57..5423b1ca17c4 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <stddef.h> | 11 | #include <stddef.h> |
| 12 | #include "init.h" | 12 | #include "init.h" |
| 13 | #include "elf_user.h" | 13 | #include "elf_user.h" |
| 14 | #include <asm/elf.h> | ||
| 14 | 15 | ||
| 15 | #if ELF_CLASS == ELFCLASS32 | 16 | #if ELF_CLASS == ELFCLASS32 |
| 16 | typedef Elf32_auxv_t elf_auxv_t; | 17 | typedef Elf32_auxv_t elf_auxv_t; |
