diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-06-25 00:19:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 07:10:26 -0400 |
commit | fc8b8a60ffa7c89da58c75109dacf0b2798c7caf (patch) | |
tree | 7dad86ec633e9958c16ac7a3af779e6a19da05a3 | |
parent | ada857082317e6883cfcf7deb4e0c54d3c447cb0 (diff) |
x86, 64-bit: use write_gdt_entry in vsyscall_set_cpu
Use write_gdt_entry to generate the special vgetcpu descriptor in the
vsyscall page.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/vsyscall_64.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index 61efa2f7d564..c87cbd84c3e5 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c | |||
@@ -249,7 +249,7 @@ static ctl_table kernel_root_table2[] = { | |||
249 | doesn't violate that. We'll find out if it does. */ | 249 | doesn't violate that. We'll find out if it does. */ |
250 | static void __cpuinit vsyscall_set_cpu(int cpu) | 250 | static void __cpuinit vsyscall_set_cpu(int cpu) |
251 | { | 251 | { |
252 | unsigned long *d; | 252 | unsigned long d; |
253 | unsigned long node = 0; | 253 | unsigned long node = 0; |
254 | #ifdef CONFIG_NUMA | 254 | #ifdef CONFIG_NUMA |
255 | node = cpu_to_node(cpu); | 255 | node = cpu_to_node(cpu); |
@@ -260,11 +260,11 @@ static void __cpuinit vsyscall_set_cpu(int cpu) | |||
260 | /* Store cpu number in limit so that it can be loaded quickly | 260 | /* Store cpu number in limit so that it can be loaded quickly |
261 | in user space in vgetcpu. | 261 | in user space in vgetcpu. |
262 | 12 bits for the CPU and 8 bits for the node. */ | 262 | 12 bits for the CPU and 8 bits for the node. */ |
263 | d = (unsigned long *)(get_cpu_gdt_table(cpu) + GDT_ENTRY_PER_CPU); | 263 | d = 0x0f40000000000ULL; |
264 | *d = 0x0f40000000000ULL; | 264 | d |= cpu; |
265 | *d |= cpu; | 265 | d |= (node & 0xf) << 12; |
266 | *d |= (node & 0xf) << 12; | 266 | d |= (node >> 4) << 48; |
267 | *d |= (node >> 4) << 48; | 267 | write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S); |
268 | } | 268 | } |
269 | 269 | ||
270 | static void __cpuinit cpu_vsyscall_init(void *arg) | 270 | static void __cpuinit cpu_vsyscall_init(void *arg) |