]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.xen/xen3-seccomp-disable-tsc-option
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.xen / xen3-seccomp-disable-tsc-option
1 From: Andrea Arcangeli <andrea@cpushare.com>
2 Subject: [PATCH seccomp: make tsc disabling optional
3 Patch-mainline: unknown
4 References: 191123
5
6 Make the TSC disable purely paranoid feature optional, so by default seccomp
7 returns absolutely zerocost.
8
9 Ported from 2.6.19 to 2.6.24-rc7 by Jeff Mahoney.
10 Addition of x86-64 by Jan Beulich.
11
12 Signed-off-by: Andrea Arcangeli <andrea@cpushare.com>
13 Acked-by: Jeff Mahoney <jeffm@suse.com>
14 Automatically created from "patches.fixes/seccomp-disable-tsc-option" by xen-port-patches.py
15
16 Index: head-2008-10-01/arch/x86/kernel/process_32-xen.c
17 ===================================================================
18 --- head-2008-10-01.orig/arch/x86/kernel/process_32-xen.c 2008-10-01 16:18:30.000000000 +0200
19 +++ head-2008-10-01/arch/x86/kernel/process_32-xen.c 2008-10-01 16:20:58.000000000 +0200
20 @@ -383,6 +383,7 @@ static void hard_disable_TSC(void)
21
22 void disable_TSC(void)
23 {
24 +#ifdef CONFIG_SECCOMP_DISABLE_TSC
25 preempt_disable();
26 if (!test_and_set_thread_flag(TIF_NOTSC))
27 /*
28 @@ -391,6 +392,7 @@ void disable_TSC(void)
29 */
30 hard_disable_TSC();
31 preempt_enable();
32 +#endif
33 }
34
35 static void hard_enable_TSC(void)
36 Index: head-2008-10-01/arch/x86/kernel/process_64-xen.c
37 ===================================================================
38 --- head-2008-10-01.orig/arch/x86/kernel/process_64-xen.c 2008-10-01 16:20:19.000000000 +0200
39 +++ head-2008-10-01/arch/x86/kernel/process_64-xen.c 2008-10-01 16:20:58.000000000 +0200
40 @@ -423,6 +423,7 @@ static void hard_disable_TSC(void)
41
42 void disable_TSC(void)
43 {
44 +#ifdef CONFIG_SECCOMP_DISABLE_TSC
45 preempt_disable();
46 if (!test_and_set_thread_flag(TIF_NOTSC))
47 /*
48 @@ -431,6 +432,7 @@ void disable_TSC(void)
49 */
50 hard_disable_TSC();
51 preempt_enable();
52 +#endif
53 }
54
55 static void hard_enable_TSC(void)