[RESEND PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-04-13 Thread Laurent Dufour
Some processes (CRIU) are moving the vDSO area using the mremap system call. As a consequence the kernel reference to the vDSO base address is no more valid and the signal return frame built once the vDSO has been moved is not pointing to the new sigreturn address. This patch handles vDSO

[RESEND PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-04-13 Thread Laurent Dufour
Some processes (CRIU) are moving the vDSO area using the mremap system call. As a consequence the kernel reference to the vDSO base address is no more valid and the signal return frame built once the vDSO has been moved is not pointing to the new sigreturn address. This patch handles vDSO

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Benjamin Herrenschmidt
On Thu, 2015-03-26 at 10:43 +0100, Ingo Molnar wrote: > * Benjamin Herrenschmidt wrote: > > > On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: > > > * Ingo Molnar wrote: > > > > > > > > +#define __HAVE_ARCH_REMAP > > > > > +static inline void arch_remap(struct mm_struct *mm, > > > > > +

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Laurent Dufour
On 26/03/2015 15:17, Ingo Molnar wrote: > > * Laurent Dufour wrote: > >>> I argue we should use the right condition to clear vdso_base: if >>> the vDSO gets at least partially unmapped. Otherwise there's >>> little point in the whole patch: either correctly track whether >>> the vDSO is OK,

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Ingo Molnar
* Laurent Dufour wrote: > > I argue we should use the right condition to clear vdso_base: if > > the vDSO gets at least partially unmapped. Otherwise there's > > little point in the whole patch: either correctly track whether > > the vDSO is OK, or don't ... > > That's a good option, but it

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Laurent Dufour
On 26/03/2015 10:43, Ingo Molnar wrote: > > * Benjamin Herrenschmidt wrote: > >> On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: >>> * Ingo Molnar wrote: >>> > +#define __HAVE_ARCH_REMAP > +static inline void arch_remap(struct mm_struct *mm, > + unsigned

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Laurent Dufour
On 26/03/2015 10:48, Ingo Molnar wrote: > > * Benjamin Herrenschmidt wrote: > +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct mm_struct *mm, +unsigned long old_start, unsigned long old_end, +unsigned long

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Ingo Molnar
* Benjamin Herrenschmidt wrote: > > > +#define __HAVE_ARCH_REMAP > > > +static inline void arch_remap(struct mm_struct *mm, > > > + unsigned long old_start, unsigned long old_end, > > > + unsigned long new_start, unsigned long new_end) > > > +{ > > >

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Ingo Molnar
* Benjamin Herrenschmidt wrote: > On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: > > * Ingo Molnar wrote: > > > > > > +#define __HAVE_ARCH_REMAP > > > > +static inline void arch_remap(struct mm_struct *mm, > > > > + unsigned long old_start, unsigned long >

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Ingo Molnar
* Benjamin Herrenschmidt b...@kernel.crashing.org wrote: +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct mm_struct *mm, + unsigned long old_start, unsigned long old_end, + unsigned long new_start, unsigned long new_end)

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Ingo Molnar
* Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: * Ingo Molnar mi...@kernel.org wrote: +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct mm_struct *mm, + unsigned long

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Laurent Dufour
On 26/03/2015 10:48, Ingo Molnar wrote: * Benjamin Herrenschmidt b...@kernel.crashing.org wrote: +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct mm_struct *mm, +unsigned long old_start, unsigned long old_end, +unsigned long

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Laurent Dufour
On 26/03/2015 10:43, Ingo Molnar wrote: * Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: * Ingo Molnar mi...@kernel.org wrote: +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct mm_struct *mm, +

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Benjamin Herrenschmidt
On Thu, 2015-03-26 at 10:43 +0100, Ingo Molnar wrote: * Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: * Ingo Molnar mi...@kernel.org wrote: +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Ingo Molnar
* Laurent Dufour lduf...@linux.vnet.ibm.com wrote: I argue we should use the right condition to clear vdso_base: if the vDSO gets at least partially unmapped. Otherwise there's little point in the whole patch: either correctly track whether the vDSO is OK, or don't ... That's a

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-26 Thread Laurent Dufour
On 26/03/2015 15:17, Ingo Molnar wrote: * Laurent Dufour lduf...@linux.vnet.ibm.com wrote: I argue we should use the right condition to clear vdso_base: if the vDSO gets at least partially unmapped. Otherwise there's little point in the whole patch: either correctly track whether the

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Benjamin Herrenschmidt
On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: > * Ingo Molnar wrote: > > > > +#define __HAVE_ARCH_REMAP > > > +static inline void arch_remap(struct mm_struct *mm, > > > + unsigned long old_start, unsigned long old_end, > > > + unsigned long

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Benjamin Herrenschmidt
On Wed, 2015-03-25 at 19:33 +0100, Ingo Molnar wrote: > * Laurent Dufour wrote: > > > +static inline void arch_unmap(struct mm_struct *mm, > > + struct vm_area_struct *vma, > > + unsigned long start, unsigned long end) > > +{ > > + if (start <=

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Ingo Molnar
* Ingo Molnar wrote: > > +#define __HAVE_ARCH_REMAP > > +static inline void arch_remap(struct mm_struct *mm, > > + unsigned long old_start, unsigned long old_end, > > + unsigned long new_start, unsigned long new_end) > > +{ > > + /* > > +*

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Ingo Molnar
* Laurent Dufour wrote: > +static inline void arch_unmap(struct mm_struct *mm, > + struct vm_area_struct *vma, > + unsigned long start, unsigned long end) > +{ > + if (start <= mm->context.vdso_base && mm->context.vdso_base < end) > +

[PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Laurent Dufour
Some processes (CRIU) are moving the vDSO area using the mremap system call. As a consequence the kernel reference to the vDSO base address is no more valid and the signal return frame built once the vDSO has been moved is not pointing to the new sigreturn address. This patch handles vDSO

[PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Laurent Dufour
Some processes (CRIU) are moving the vDSO area using the mremap system call. As a consequence the kernel reference to the vDSO base address is no more valid and the signal return frame built once the vDSO has been moved is not pointing to the new sigreturn address. This patch handles vDSO

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Ingo Molnar
* Laurent Dufour lduf...@linux.vnet.ibm.com wrote: +static inline void arch_unmap(struct mm_struct *mm, + struct vm_area_struct *vma, + unsigned long start, unsigned long end) +{ + if (start = mm-context.vdso_base mm-context.vdso_base end) +

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Ingo Molnar
* Ingo Molnar mi...@kernel.org wrote: +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct mm_struct *mm, + unsigned long old_start, unsigned long old_end, + unsigned long new_start, unsigned long new_end) +{ + /* +*

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Benjamin Herrenschmidt
On Wed, 2015-03-25 at 19:33 +0100, Ingo Molnar wrote: * Laurent Dufour lduf...@linux.vnet.ibm.com wrote: +static inline void arch_unmap(struct mm_struct *mm, + struct vm_area_struct *vma, + unsigned long start, unsigned long end) +{ + if (start =

Re: [PATCH v3 2/2] powerpc/mm: Tracking vDSO remap

2015-03-25 Thread Benjamin Herrenschmidt
On Wed, 2015-03-25 at 19:36 +0100, Ingo Molnar wrote: * Ingo Molnar mi...@kernel.org wrote: +#define __HAVE_ARCH_REMAP +static inline void arch_remap(struct mm_struct *mm, + unsigned long old_start, unsigned long old_end, + unsigned long