summaryrefslogtreecommitdiff
path: root/linux-uml/linux-uml-2.6.7/sysemu_cmdParam.patch
blob: 2422867a173b6534d9bdcb59a10dd1d42b02a831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

Adds the "nosysemu" command line parameter to disable SYSEMU

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---

 uml-linux-2.6.7-paolo/arch/um/kernel/process.c |   26 +++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff -puN arch/um/kernel/process.c~sysemu_cmdParam arch/um/kernel/process.c
--- uml-linux-2.6.7/arch/um/kernel/process.c~sysemu_cmdParam	2004-06-29 21:03:04.131009360 +0200
+++ uml-linux-2.6.7-paolo/arch/um/kernel/process.c	2004-06-29 21:03:04.134008904 +0200
@@ -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)
_