/[pkg-src]/trunk/kernel26-xen/patches-2.6.25-r1/1110-2.6.25-xen-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch |
Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1110-2.6.25-xen-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch
Parent Directory | Revision Log
Revision 606 -
(show annotations)
(download)
Thu May 22 23:13:13 2008 UTC (16 years, 1 month ago) by niro
File size: 1973 byte(s)
Thu May 22 23:13:13 2008 UTC (16 years, 1 month ago) by niro
File size: 1973 byte(s)
-ver bump to 2.6.25-magellan-r1: - linux-2.6.25.4 - fbcondecor-0.9.4 - squashfs-3.3 - unionfs-2.3.3 - tuxonice-3.0-rc7 - linux-phc-0.3.0 - acpi-dstd-0.9a - reiser4 - xen-3.2.0 . ipw3945-1.2.2
1 | From e0304ef09b5c205bb0f3e06c946232b0c14ed8e5 Mon Sep 17 00:00:00 2001 |
2 | From: Eduardo Habkost <ehabkost@redhat.com> |
3 | Date: Mon, 14 Jan 2008 19:53:14 -0200 |
4 | Subject: [PATCH] use write_gdt_entry() on vsyscall_set_cpu() (CLEANME) |
5 | |
6 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> |
7 | --- |
8 | arch/x86/kernel/vsyscall_64.c | 29 +++++++++++++++++++++++------ |
9 | 1 files changed, 23 insertions(+), 6 deletions(-) |
10 | |
11 | diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c |
12 | index edff4c9..49273b9 100644 |
13 | --- a/arch/x86/kernel/vsyscall_64.c |
14 | +++ b/arch/x86/kernel/vsyscall_64.c |
15 | @@ -249,7 +249,8 @@ static ctl_table kernel_root_table2[] = { |
16 | doesn't violate that. We'll find out if it does. */ |
17 | static void __cpuinit vsyscall_set_cpu(int cpu) |
18 | { |
19 | - unsigned long *d; |
20 | + unsigned long v; |
21 | + struct desc_struct *d; |
22 | unsigned long node = 0; |
23 | #ifdef CONFIG_NUMA |
24 | node = cpu_to_node(cpu); |
25 | @@ -260,11 +261,27 @@ static void __cpuinit vsyscall_set_cpu(int cpu) |
26 | /* Store cpu number in limit so that it can be loaded quickly |
27 | in user space in vgetcpu. |
28 | 12 bits for the CPU and 8 bits for the node. */ |
29 | - d = (unsigned long *)(get_cpu_gdt_table(cpu) + GDT_ENTRY_PER_CPU); |
30 | - *d = 0x0f40000000000ULL; |
31 | - *d |= cpu; |
32 | - *d |= (node & 0xf) << 12; |
33 | - *d |= (node >> 4) << 48; |
34 | +#if 0 |
35 | + d = (struct desc_struct*)&v; |
36 | + d.limit0 = 0; |
37 | + d.base0 = 0; |
38 | + d.base1 = 0; |
39 | + d.type = 4; //FIXME: constant? |
40 | + d.s = 1; |
41 | + d.dpl = 3; |
42 | + d.p = 1; |
43 | + d.limit = 0; |
44 | + d.avl = d.l = d.d = d.g = 0; |
45 | +#else |
46 | + v = 0x0000f40000000000ULL; |
47 | +#endif |
48 | + v |= cpu; |
49 | + v |= (node & 0xf) << 12; |
50 | + v |= (node >> 4) << 48; |
51 | + |
52 | + //printk("limit0: %lx, base0: %lx, base1: %lx, type: %lx, s: %d, dpl: %d, p: %d, limit: %lx, avl: %d, l: %d, d: %d, g: %d, base2: %lx\n", d->limit0, d->base0, d->base1, d->type, d->s, d->dpl, d->p, d->limit, d->avl, d->l, d->d, d->g, d->base2); |
53 | + |
54 | + write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &v, sizeof(v)); |
55 | } |
56 | |
57 | static void __cpuinit cpu_vsyscall_init(void *arg) |
58 | -- |
59 | 1.5.4.1 |
60 |