diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-05 08:04:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-05 08:46:40 -0400 |
commit | f7b6eb3fa07269da20dbbde8ba37a0273fdbd9c9 (patch) | |
tree | 4816daabf4b89ea8497a2b045da7670b70e96c58 /arch | |
parent | cf1f45744c6fa3501e0a6f0ddc418f0ef27e725b (diff) |
x86: Set context.vdso before installing the mapping
In order to make arch_vma_name() work from inside
install_special_mapping() we need to set the context.vdso
before calling it.
( This is needed for performance counters to be able to track
this special executable area. )
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/vdso/vdso32-setup.c | 6 | ||||
-rw-r--r-- | arch/x86/vdso/vma.c | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index 1241f118ab56..58bc00f68b12 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c | |||
@@ -338,6 +338,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | current->mm->context.vdso = (void *)addr; | ||
342 | |||
341 | if (compat_uses_vma || !compat) { | 343 | if (compat_uses_vma || !compat) { |
342 | /* | 344 | /* |
343 | * MAYWRITE to allow gdb to COW and set breakpoints | 345 | * MAYWRITE to allow gdb to COW and set breakpoints |
@@ -358,11 +360,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
358 | goto up_fail; | 360 | goto up_fail; |
359 | } | 361 | } |
360 | 362 | ||
361 | current->mm->context.vdso = (void *)addr; | ||
362 | current_thread_info()->sysenter_return = | 363 | current_thread_info()->sysenter_return = |
363 | VDSO32_SYMBOL(addr, SYSENTER_RETURN); | 364 | VDSO32_SYMBOL(addr, SYSENTER_RETURN); |
364 | 365 | ||
365 | up_fail: | 366 | up_fail: |
367 | if (ret) | ||
368 | current->mm->context.vdso = NULL; | ||
369 | |||
366 | up_write(&mm->mmap_sem); | 370 | up_write(&mm->mmap_sem); |
367 | 371 | ||
368 | return ret; | 372 | return ret; |
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c index 7133cdf9098b..93b7a2938b2f 100644 --- a/arch/x86/vdso/vma.c +++ b/arch/x86/vdso/vma.c | |||
@@ -115,15 +115,18 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
115 | goto up_fail; | 115 | goto up_fail; |
116 | } | 116 | } |
117 | 117 | ||
118 | current->mm->context.vdso = (void *)addr; | ||
119 | |||
118 | ret = install_special_mapping(mm, addr, vdso_size, | 120 | ret = install_special_mapping(mm, addr, vdso_size, |
119 | VM_READ|VM_EXEC| | 121 | VM_READ|VM_EXEC| |
120 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| | 122 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| |
121 | VM_ALWAYSDUMP, | 123 | VM_ALWAYSDUMP, |
122 | vdso_pages); | 124 | vdso_pages); |
123 | if (ret) | 125 | if (ret) { |
126 | current->mm->context.vdso = NULL; | ||
124 | goto up_fail; | 127 | goto up_fail; |
128 | } | ||
125 | 129 | ||
126 | current->mm->context.vdso = (void *)addr; | ||
127 | up_fail: | 130 | up_fail: |
128 | up_write(&mm->mmap_sem); | 131 | up_write(&mm->mmap_sem); |
129 | return ret; | 132 | return ret; |