aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/vdso/vma.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index a155dca5edb5..261b1349acc9 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -248,7 +248,7 @@ __setup("vdso=", vdso_setup);
248 */ 248 */
249static void vsyscall_set_cpu(int cpu) 249static void vsyscall_set_cpu(int cpu)
250{ 250{
251 unsigned long d; 251 struct desc_struct d;
252 unsigned long node = 0; 252 unsigned long node = 0;
253#ifdef CONFIG_NUMA 253#ifdef CONFIG_NUMA
254 node = cpu_to_node(cpu); 254 node = cpu_to_node(cpu);
@@ -257,13 +257,18 @@ static void vsyscall_set_cpu(int cpu)
257 write_rdtscp_aux((node << 12) | cpu); 257 write_rdtscp_aux((node << 12) | cpu);
258 258
259 /* 259 /*
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
261 * in user space in vgetcpu. (12 bits for the CPU and 8 bits for the node) 261 * quickly in user space in vgetcpu. (12 bits for the CPU
262 * and 8 bits for the node)
262 */ 263 */
263 d = 0x0f40000000000ULL; 264 d = (struct desc_struct) {
264 d |= cpu; 265 .limit0 = cpu | ((node & 0xf) << 12),
265 d |= (node & 0xf) << 12; 266 .limit = node >> 4,
266 d |= (node >> 4) << 48; 267 .type = 4, /* RO data, expand down */
268 .dpl = 3, /* Visible to user code */
269 .s = 1, /* Not a system segment */
270 .p = 1, /* Present */
271 };
267 272
268 write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S); 273 write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S);
269} 274}