diff options
author | Anton Blanchard <anton@samba.org> | 2009-09-21 12:57:40 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-09-24 01:31:45 -0400 |
commit | f2053f1a7bf6005b4e81826b1ac8d0b4117c4cf0 (patch) | |
tree | d8c69b5ead3bfb5b09d05dd4804ce022cdea8883 /arch/powerpc/kernel | |
parent | 8bbde7a7062facf8af35bcc9a64cbafe8f36f3cf (diff) |
powerpc/perf_counter: Fix vdso detection
perf_counter uses arch_vma_name() to detect a vdso region which in turn uses
current->mm->context.vdso_base. We need to initialise this before doing
the mmap or else we fail to detect the vdso.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/vdso.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 3faaf29bdb29..94e2df3cae07 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c | |||
@@ -241,6 +241,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
241 | } | 241 | } |
242 | 242 | ||
243 | /* | 243 | /* |
244 | * Put vDSO base into mm struct. We need to do this before calling | ||
245 | * install_special_mapping or the perf counter mmap tracking code | ||
246 | * will fail to recognise it as a vDSO (since arch_vma_name fails). | ||
247 | */ | ||
248 | current->mm->context.vdso_base = vdso_base; | ||
249 | |||
250 | /* | ||
244 | * our vma flags don't have VM_WRITE so by default, the process isn't | 251 | * our vma flags don't have VM_WRITE so by default, the process isn't |
245 | * allowed to write those pages. | 252 | * allowed to write those pages. |
246 | * gdb can break that with ptrace interface, and thus trigger COW on | 253 | * gdb can break that with ptrace interface, and thus trigger COW on |
@@ -260,11 +267,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
260 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| | 267 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| |
261 | VM_ALWAYSDUMP, | 268 | VM_ALWAYSDUMP, |
262 | vdso_pagelist); | 269 | vdso_pagelist); |
263 | if (rc) | 270 | if (rc) { |
271 | current->mm->context.vdso_base = 0; | ||
264 | goto fail_mmapsem; | 272 | goto fail_mmapsem; |
265 | 273 | } | |
266 | /* Put vDSO base into mm struct */ | ||
267 | current->mm->context.vdso_base = vdso_base; | ||
268 | 274 | ||
269 | up_write(&mm->mmap_sem); | 275 | up_write(&mm->mmap_sem); |
270 | return 0; | 276 | return 0; |