From: Adds the "nosysemu" command line parameter to disable SYSEMU Signed-off-by: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Andrew Morton --- 25-akpm/arch/um/kernel/process.c | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff -puN arch/um/kernel/process.c~uml-adds-the-nosysemu-command-line-parameter-to-disable-sysemu arch/um/kernel/process.c --- 25/arch/um/kernel/process.c~uml-adds-the-nosysemu-command-line-parameter-to-disable-sysemu 2004-07-05 16:00:44.845202944 -0700 +++ 25-akpm/arch/um/kernel/process.c 2004-07-05 16:00:44.849202336 -0700 @@ -196,6 +196,22 @@ static void stop_ptraced_child(int pid, panic("check_ptrace : munmap failed, errno = %d", errno); } +static int force_sysemu_disabled = 0; + +static int __init nosysemu_cmd_param(char *str, int* add) +{ + force_sysemu_disabled = 1; + return 0; +} + +__uml_setup("nosysemu", nosysemu_cmd_param, + "nosysemu\n" + " Turns off syscall emulation patch for ptrace (SYSEMU) on.\n" + " SYSEMU is a performance-patch introduced by Laurent Vivier. It changes\n" + " behaviour of ptrace() and helps reducing host context switch rate.\n" + " To make it working, you need a kernel patch for your host, too.\n" + " See http://perso.wanadoo.fr/laurent.vivier/UML/ for further information.\n"); + void __init check_ptrace(void) { void *stack; @@ -229,7 +245,6 @@ void __init check_ptrace(void) stop_ptraced_child(pid, stack, 0); printk("OK\n"); -#ifdef PTRACE_SYSEMU printk("Checking syscall emulation patch for ptrace..."); use_sysemu = 0; pid = start_ptraced_child(&stack); @@ -252,8 +267,12 @@ void __init check_ptrace(void) stop_ptraced_child(pid, stack, 0); - printk("OK\n"); - use_sysemu = 1; + if (!force_sysemu_disabled) { + printk("found\n"); + use_sysemu = 1; + } else { + printk("found but disabled\n"); + } } else { @@ -261,7 +280,6 @@ void __init check_ptrace(void) stop_ptraced_child(pid, stack, 1); } -# endif /* PTRACE_SYSEMU */ } int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) _