summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2020-09-27 11:16:29 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2020-12-03 15:01:16 +0100
commitc102f07667486dc4a6ae1e3fe7aa67135cb40e3e (patch)
treee1a97fc85b33c477ce3a5519a5623b482ba4adc8 /arch/powerpc/kernel
parentpowerpc/vdso: Provide vdso_remap() (diff)
downloadlinux-c102f07667486dc4a6ae1e3fe7aa67135cb40e3e.tar.xz
linux-c102f07667486dc4a6ae1e3fe7aa67135cb40e3e.zip
powerpc/vdso: Replace vdso_base by vdso
All other architectures but s390 use a void pointer named 'vdso' to reference the VDSO mapping. In a following patch, the VDSO data page will be put in front of text, vdso_base will then not anymore point to VDSO text. To avoid confusion between vdso_base and VDSO text, rename vdso_base into vdso and make it a void __user *. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/8e6cefe474aa4ceba028abb729485cd46c140990.1601197618.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/signal_32.c8
-rw-r--r--arch/powerpc/kernel/signal_64.c4
-rw-r--r--arch/powerpc/kernel/vdso.c8
3 files changed, 10 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 123682299d4f..e45aafef4c5b 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -801,8 +801,8 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
}
/* Save user registers on the stack */
- if (vdso32_rt_sigtramp && tsk->mm->context.vdso_base) {
- tramp = tsk->mm->context.vdso_base + vdso32_rt_sigtramp;
+ if (vdso32_rt_sigtramp && tsk->mm->context.vdso) {
+ tramp = (unsigned long)tsk->mm->context.vdso + vdso32_rt_sigtramp;
} else {
tramp = (unsigned long)mctx->mc_pad;
/* Set up the sigreturn trampoline: li r0,sigret; sc */
@@ -901,8 +901,8 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset,
else
unsafe_save_user_regs(regs, mctx, tm_mctx, 1, failed);
- if (vdso32_sigtramp && tsk->mm->context.vdso_base) {
- tramp = tsk->mm->context.vdso_base + vdso32_sigtramp;
+ if (vdso32_sigtramp && tsk->mm->context.vdso) {
+ tramp = (unsigned long)tsk->mm->context.vdso + vdso32_sigtramp;
} else {
tramp = (unsigned long)mctx->mc_pad;
/* Set up the sigreturn trampoline: li r0,sigret; sc */
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 7df088b9ad0f..68e850bd5ef7 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -854,8 +854,8 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
tsk->thread.fp_state.fpscr = 0;
/* Set up to return from userspace. */
- if (vdso64_rt_sigtramp && tsk->mm->context.vdso_base) {
- regs->nip = tsk->mm->context.vdso_base + vdso64_rt_sigtramp;
+ if (vdso64_rt_sigtramp && tsk->mm->context.vdso) {
+ regs->nip = (unsigned long)tsk->mm->context.vdso + vdso64_rt_sigtramp;
} else {
err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
if (err)
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index 2b975759a04d..5214cd4909f8 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -123,7 +123,7 @@ static int vdso_mremap(const struct vm_special_mapping *sm, struct vm_area_struc
if (new_size != text_size + PAGE_SIZE)
return -EINVAL;
- current->mm->context.vdso_base = new_vma->vm_start;
+ current->mm->context.vdso = (void __user *)new_vma->vm_start;
return 0;
}
@@ -198,7 +198,7 @@ static int __arch_setup_additional_pages(struct linux_binprm *bprm, int uses_int
* install_special_mapping or the perf counter mmap tracking code
* will fail to recognise it as a vDSO.
*/
- current->mm->context.vdso_base = vdso_base;
+ mm->context.vdso = (void __user *)vdso_base;
/*
* our vma flags don't have VM_WRITE so by default, the process isn't
@@ -221,7 +221,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
struct mm_struct *mm = current->mm;
int rc;
- mm->context.vdso_base = 0;
+ mm->context.vdso = NULL;
if (!vdso_ready)
return 0;
@@ -231,7 +231,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
rc = __arch_setup_additional_pages(bprm, uses_interp);
if (rc)
- mm->context.vdso_base = 0;
+ mm->context.vdso = NULL;
mmap_write_unlock(mm);
return rc;