Tracking user space vDSO remaping
Subsystems (20)
v3 cover Tracking user space vDSO remaping
CRIU is recreating the process memory layout by remapping the checkpointee memory area on top of the current process (criu). This includes remapping the vDSO to the place it has at checkpoint time.
However some architectures like powerpc are keeping a reference to the vDSO base address to build the signal return stack frame by calling the vDSO sigreturn service. So once the vDSO has been moved, this reference is no more valid and the signal frame built later are not usable.
This patch serie is introducing a new mm hook 'arch_remap' which is called when mremap is done and the mm lock still hold. The next patch is adding the vDSO remap and unmap tracking to the powerpc architecture.
Resending
- rebased on 4.0.0
Changes in v3:
--------------
- Fixed grammatical error in a comment of the second patch. Thanks again, Ingo.
Changes in v2:
--------------
- Following the Ingo Molnar's advice, enabling the call to arch_remap through the __HAVE_ARCH_REMAP macro. This reduces considerably the first patch.
Laurent Dufour (2):
mm: Introducing arch_remap hook
powerpc/mm: Tracking vDSO remap
arch/powerpc/include/asm/mmu_context.h | 36 +++++++++++++++++++++++++++++++++- mm/mremap.c | 19 ++++++++++++------ 2 files changed, 48 insertions(+), 7 deletions(-)
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH RESEND v3 1/2 mm: Introducing arch_remap hook
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new arch_remap mm hook which is placed in the path of mremap, and is called before the old area is unmapped (and the arch_unmap hook is called).
The architectures which need to call this hook should define __HAVE_ARCH_REMAP in their asm/mmu_context.h and provide the arch_remap service with the following prototype:
void arch_remap(struct mm_struct *mm,
unsigned long old_start, unsigned long old_end, unsigned long new_start, unsigned long new_end);
--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
mm/mremap.c +13 -6
@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h"
@@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { +move_page_tables (new_vma, new_addr, vma, + old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAP +arch_remap (mm, old_addr, old_addr+old_len, + new_addr, new_addr+new_len); +#endif }/* Conceal VM_ACCOUNT so old reservation is not undone */
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 42 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +1
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err;
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 10 lines
mm/mremap.c +9
-0+ }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { +move_page_tables (new_vma, new_addr, vma, + old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAP
It would be cleaner to provide dummy arch_remap() for !__HAVE_ARCH_REMAP in some generic header.
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 301
Quoted 2 lines
mm/mremap.c +2
-0+arch_remap (mm, old_addr, old_addr+old_len, + new_addr, new_addr+new_len);
Spaces around '+'?
Quoted 12 lines
mm/mremap.c +1
-0+#endif }/* Conceal VM_ACCOUNT so old reservation is not undone */ Signature · 7 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Signature · 7 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 48 lines · Kirill A. Shutemov
Quoted 47 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +6
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { + move_page_tables(new_vma, new_addr, vma,
Quoted 8 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 5 lines
mm/mremap.c +4
-0+ old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAPIt would be cleaner to provide dummy
arch_remap()for !__HAVE_ARCH_REMAP in some generic header.
The idea was to not impact all the architectures as arch_unmap(), arch_dup_mmap() or arch_exit_mmap() implies.
I look at the headers where such a dummy arch_remap could be put but I can't figure out one which will not impact all the architecture. What about defining a dummy service earlier in mm/remap.c in the case __HAVE_ARCH_REMAP is not defined ?
Something like :
#ifndef __HAVE_ARCH_REMAP
static inline void void arch_remap(struct mm_struct *mm,
unsigned long old_start, unsigned long old_end, unsigned long new_start, unsigned long new_end)
{
}
#endif
Quoted 6 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 301
Quoted 4 lines
mm/mremap.c +2
-0+arch_remap (mm, old_addr, old_addr+old_len, + new_addr, new_addr+new_len);Spaces around '+'?
Nice catch ;)
Thanks,
Laurent.
Quoted 8 lines
Quoted 8 lines
mm/mremap.c +1
-0+#endif }/* Conceal VM_ACCOUNT so old reservation is not undone */ Signature · 1 line
1.9.1
Quoted 6 lines
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 61 lines · Laurent Dufour
Quoted 48 lines · Kirill A. Shutemov
Quoted 47 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +6
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { + move_page_tables(new_vma, new_addr, vma,Quoted 8 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 5 lines
mm/mremap.c +4
-0+ old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAPIt would be cleaner to provide dummy
arch_remap()for !__HAVE_ARCH_REMAP in some generic header.The idea was to not impact all the architectures as
arch_unmap(),arch_dup_mmap()orarch_exit_mmap()implies.
Quoted 14 lines
I look at the headers where such a dummy
arch_remapcould be put but I can't figure out one which will not impact all the architecture. What about defining a dummy service earlier inmm/remap.cin the case__HAVE_ARCH_REMAPis not defined ?
Something like :
#ifndef__HAVE_ARCH_REMAP
static inline void void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end)
{
}
#endif
Or just #define arch_remap(...) do { } while (0)
Signature · 7 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 77 lines · Kirill A. Shutemov
Quoted 61 lines · Laurent Dufour
Quoted 48 lines · Kirill A. Shutemov
Quoted 47 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +6
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { + move_page_tables(new_vma, new_addr, vma,Quoted 8 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 5 lines
mm/mremap.c +4
-0+ old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAPIt would be cleaner to provide dummy
arch_remap()for !__HAVE_ARCH_REMAP in some generic header.The idea was to not impact all the architectures as
arch_unmap(),arch_dup_mmap()orarch_exit_mmap()implies.Quoted 14 lines
I look at the headers where such a dummy
arch_remapcould be put but I can't figure out one which will not impact all the architecture. What about defining a dummy service earlier inmm/remap.cin the case__HAVE_ARCH_REMAPis not defined ?
Something like :
#ifndef__HAVE_ARCH_REMAP
static inline void void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end)
{
}
#endif
Quoted 2 lines
Or just #define
arch_remap(...)do { } while (0)
I guessed you wanted the arch_remap() prototype to be exposed somewhere in the code.
To be honest, I can't find the benefit of defining a dummy arch_remap() in mm/remap.c if __HAVE_ARCH_REMAP is not defined instead of calling it in move_vma if __HAVE_ARCH_REMAP is defined.
Is it really what you want ?
Thanks,
Laurent.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 81 lines · Laurent Dufour
Quoted 77 lines · Kirill A. Shutemov
Quoted 61 lines · Laurent Dufour
Quoted 48 lines · Kirill A. Shutemov
Quoted 47 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +6
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { + move_page_tables(new_vma, new_addr, vma,Quoted 8 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 5 lines
mm/mremap.c +4
-0+ old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAPIt would be cleaner to provide dummy
arch_remap()for !__HAVE_ARCH_REMAP in some generic header.The idea was to not impact all the architectures as
arch_unmap(),arch_dup_mmap()orarch_exit_mmap()implies.Quoted 14 lines
I look at the headers where such a dummy
arch_remapcould be put but I can't figure out one which will not impact all the architecture. What about defining a dummy service earlier inmm/remap.cin the case__HAVE_ARCH_REMAPis not defined ?
Something like :
#ifndef__HAVE_ARCH_REMAP
static inline void void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end)
{
}
#endifQuoted 2 lines
Or just #define
arch_remap(...)do { } while (0)
Quoted 7 lines
I guessed you wanted the
arch_remap()prototype to be exposed somewhere in the code.To be honest, I can't find the benefit of defining a dummy
arch_remap()inmm/remap.cif__HAVE_ARCH_REMAPis not defined instead of calling it inmove_vmaif__HAVE_ARCH_REMAPis defined.
Is it really what you want ?
I think Kirill meant something like e.g. the arch_enter_lazy_mmu_mode() is implemented and called in mm/mremap.c -- the "generic" part is in the include/asm-generic/pgtable.h and those architectures willing to have their own implementation are in arch/$arch/...
Kirill, if I'm right with it, can you suggest the header where to put the "generic" mremap hook's (empty) body?
-- Pavel
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 90 lines · Pavel Emelyanov
Quoted 81 lines · Laurent Dufour
Quoted 77 lines · Kirill A. Shutemov
Quoted 61 lines · Laurent Dufour
Quoted 48 lines · Kirill A. Shutemov
Quoted 47 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +6
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { + move_page_tables(new_vma, new_addr, vma,Quoted 8 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 5 lines
mm/mremap.c +4
-0+ old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAPIt would be cleaner to provide dummy
arch_remap()for !__HAVE_ARCH_REMAP in some generic header.The idea was to not impact all the architectures as
arch_unmap(),arch_dup_mmap()orarch_exit_mmap()implies.Quoted 14 lines
I look at the headers where such a dummy
arch_remapcould be put but I can't figure out one which will not impact all the architecture. What about defining a dummy service earlier inmm/remap.cin the case__HAVE_ARCH_REMAPis not defined ?
Something like :
#ifndef__HAVE_ARCH_REMAP
static inline void void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end)
{
}
#endifQuoted 2 lines
Or just #define
arch_remap(...)do { } while (0)Quoted 7 lines
I guessed you wanted the
arch_remap()prototype to be exposed somewhere in the code.To be honest, I can't find the benefit of defining a dummy
arch_remap()inmm/remap.cif__HAVE_ARCH_REMAPis not defined instead of calling it inmove_vmaif__HAVE_ARCH_REMAPis defined.
Is it really what you want ?
Quoted 7 lines
I think Kirill meant something like e.g. the
arch_enter_lazy_mmu_mode()is implemented and called inmm/mremap.c-- the "generic" part is in theinclude/asm-generic/pgtable.hand those architectures willing to have their own implementation are inarch/$arch/...Kirill, if I'm right with it, can you suggest the header where to put the "generic" mremap hook's (empty) body?
I initially thought it would be enough to put it into <asm-generic/mmu_context.h>, expecting it works as <asm-generic/pgtable.h>. But that's not the case.
It probably worth at some point rework all <asm/mmu_context.h> to include <asm-generic/mmu_context.h> at the end as we do for <asm/pgtable.h>. But that's outside the scope of the patchset, I guess.
I don't see any better candidate for such dummy header. :-/
Signature · 7 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 103 lines · Kirill A. Shutemov
Quoted 90 lines · Pavel Emelyanov
Quoted 81 lines · Laurent Dufour
Quoted 77 lines · Kirill A. Shutemov
Quoted 61 lines · Laurent Dufour
Quoted 48 lines · Kirill A. Shutemov
Quoted 47 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +6
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { + move_page_tables(new_vma, new_addr, vma,Quoted 8 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 5 lines
mm/mremap.c +4
-0+ old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAPIt would be cleaner to provide dummy
arch_remap()for !__HAVE_ARCH_REMAP in some generic header.The idea was to not impact all the architectures as
arch_unmap(),arch_dup_mmap()orarch_exit_mmap()implies.Quoted 14 lines
I look at the headers where such a dummy
arch_remapcould be put but I can't figure out one which will not impact all the architecture. What about defining a dummy service earlier inmm/remap.cin the case__HAVE_ARCH_REMAPis not defined ?
Something like :
#ifndef__HAVE_ARCH_REMAP
static inline void void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end)
{
}
#endifQuoted 2 lines
Or just #define
arch_remap(...)do { } while (0)Quoted 7 lines
I guessed you wanted the
arch_remap()prototype to be exposed somewhere in the code.To be honest, I can't find the benefit of defining a dummy
arch_remap()inmm/remap.cif__HAVE_ARCH_REMAPis not defined instead of calling it inmove_vmaif__HAVE_ARCH_REMAPis defined.
Is it really what you want ?Quoted 7 lines
I think Kirill meant something like e.g. the
arch_enter_lazy_mmu_mode()is implemented and called inmm/mremap.c-- the "generic" part is in theinclude/asm-generic/pgtable.hand those architectures willing to have their own implementation are inarch/$arch/...Kirill, if I'm right with it, can you suggest the header where to put the "generic" mremap hook's (empty) body?
I initially thought it would be enough to put it into <
asm-generic/mmu_context.h>, expecting it works as <asm-generic/pgtable.h>. But that's not the case.
Quoted 5 lines
It probably worth at some point rework all <
asm/mmu_context.h> to include <asm-generic/mmu_context.h> at the end as we do for <asm/pgtable.h>. But that's outside the scope of the patchset, I guess.I don't see any better candidate for such dummy header. :-/
Clearly, I'm not confortable with a rewrite of <asm/mmu_context.h> :(
So what about this patch, is this v3 acceptable ?
Cheers,
Laurent.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Kirill A. Shutemov
Acked-byRe: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 108 lines · Laurent Dufour
Quoted 107 lines · Kirill A. Shutemov
Quoted 90 lines · Pavel Emelyanov
Quoted 81 lines · Laurent Dufour
Quoted 77 lines · Kirill A. Shutemov
Quoted 61 lines · Laurent Dufour
Quoted 48 lines · Kirill A. Shutemov
Quoted 47 lines · Laurent Dufour
Some architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new
arch_remapmm hook which is placed in the path of mremap, and is called before the old area is unmapped (and thearch_unmaphook is called).The architectures which need to call this hook should define
__HAVE_ARCH_REMAPin theirasm/mmu_context.hand provide thearch_remapservice with the following prototype:
void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end);Signed-off-by Laurent Dufour <[email protected]>Reviewed-by Ingo Molnar <[email protected]>--- mm/mremap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)mm/mremap.c +6
-6@@ -25,6 +25,7 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> +#include <asm/mmu_context.h> #include "internal.h" @@ -286,13 +287,19 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { + move_page_tables(new_vma, new_addr, vma,Quoted 8 lines
mm/mremap.c static unsigned long move_vma(struct vm_area_struct *vma, · line 299
Quoted 5 lines
mm/mremap.c +4
-0+ old_addr, moved_len, true); +return err; + } } +#ifdef __HAVE_ARCH_REMAPIt would be cleaner to provide dummy
arch_remap()for !__HAVE_ARCH_REMAP in some generic header.The idea was to not impact all the architectures as
arch_unmap(),arch_dup_mmap()orarch_exit_mmap()implies.Quoted 14 lines
I look at the headers where such a dummy
arch_remapcould be put but I can't figure out one which will not impact all the architecture. What about defining a dummy service earlier inmm/remap.cin the case__HAVE_ARCH_REMAPis not defined ?
Something like :
#ifndef__HAVE_ARCH_REMAP
static inline void void arch_remap(structmm_struct*mm,
unsigned longold_start, unsigned longold_end, unsigned longnew_start, unsigned longnew_end)
{
}
#endifQuoted 2 lines
Or just #define
arch_remap(...)do { } while (0)Quoted 7 lines
I guessed you wanted the
arch_remap()prototype to be exposed somewhere in the code.To be honest, I can't find the benefit of defining a dummy
arch_remap()inmm/remap.cif__HAVE_ARCH_REMAPis not defined instead of calling it inmove_vmaif__HAVE_ARCH_REMAPis defined.
Is it really what you want ?Quoted 7 lines
I think Kirill meant something like e.g. the
arch_enter_lazy_mmu_mode()is implemented and called inmm/mremap.c-- the "generic" part is in theinclude/asm-generic/pgtable.hand those architectures willing to have their own implementation are inarch/$arch/...Kirill, if I'm right with it, can you suggest the header where to put the "generic" mremap hook's (empty) body?
I initially thought it would be enough to put it into <
asm-generic/mmu_context.h>, expecting it works as <asm-generic/pgtable.h>. But that's not the case.It probably worth at some point rework all <
asm/mmu_context.h> to include <asm-generic/mmu_context.h> at the end as we do for <asm/pgtable.h>. But that's outside the scope of the patchset, I guess.
Quoted 5 lines
Quoted 1 line
I don't see any better candidate for such dummy header. :-/
Clearly, I'm not confortable with a rewrite of <
asm/mmu_context.h> :(So what about this patch, is this v3 acceptable ?
Signature · 7 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Pavel Emelyanov
Acked-byRe: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I initially thought it would be enough to put it into <
asm-generic/mmu_context.h>, expecting it works as <asm-generic/pgtable.h>. But that's not the case.It probably worth at some point rework all <
asm/mmu_context.h> to include <asm-generic/mmu_context.h> at the end as we do for <asm/pgtable.h>. But that's outside the scope of the patchset, I guess.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
I don't see any better candidate for such dummy header. :-/
Clearly, I'm not confortable with a rewrite of <
asm/mmu_context.h> :(So what about this patch, is this v3 acceptable ?
Other than the #ifdef thing, the same:
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 12 lines · Pavel Emelyanov
Quoted 12 lines
Quoted 12 lines
Quoted 9 lines
I initially thought it would be enough to put it into <
asm-generic/mmu_context.h>, expecting it works as <asm-generic/pgtable.h>. But that's not the case.It probably worth at some point rework all <
asm/mmu_context.h> to include <asm-generic/mmu_context.h> at the end as we do for <asm/pgtable.h>. But that's outside the scope of the patchset, I guess.I don't see any better candidate for such dummy header. :-/
Clearly, I'm not confortable with a rewrite of <
asm/mmu_context.h> :(
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
So what about this patch, is this v3 acceptable ?
Other than the #ifdef thing, the same:
Acked-by Pavel Emelyanov <[email protected]>
Thanks Kirill and Pavel.
Should I send a new version fixing the spaces around the plus sign ?
Cheers,
Laurent.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerRe: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
In reply to Kirill A. ShutemovQuoted 7 lines · On Mon, 13 Apr 2015 17:02:19 +0300 "Kirill A. Shutemov" <[email protected]>…
Quoted 2 lines
Kirill, if I'm right with it, can you suggest the header where to put the "generic" mremap hook's (empty) body?
I initially thought it would be enough to put it into <
asm-generic/mmu_context.h>, expecting it works as <asm-generic/pgtable.h>. But that's not the case.
Quoted 5 lines
It probably worth at some point rework all <
asm/mmu_context.h> to include <asm-generic/mmu_context.h> at the end as we do for <asm/pgtable.h>. But that's outside the scope of the patchset, I guess.I don't see any better candidate for such dummy header. :-/
Do away with __HAVE_ARCH_REMAP and do it like this:
arch/x/include/asm/y.h:
extern void arch_remap(...); #define arch_remap arch_remap
include/linux/z.h:
#include <asm/y.h>
#ifndef arch_remap
static inline void arch_remap(...) { }
#define arch_remap arch_remap
#endif--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 22 lines · Andrew Morton
Quoted 7 lines · On Mon, 13 Apr 2015 17:02:19 +0300 "Kirill A. Shutemov" <[email protected]>…
Quoted 2 lines
Kirill, if I'm right with it, can you suggest the header where to put the "generic" mremap hook's (empty) body?
I initially thought it would be enough to put it into <
asm-generic/mmu_context.h>, expecting it works as <asm-generic/pgtable.h>. But that's not the case.Quoted 5 lines
It probably worth at some point rework all <
asm/mmu_context.h> to include <asm-generic/mmu_context.h> at the end as we do for <asm/pgtable.h>. But that's outside the scope of the patchset, I guess.I don't see any better candidate for such dummy header. :-/
Do away with
__HAVE_ARCH_REMAPand do it like this:
arch/x/include/asm/y.h:extern void arch_remap(...); #define arch_remap arch_remap
Quoted 8 lines
include/linux/z.h:#include <asm/y.h> #ifndef arch_remap static inline void arch_remap(...) { } #define arch_remap arch_remap #endif
Hi Andrew,
I like your idea, but I can't find any good candidate for <asm/y.h> and <linux/z.h>.
I tried with <linux/mm.h> and <asm/mmu_context.h> but <asm/mmu_context.h> is already including <linux/mm.h>.
Do you have any suggestion ?
Another option could be to do it like the actual arch_unmap() in <asm-generic/mm_hooks.h> but this is the opposite of your idea, and Ingo was not comfortable with this idea due to the impact of the other architectures.
Cheers,
Laurent.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerRe: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 24 lines · On Tue, 14 Apr 2015 11:26:13 +0200 Laurent Dufour <[email protected]>…
Quoted 7 lines
Do away with
__HAVE_ARCH_REMAPand do it like this:
arch/x/include/asm/y.h:extern void arch_remap(...); #define arch_remap arch_remapQuoted 8 lines
include/linux/z.h:#include <asm/y.h> #ifndef arch_remap static inline void arch_remap(...) { } #define arch_remap arch_remap #endifHi Andrew,
I like your idea, but I can't find any good candidate for <
asm/y.h> and <linux/z.h>.I tried with <
linux/mm.h> and <asm/mmu_context.h> but <asm/mmu_context.h> is already including <linux/mm.h>.
Quoted 6 lines
Do you have any suggestion ?
Another option could be to do it like the actual
arch_unmap()in <asm-generic/mm_hooks.h> but this is the opposite of your idea, and Ingo was not comfortable with this idea due to the impact of the other architectures.
I don't see any appropriate header files for this. mman.h is kinda close.
So we create new header files, that's not a problem. I'm torn between
a) include/linux/mm-arch-hooks.h (and 31 arch/X/include/asm/mm-arch-hooks.h). Mandate: mm stuff which can be overridded by arch
versus
b) include/linux/mremap.h (+31), with a narrower mandate.
This comes up fairly regularly so I suspect a) is better. We'll add things to it over time, and various bits of existing ad-hackery can be moved over as cleanups.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RESEND PATCH v3 1/2] mm: Introducing arch_remap hook
Quoted 42 lines · Andrew Morton
Quoted 24 lines · On Tue, 14 Apr 2015 11:26:13 +0200 Laurent Dufour <[email protected]>…
Quoted 7 lines
Do away with
__HAVE_ARCH_REMAPand do it like this:
arch/x/include/asm/y.h:extern void arch_remap(...); #define arch_remap arch_remapQuoted 8 lines
include/linux/z.h:#include <asm/y.h> #ifndef arch_remap static inline void arch_remap(...) { } #define arch_remap arch_remap #endifHi Andrew,
I like your idea, but I can't find any good candidate for <
asm/y.h> and <linux/z.h>.I tried with <
linux/mm.h> and <asm/mmu_context.h> but <asm/mmu_context.h> is already including <linux/mm.h>.Quoted 6 lines
Do you have any suggestion ?
Another option could be to do it like the actual
arch_unmap()in <asm-generic/mm_hooks.h> but this is the opposite of your idea, and Ingo was not comfortable with this idea due to the impact of the other architectures.I don't see any appropriate header files for this.
mman.his kinda close.So we create new header files, that's not a problem. I'm torn between
a)
include/linux/mm-arch-hooks.h(and 31arch/X/include/asm/mm-arch-hooks.h). Mandate: mm stuff which can be overridded by arch
Quoted 8 lines
versus
b)
include/linux/mremap.h(+31), with a narrower mandate.This comes up fairly regularly so I suspect a) is better. We'll add things to it over time, and various bits of existing ad-hackery can be moved over as cleanups.
Thanks for the advice,
I'll do a), starting with the arch_remap macro, adding the 30 "empty" arch/x/include/asm/mm-arch-hooks.h files, and implementing arch_remap for powerpc.
Then, if the first patch is accepted, I may move the arch_*() stuff defined in include/asm-generic/mm_hooks.h into include/linux/mm-arch-hooks.h and filled some arch/X/include/asm/mm-arch-hooks.h. The file include/asm-generic/mm_hooks.h will then become empty, and been removed.
Cheers,
Laurent.
* Anglais - detecte
* Francais
* Anglais
* Francais
* Anglais
<javascript:void(0);>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
v5 cover Tracking user space vDSO remaping
In reply to Andrew MortonCRIU is recreating the process memory layout by remapping the checkpointee memory area on top of the current process (criu). This includes remapping the vDSO to the place it has at checkpoint time.
However some architectures like powerpc are keeping a reference to the vDSO base address to build the signal return stack frame by calling the vDSO sigreturn service. So once the vDSO has been moved, this reference is no more valid and the signal frame built later are not usable.
This patch serie is introducing a new mm hook framework, and a new arch_remap hook which is called when mremap is done and the mm lock still hold. The next patch is adding the vDSO remap and unmap tracking to the powerpc architecture.
Changes in v5:
- Jumping over v4 which was too complex (PowerPC part) for the need.
- Introducing new mm hook framework as suggested by Andrew Morton.
Changes in v4:
- Reviewing the PowerPC part of the patch to handle partial unmap and remap of the vDSO.
Changes in v3:
- Fixed grammatical error in a comment of the second patch. Thanks again, Ingo.
Changes in v2:
--------------
- Following the Ingo Molnar's advice, enabling the call to arch_remap through the __HAVE_ARCH_REMAP macro. This reduces considerably the first patch.
Laurent Dufour (3):
mm: New mm hook framework
mm: New arch_remap hook
powerpc/mm: Tracking vDSO remap
arch/alpha/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/arc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/arm/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/arm64/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/avr32/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/blackfin/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/c6x/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/cris/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/frv/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/hexagon/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/ia64/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/m32r/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/m68k/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/metag/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/microblaze/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/mips/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/mn10300/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/nios2/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/openrisc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/parisc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/powerpc/include/asm/mm-arch-hooks.h | 28 ++++++++++++++++++++++++++++ arch/powerpc/include/asm/mmu_context.h | 23 ++++++++++++++++++++++- arch/s390/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/score/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/sh/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/sparc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/tile/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/um/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/unicore32/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/x86/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/xtensa/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ include/linux/mm-arch-hooks.h | 25 +++++++++++++++++++++++++ mm/mremap.c | 17 +++++++++++------ 33 files changed, 521 insertions(+), 7 deletions(-) create mode 100644 arch/alpha/include/asm/mm-arch-hooks.h create mode 100644 arch/arc/include/asm/mm-arch-hooks.h create mode 100644 arch/arm/include/asm/mm-arch-hooks.h create mode 100644 arch/arm64/include/asm/mm-arch-hooks.h create mode 100644 arch/avr32/include/asm/mm-arch-hooks.h create mode 100644 arch/blackfin/include/asm/mm-arch-hooks.h create mode 100644 arch/c6x/include/asm/mm-arch-hooks.h create mode 100644 arch/cris/include/asm/mm-arch-hooks.h create mode 100644 arch/frv/include/asm/mm-arch-hooks.h create mode 100644 arch/hexagon/include/asm/mm-arch-hooks.h create mode 100644 arch/ia64/include/asm/mm-arch-hooks.h create mode 100644 arch/m32r/include/asm/mm-arch-hooks.h create mode 100644 arch/m68k/include/asm/mm-arch-hooks.h create mode 100644 arch/metag/include/asm/mm-arch-hooks.h create mode 100644 arch/microblaze/include/asm/mm-arch-hooks.h create mode 100644 arch/mips/include/asm/mm-arch-hooks.h create mode 100644 arch/mn10300/include/asm/mm-arch-hooks.h create mode 100644 arch/nios2/include/asm/mm-arch-hooks.h create mode 100644 arch/openrisc/include/asm/mm-arch-hooks.h create mode 100644 arch/parisc/include/asm/mm-arch-hooks.h create mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h create mode 100644 arch/s390/include/asm/mm-arch-hooks.h create mode 100644 arch/score/include/asm/mm-arch-hooks.h create mode 100644 arch/sh/include/asm/mm-arch-hooks.h create mode 100644 arch/sparc/include/asm/mm-arch-hooks.h create mode 100644 arch/tile/include/asm/mm-arch-hooks.h create mode 100644 arch/um/include/asm/mm-arch-hooks.h create mode 100644 arch/unicore32/include/asm/mm-arch-hooks.h create mode 100644 arch/x86/include/asm/mm-arch-hooks.h create mode 100644 arch/xtensa/include/asm/mm-arch-hooks.h create mode 100644 include/linux/mm-arch-hooks.h
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v5 1/3 mm: New mm hook framework
This patch introduces a new set of header file to manage mm hooks:
- per architecture empty header file (arch/x/include/asm/mm-arch-hooks.h)
- a generic header (include/linux/mm-arch-hooks.h)
The architecture which need to overwrite a hook as to redefine it in its header file, while architecture which doesn't need have nothing to do.
The default hooks are defined in the generic header and are used in the case the architecture is not defining it.
In a next step, mm hooks defined in include/asm-generic/mm_hooks.h should be moved here.
--- arch/alpha/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/arc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/arm/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/arm64/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/avr32/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/blackfin/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/c6x/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/cris/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/frv/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/hexagon/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/ia64/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/m32r/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/m68k/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/metag/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/microblaze/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/mips/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/mn10300/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/nios2/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/openrisc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/parisc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/powerpc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/s390/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/score/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/sh/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/sparc/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/tile/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/um/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/unicore32/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/x86/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ arch/xtensa/include/asm/mm-arch-hooks.h | 15 +++++++++++++++ include/linux/mm-arch-hooks.h | 16 ++++++++++++++++ 31 files changed, 466 insertions(+) create mode 100644 arch/alpha/include/asm/mm-arch-hooks.h create mode 100644 arch/arc/include/asm/mm-arch-hooks.h create mode 100644 arch/arm/include/asm/mm-arch-hooks.h create mode 100644 arch/arm64/include/asm/mm-arch-hooks.h create mode 100644 arch/avr32/include/asm/mm-arch-hooks.h create mode 100644 arch/blackfin/include/asm/mm-arch-hooks.h create mode 100644 arch/c6x/include/asm/mm-arch-hooks.h create mode 100644 arch/cris/include/asm/mm-arch-hooks.h create mode 100644 arch/frv/include/asm/mm-arch-hooks.h create mode 100644 arch/hexagon/include/asm/mm-arch-hooks.h create mode 100644 arch/ia64/include/asm/mm-arch-hooks.h create mode 100644 arch/m32r/include/asm/mm-arch-hooks.h create mode 100644 arch/m68k/include/asm/mm-arch-hooks.h create mode 100644 arch/metag/include/asm/mm-arch-hooks.h create mode 100644 arch/microblaze/include/asm/mm-arch-hooks.h create mode 100644 arch/mips/include/asm/mm-arch-hooks.h create mode 100644 arch/mn10300/include/asm/mm-arch-hooks.h create mode 100644 arch/nios2/include/asm/mm-arch-hooks.h create mode 100644 arch/openrisc/include/asm/mm-arch-hooks.h create mode 100644 arch/parisc/include/asm/mm-arch-hooks.h create mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h create mode 100644 arch/s390/include/asm/mm-arch-hooks.h create mode 100644 arch/score/include/asm/mm-arch-hooks.h create mode 100644 arch/sh/include/asm/mm-arch-hooks.h create mode 100644 arch/sparc/include/asm/mm-arch-hooks.h create mode 100644 arch/tile/include/asm/mm-arch-hooks.h create mode 100644 arch/um/include/asm/mm-arch-hooks.h create mode 100644 arch/unicore32/include/asm/mm-arch-hooks.h create mode 100644 arch/x86/include/asm/mm-arch-hooks.h create mode 100644 arch/xtensa/include/asm/mm-arch-hooks.h create mode 100644 include/linux/mm-arch-hooks.h
arch/alpha/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_ALPHA_MM_ARCH_HOOKS_H +#define _ASM_ALPHA_MM_ARCH_HOOKS_H + +#endif /* _ASM_ALPHA_MM_ARCH_HOOKS_H */
arch/arc/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_ARC_MM_ARCH_HOOKS_H +#define _ASM_ARC_MM_ARCH_HOOKS_H + +#endif /* _ASM_ARC_MM_ARCH_HOOKS_H */
arch/arm/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_ARM_MM_ARCH_HOOKS_H +#define _ASM_ARM_MM_ARCH_HOOKS_H + +#endif /* _ASM_ARM_MM_ARCH_HOOKS_H */
arch/arm64/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_ARM64_MM_ARCH_HOOKS_H +#define _ASM_ARM64_MM_ARCH_HOOKS_H + +#endif /* _ASM_ARM64_MM_ARCH_HOOKS_H */
arch/avr32/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_AVR32_MM_ARCH_HOOKS_H +#define _ASM_AVR32_MM_ARCH_HOOKS_H + +#endif /* _ASM_AVR32_MM_ARCH_HOOKS_H */
arch/blackfin/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_BLACKFIN_MM_ARCH_HOOKS_H +#define _ASM_BLACKFIN_MM_ARCH_HOOKS_H + +#endif /* _ASM_BLACKFIN_MM_ARCH_HOOKS_H */
arch/c6x/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_C6X_MM_ARCH_HOOKS_H +#define _ASM_C6X_MM_ARCH_HOOKS_H + +#endif /* _ASM_C6X_MM_ARCH_HOOKS_H */
arch/cris/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_CRIS_MM_ARCH_HOOKS_H +#define _ASM_CRIS_MM_ARCH_HOOKS_H + +#endif /* _ASM_CRIS_MM_ARCH_HOOKS_H */
arch/frv/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_FRV_MM_ARCH_HOOKS_H +#define _ASM_FRV_MM_ARCH_HOOKS_H + +#endif /* _ASM_FRV_MM_ARCH_HOOKS_H */
arch/hexagon/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_HEXAGON_MM_ARCH_HOOKS_H +#define _ASM_HEXAGON_MM_ARCH_HOOKS_H + +#endif /* _ASM_HEXAGON_MM_ARCH_HOOKS_H */
arch/ia64/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_IA64_MM_ARCH_HOOKS_H +#define _ASM_IA64_MM_ARCH_HOOKS_H + +#endif /* _ASM_IA64_MM_ARCH_HOOKS_H */
arch/m32r/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_M32R_MM_ARCH_HOOKS_H +#define _ASM_M32R_MM_ARCH_HOOKS_H + +#endif /* _ASM_M32R_MM_ARCH_HOOKS_H */
arch/m68k/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_M68K_MM_ARCH_HOOKS_H +#define _ASM_M68K_MM_ARCH_HOOKS_H + +#endif /* _ASM_M68K_MM_ARCH_HOOKS_H */
arch/metag/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_METAG_MM_ARCH_HOOKS_H +#define _ASM_METAG_MM_ARCH_HOOKS_H + +#endif /* _ASM_METAG_MM_ARCH_HOOKS_H */
arch/microblaze/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_MICROBLAZE_MM_ARCH_HOOKS_H +#define _ASM_MICROBLAZE_MM_ARCH_HOOKS_H + +#endif /* _ASM_MICROBLAZE_MM_ARCH_HOOKS_H */
arch/mips/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_MIPS_MM_ARCH_HOOKS_H +#define _ASM_MIPS_MM_ARCH_HOOKS_H + +#endif /* _ASM_MIPS_MM_ARCH_HOOKS_H */
arch/mn10300/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_MN10300_MM_ARCH_HOOKS_H +#define _ASM_MN10300_MM_ARCH_HOOKS_H + +#endif /* _ASM_MN10300_MM_ARCH_HOOKS_H */
arch/nios2/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_NIOS2_MM_ARCH_HOOKS_H +#define _ASM_NIOS2_MM_ARCH_HOOKS_H + +#endif /* _ASM_NIOS2_MM_ARCH_HOOKS_H */
arch/openrisc/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_OPENRISC_MM_ARCH_HOOKS_H +#define _ASM_OPENRISC_MM_ARCH_HOOKS_H + +#endif /* _ASM_OPENRISC_MM_ARCH_HOOKS_H */
arch/parisc/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_PARISC_MM_ARCH_HOOKS_H +#define _ASM_PARISC_MM_ARCH_HOOKS_H + +#endif /* _ASM_PARISC_MM_ARCH_HOOKS_H */
arch/powerpc/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_POWERPC_MM_ARCH_HOOKS_H +#define _ASM_POWERPC_MM_ARCH_HOOKS_H + +#endif /* _ASM_POWERPC_MM_ARCH_HOOKS_H */
arch/s390/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_S390_MM_ARCH_HOOKS_H +#define _ASM_S390_MM_ARCH_HOOKS_H + +#endif /* _ASM_S390_MM_ARCH_HOOKS_H */
arch/score/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_SCORE_MM_ARCH_HOOKS_H +#define _ASM_SCORE_MM_ARCH_HOOKS_H + +#endif /* _ASM_SCORE_MM_ARCH_HOOKS_H */
arch/sh/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_SH_MM_ARCH_HOOKS_H +#define _ASM_SH_MM_ARCH_HOOKS_H + +#endif /* _ASM_SH_MM_ARCH_HOOKS_H */
arch/sparc/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_SPARC_MM_ARCH_HOOKS_H +#define _ASM_SPARC_MM_ARCH_HOOKS_H + +#endif /* _ASM_SPARC_MM_ARCH_HOOKS_H */
arch/tile/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_TILE_MM_ARCH_HOOKS_H +#define _ASM_TILE_MM_ARCH_HOOKS_H + +#endif /* _ASM_TILE_MM_ARCH_HOOKS_H */
arch/um/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_UM_MM_ARCH_HOOKS_H +#define _ASM_UM_MM_ARCH_HOOKS_H + +#endif /* _ASM_UM_MM_ARCH_HOOKS_H */
arch/unicore32/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_UNICORE32_MM_ARCH_HOOKS_H +#define _ASM_UNICORE32_MM_ARCH_HOOKS_H + +#endif /* _ASM_UNICORE32_MM_ARCH_HOOKS_H */
arch/x86/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_X86_MM_ARCH_HOOKS_H +#define _ASM_X86_MM_ARCH_HOOKS_H + +#endif /* _ASM_X86_MM_ARCH_HOOKS_H */
arch/xtensa/include/asm/mm-arch-hooks.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Architecture specific mm hooks +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_XTENSA_MM_ARCH_HOOKS_H +#define _ASM_XTENSA_MM_ARCH_HOOKS_H + +#endif /* _ASM_XTENSA_MM_ARCH_HOOKS_H */
include/linux/mm-arch-hooks.h new file +16 -0
@@ -0,0 +1,16 @@ +/* +* Generic mm no-op hooks. +* +* Copyright (C) 2015, IBM Corporation +* Author: Laurent Dufour <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#ifndef _LINUX_MM_ARCH_HOOKS_H +#define _LINUX_MM_ARCH_HOOKS_H + +#include <asm/mm-arch-hooks.h> + +#endif /* _LINUX_MM_ARCH_HOOKS_H */
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v5 2/3 mm: New arch_remap hook
In reply to Laurent DufourSome architecture would like to be triggered when a memory area is moved through the mremap system call.
This patch is introducing a new arch_remap mm hook which is placed in the path of mremap, and is called before the old area is unmapped (and the arch_unmap hook is called).
--- include/linux/mm-arch-hooks.h | 9 +++++++++ mm/mremap.c | 17 +++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-)
include/linux/mm-arch-hooks.h +9 -0
@@ -13,4 +13,13 @@#include <asm/mm-arch-hooks.h> +#ifndef 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) +{ +} +#define arch_remap arch_remap +#endif +#endif /* _LINUX_MM_ARCH_HOOKS_H */
mm/mremap.c +11 -6
@@ -22,6 +22,7 @@#include <linux/mmu_notifier.h> #include <linux/sched/sysctl.h> #include <linux/uaccess.h> +#include <linux/mm-arch-hooks.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h>
@@ -286,13 +287,17 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_len = new_len; old_addr = new_addr; new_addr = -ENOMEM ; - }else if (vma->vm_file && vma->vm_file->f_op->mremap) { - err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); -if (err <0 ) { -move_page_tables (new_vma, new_addr, vma, old_addr, - moved_len, true); -return err; + }else { +if (vma->vm_file && vma->vm_file->f_op->mremap) { + err = vma->vm_file->f_op->mremap (vma->vm_file, new_vma); +if (err <0 ) { +move_page_tables (new_vma, new_addr, vma, + old_addr, moved_len, true); +return err; + } } +arch_remap (mm, old_addr, old_addr + old_len, + new_addr, new_addr + new_len); }/* Conceal VM_ACCOUNT so old reservation is not undone */
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v5 3/3 powerpc/mm: Tracking vDSO remap
In reply to Laurent DufourSome 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 remapping and unmapping.
--- arch/powerpc/include/asm/mm-arch-hooks.h | 13 +++++++++++++ arch/powerpc/include/asm/mmu_context.h | 23 ++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/mm-arch-hooks.h +13 -0
@@ -12,4 +12,17 @@#ifndef _ASM_POWERPC_MM_ARCH_HOOKS_H#define _ASM_POWERPC_MM_ARCH_HOOKS_H +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) +{ +/* +* mremap() doesn't allow moving multiple vmas so we can limit the +* check to old_start == vdso_base. +*/ +if (old_start == mm->context.vdso_base) + mm->context.vdso_base = new_start; +} +#define arch_remap arch_remap +#endif /* _ASM_POWERPC_MM_ARCH_HOOKS_H */
arch/powerpc/include/asm/mmu_context.h +22 -1
@@ -8,7 +8,6 @@#include <linux/spinlock.h> #include <asm/mmu.h> #include <asm/cputable.h> -#include <asm-generic/mm_hooks.h> #include <asm/cputhreads.h> /*
@@ -109,5 +108,27 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,#endif } +static inline void arch_dup_mmap (struct mm_struct *oldmm, +struct mm_struct *mm) +{ +} + +static inline void arch_exit_mmap (struct mm_struct *mm) +{ +} + +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) + mm->context.vdso_base =0 ; +} + +static inline void arch_bprm_mm_init (struct mm_struct *mm, +struct vm_area_struct *vma) +{ +} +#endif /* __KERNEL__ */ #endif /* __ASM_POWERPC_MMU_CONTEXT_H */
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH RESEND v3 2/2 powerpc/mm: Tracking vDSO remap
In reply to Laurent DufourSome 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 remapping and unmapping.
--- arch/powerpc/include/asm/mmu_context.h | 36 +++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/mmu_context.h +35 -1
@@ -8,7 +8,6 @@#include <linux/spinlock.h> #include <asm/mmu.h> #include <asm/cputable.h> -#include <asm-generic/mm_hooks.h> #include <asm/cputhreads.h> /*
@@ -109,5 +108,40 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,#endif } +static inline void arch_dup_mmap (struct mm_struct *oldmm, +struct mm_struct *mm) +{ +} + +static inline void arch_exit_mmap (struct mm_struct *mm) +{ +} + +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) + mm->context.vdso_base =0 ; +} + +static inline void arch_bprm_mm_init (struct mm_struct *mm, +struct vm_area_struct *vma) +{ +} + +#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) +{ +/* +* mremap() doesn't allow moving multiple vmas so we can limit the +* check to old_start == vdso_base. +*/ +if (old_start == mm->context.vdso_base) + mm->context.vdso_base = new_start; +} +#endif /* __KERNEL__ */ #endif /* __ASM_POWERPC_MMU_CONTEXT_H */
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>