c/r: Fix arch-specific use of mm->context.vdso in v14-rc3
PATCH 1/1 c/r: Fix arch-specific use of mm->context.vdso in v14-rc3
On s390 and PPC, the mm_context does not have a void *vdso member, but rather an unsigned long vdso_base. Since we cast the void * to an unsigned long anyway, add an arch-specific cr_arch_vdso() function to return the address.
This is tested on s390 and x86, but needs PPC validation.
--- arch/powerpc/mm/checkpoint.c | 6 ++++++ arch/s390/mm/checkpoint.c | 6 ++++++ arch/x86/mm/checkpoint.c | 5 +++++ checkpoint/checkpoint_arch.h | 1 + checkpoint/rstr_mem.c | 2 +- 5 files changed, 19 insertions(+), 1 deletions(-)
arch/powerpc/mm/checkpoint.c +6 -0
@@ -498,3 +498,9 @@ int cr_read_mm_context(struct cr_ctx *ctx, struct mm_struct *mm) {return 0 ; } + +unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm) +{ +return mm->context.vdso_base; +} +
arch/s390/mm/checkpoint.c +6 -0
@@ -119,3 +119,9 @@ int cr_write_mm_context(struct cr_ctx *ctx, struct mm_struct *mm)return ret; } + +unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm) +{ +return mm->context.vdso_base; +} +
arch/x86/mm/checkpoint.c +5 -0
@@ -271,3 +271,8 @@ int cr_write_mm_context(struct cr_ctx *ctx, struct mm_struct *mm)mutex_unlock (&mm->context.lock);return ret; } + +unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm) +{ +return (unsigned long )mm->context.vdso; +}
checkpoint/checkpoint_arch.h +1 -0
@@ -1,6 +1,7 @@#include <linux/checkpoint.h> extern int cr_retval_restart (struct cr_ctx *ctx); +extern unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm);extern int cr_write_head_arch (struct cr_ctx *ctx);extern int cr_write_thread (struct cr_ctx *ctx,struct task_struct *t);
checkpoint/rstr_mem.c +1 -1
@@ -416,7 +416,7 @@ static int cr_read_vma(struct cr_ctx *ctx, struct mm_struct *mm)/* handle special VDSO vma */ if (vma_type ==CR_VMA_VDSO ) { -if (vm_start != (unsigned long ) mm->context.vdso) +if (vm_start !=cr_arch_vdso (ctx, mm)) goto out;/* FIXME: uggh ... need to dig in */ ret =0 ;
Signature · 1 line
1.6.1
A message that is not in the archive (sent off-list or not yet received): 1239127585-15930-1-git-send-email-danms-r/[email protected]
Quoted 4 lines · Dan Smith
On s390 and PPC, the
mm_contextdoes not have a void *vdso member, but rather an unsigned longvdso_base. Since we cast the void * to an unsigned long anyway, add an arch-specificcr_arch_vdso()function to return the address.
Looks technically correct for powerpc at least, thanks.
Added.
Quoted 82 lines · Dan Smith
On s390 and PPC, the
mm_contextdoes not have a void *vdso member, but rather an unsigned longvdso_base. Since we cast the void * to an unsigned long anyway, add an arch-specificcr_arch_vdso()function to return the address.This is tested on s390 and x86, but needs PPC validation.
Signed-off-by Dan Smith <danms-r/[email protected]>--- arch/powerpc/mm/checkpoint.c | 6 ++++++ arch/s390/mm/checkpoint.c | 6 ++++++ arch/x86/mm/checkpoint.c | 5 +++++ checkpoint/checkpoint_arch.h | 1 + checkpoint/rstr_mem.c | 2 +- 5 files changed, 19 insertions(+), 1 deletions(-)arch/powerpc/mm/checkpoint.c +6
-0@@ -498,3 +498,9 @@ int cr_read_mm_context(struct cr_ctx *ctx, struct mm_struct *mm) {return 0 ; } + +unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm) +{ +return mm->context.vdso_base; +} +arch/s390/mm/checkpoint.c +6
-0@@ -119,3 +119,9 @@ int cr_write_mm_context(struct cr_ctx *ctx, struct mm_struct *mm)return ret; } + +unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm) +{ +return mm->context.vdso_base; +} +arch/x86/mm/checkpoint.c +5
-0@@ -271,3 +271,8 @@ int cr_write_mm_context(struct cr_ctx *ctx, struct mm_struct *mm)mutex_unlock (&mm->context.lock);return ret; } + +unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm) +{ +return (unsigned long )mm->context.vdso; +}checkpoint/checkpoint_arch.h +1
-0@@ -1,6 +1,7 @@#include <linux/checkpoint.h> extern int cr_retval_restart (struct cr_ctx *ctx); +extern unsigned long cr_arch_vdso (struct cr_ctx *ctx,struct mm_struct *mm);extern int cr_write_head_arch (struct cr_ctx *ctx);extern int cr_write_thread (struct cr_ctx *ctx,struct task_struct *t);checkpoint/rstr_mem.c +1
-1@@ -416,7 +416,7 @@ static int cr_read_vma(struct cr_ctx *ctx, struct mm_struct *mm)/* handle special VDSO vma */ if (vma_type ==CR_VMA_VDSO ) { -if (vm_start != (unsigned long ) mm->context.vdso) +if (vm_start !=cr_arch_vdso (ctx, mm)) goto out;/* FIXME: uggh ... need to dig in */ ret =0 ;