* [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Arnd Bergmann, linux-arch, linux-kernel When Address Space Layout Randomization (ASLR, randmaps) is enabled, the address of the VDSO fluctuates from one process to the next. If Checkpoint/Restore In Userspace (CRIU) is to fully replicate the memory map of a previous process, it must be able to remap the VDSO of a new process to the address used by the previous process. Historically this has been implemented in architecture-specific code for PowerPC and x86. In order to support 32-bit and 64-bit ARM without further duplication of code, copy Laurent Dufour's implementation for PowerPC with slight modifications to a generic location. This is hopefully the beginning of a long process of VDSO code de-duplication between architectures. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- include/asm-generic/mm_hooks.h | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index cc5d9a1..73f09f1 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -1,7 +1,17 @@ /* - * Define generic no-op hooks for arch_dup_mmap, arch_exit_mmap - * and arch_unmap to be included in asm-FOO/mmu_context.h for any - * arch FOO which doesn't need to hook these. + * Define generic hooks for arch_dup_mmap, arch_exit_mmap and arch_unmap to be + * included in asm-FOO/mmu_context.h for any arch FOO which doesn't need to + * specially hook these. + * + * arch_remap originally from include/linux-mm-arch-hooks.h + * arch_unmap originally from arch/powerpc/include/asm/mmu_context.h + * Copyright (C) 2015, IBM Corporation + * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> + * + * 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_GENERIC_MM_HOOKS_H #define _ASM_GENERIC_MM_HOOKS_H @@ -19,6 +29,25 @@ static inline void arch_unmap(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long start, unsigned long end) { +#ifdef CONFIG_GENERIC_VDSO + if (start <= mm->context.vdso && mm->context.vdso < end) + mm->context.vdso = 0; +#endif /* CONFIG_GENERIC_VDSO */ +} + +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) +{ +#ifdef CONFIG_GENERIC_VDSO + /* + * mremap() doesn't allow moving multiple vmas so we can limit the + * check to old_addr == vdso. + */ + if (old_addr == mm->context.vdso) + mm->context.vdso = new_addr; + +#endif /* CONFIG_GENERIC_VDSO */ } static inline void arch_bprm_mm_init(struct mm_struct *mm, -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Arnd Bergmann, linux-arch, linux-kernel When Address Space Layout Randomization (ASLR, randmaps) is enabled, the address of the VDSO fluctuates from one process to the next. If Checkpoint/Restore In Userspace (CRIU) is to fully replicate the memory map of a previous process, it must be able to remap the VDSO of a new process to the address used by the previous process. Historically this has been implemented in architecture-specific code for PowerPC and x86. In order to support 32-bit and 64-bit ARM without further duplication of code, copy Laurent Dufour's implementation for PowerPC with slight modifications to a generic location. This is hopefully the beginning of a long process of VDSO code de-duplication between architectures. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- include/asm-generic/mm_hooks.h | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index cc5d9a1..73f09f1 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -1,7 +1,17 @@ /* - * Define generic no-op hooks for arch_dup_mmap, arch_exit_mmap - * and arch_unmap to be included in asm-FOO/mmu_context.h for any - * arch FOO which doesn't need to hook these. + * Define generic hooks for arch_dup_mmap, arch_exit_mmap and arch_unmap to be + * included in asm-FOO/mmu_context.h for any arch FOO which doesn't need to + * specially hook these. + * + * arch_remap originally from include/linux-mm-arch-hooks.h + * arch_unmap originally from arch/powerpc/include/asm/mmu_context.h + * Copyright (C) 2015, IBM Corporation + * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> + * + * 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_GENERIC_MM_HOOKS_H #define _ASM_GENERIC_MM_HOOKS_H @@ -19,6 +29,25 @@ static inline void arch_unmap(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long start, unsigned long end) { +#ifdef CONFIG_GENERIC_VDSO + if (start <= mm->context.vdso && mm->context.vdso < end) + mm->context.vdso = 0; +#endif /* CONFIG_GENERIC_VDSO */ +} + +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) +{ +#ifdef CONFIG_GENERIC_VDSO + /* + * mremap() doesn't allow moving multiple vmas so we can limit the + * check to old_addr == vdso. + */ + if (old_addr == mm->context.vdso) + mm->context.vdso = new_addr; + +#endif /* CONFIG_GENERIC_VDSO */ } static inline void arch_bprm_mm_init(struct mm_struct *mm, -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 2/7] arm: Use generic VDSO unmap and remap 2016-11-01 17:10 ` Christopher Covington (?) @ 2016-11-01 17:10 ` Christopher Covington -1 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: linux-arm-kernel Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap the VDSO to successfully checkpoint and restore applications in the face of changing VDSO addresses due to Address Space Layout Randomization (ASLR, randmaps). Previously, this was implemented in architecture-specific code for PowerPC and x86. However, a generic version based on Laurent Dufour's PowerPC implementation is now available, so begin using it on ARM. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm/mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index c1799dd..1d3312b 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -845,6 +845,7 @@ config VDSO depends on AEABI && MMU && CPU_V7 default y if ARM_ARCH_TIMER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO help Place in the process address space an ELF shared object providing fast implementations of gettimeofday and -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 2/7] arm: Use generic VDSO unmap and remap @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Russell King, linux-arm-kernel, linux-kernel Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap the VDSO to successfully checkpoint and restore applications in the face of changing VDSO addresses due to Address Space Layout Randomization (ASLR, randmaps). Previously, this was implemented in architecture-specific code for PowerPC and x86. However, a generic version based on Laurent Dufour's PowerPC implementation is now available, so begin using it on ARM. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm/mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index c1799dd..1d3312b 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -845,6 +845,7 @@ config VDSO depends on AEABI && MMU && CPU_V7 default y if ARM_ARCH_TIMER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO help Place in the process address space an ELF shared object providing fast implementations of gettimeofday and -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 2/7] arm: Use generic VDSO unmap and remap @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Russell King, linux-arm-kernel, linux-kernel Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap the VDSO to successfully checkpoint and restore applications in the face of changing VDSO addresses due to Address Space Layout Randomization (ASLR, randmaps). Previously, this was implemented in architecture-specific code for PowerPC and x86. However, a generic version based on Laurent Dufour's PowerPC implementation is now available, so begin using it on ARM. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm/mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index c1799dd..1d3312b 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -845,6 +845,7 @@ config VDSO depends on AEABI && MMU && CPU_V7 default y if ARM_ARCH_TIMER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO help Place in the process address space an ELF shared object providing fast implementations of gettimeofday and -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 2/7] arm: Use generic VDSO unmap and remap 2016-11-01 17:10 ` Christopher Covington (?) @ 2016-11-01 17:18 ` Russell King - ARM Linux -1 siblings, 0 replies; 39+ messages in thread From: Russell King - ARM Linux @ 2016-11-01 17:18 UTC (permalink / raw) To: linux-arm-kernel You know, on its own, this patch is totally meaningless. Sorry, there's nothing more I can say about this. On Tue, Nov 01, 2016 at 11:10:56AM -0600, Christopher Covington wrote: > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > the VDSO to successfully checkpoint and restore applications in the face of > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > randmaps). Previously, this was implemented in architecture-specific code > for PowerPC and x86. However, a generic version based on Laurent Dufour's > PowerPC implementation is now available, so begin using it on ARM. > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > --- > arch/arm/mm/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig > index c1799dd..1d3312b 100644 > --- a/arch/arm/mm/Kconfig > +++ b/arch/arm/mm/Kconfig > @@ -845,6 +845,7 @@ config VDSO > depends on AEABI && MMU && CPU_V7 > default y if ARM_ARCH_TIMER > select GENERIC_TIME_VSYSCALL > + select GENERIC_VDSO > help > Place in the process address space an ELF shared object > providing fast implementations of gettimeofday and > -- > Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. > Qualcomm Technologies, Inc. is a member of the > Code Aurora Forum, a Linux Foundation Collaborative Project. > -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 2/7] arm: Use generic VDSO unmap and remap @ 2016-11-01 17:18 ` Russell King - ARM Linux 0 siblings, 0 replies; 39+ messages in thread From: Russell King - ARM Linux @ 2016-11-01 17:18 UTC (permalink / raw) To: Christopher Covington Cc: criu, Will Deacon, linux-mm, Laurent Dufour, linux-arm-kernel, linux-kernel You know, on its own, this patch is totally meaningless. Sorry, there's nothing more I can say about this. On Tue, Nov 01, 2016 at 11:10:56AM -0600, Christopher Covington wrote: > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > the VDSO to successfully checkpoint and restore applications in the face of > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > randmaps). Previously, this was implemented in architecture-specific code > for PowerPC and x86. However, a generic version based on Laurent Dufour's > PowerPC implementation is now available, so begin using it on ARM. > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > --- > arch/arm/mm/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig > index c1799dd..1d3312b 100644 > --- a/arch/arm/mm/Kconfig > +++ b/arch/arm/mm/Kconfig > @@ -845,6 +845,7 @@ config VDSO > depends on AEABI && MMU && CPU_V7 > default y if ARM_ARCH_TIMER > select GENERIC_TIME_VSYSCALL > + select GENERIC_VDSO > help > Place in the process address space an ELF shared object > providing fast implementations of gettimeofday and > -- > Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. > Qualcomm Technologies, Inc. is a member of the > Code Aurora Forum, a Linux Foundation Collaborative Project. > -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 2/7] arm: Use generic VDSO unmap and remap @ 2016-11-01 17:18 ` Russell King - ARM Linux 0 siblings, 0 replies; 39+ messages in thread From: Russell King - ARM Linux @ 2016-11-01 17:18 UTC (permalink / raw) To: Christopher Covington Cc: criu, Will Deacon, linux-mm, Laurent Dufour, linux-arm-kernel, linux-kernel You know, on its own, this patch is totally meaningless. Sorry, there's nothing more I can say about this. On Tue, Nov 01, 2016 at 11:10:56AM -0600, Christopher Covington wrote: > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > the VDSO to successfully checkpoint and restore applications in the face of > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > randmaps). Previously, this was implemented in architecture-specific code > for PowerPC and x86. However, a generic version based on Laurent Dufour's > PowerPC implementation is now available, so begin using it on ARM. > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > --- > arch/arm/mm/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig > index c1799dd..1d3312b 100644 > --- a/arch/arm/mm/Kconfig > +++ b/arch/arm/mm/Kconfig > @@ -845,6 +845,7 @@ config VDSO > depends on AEABI && MMU && CPU_V7 > default y if ARM_ARCH_TIMER > select GENERIC_TIME_VSYSCALL > + select GENERIC_VDSO > help > Place in the process address space an ELF shared object > providing fast implementations of gettimeofday and > -- > Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. > Qualcomm Technologies, Inc. is a member of the > Code Aurora Forum, a Linux Foundation Collaborative Project. > -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [RFC v2 3/7] arm64: Use unsigned long for VDSO 2016-11-01 17:10 ` Christopher Covington (?) @ 2016-11-01 17:10 ` Christopher Covington -1 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: linux-arm-kernel Use an unsigned long type for the base address of the VDSO in order to be compatible with the new generic VDSO remap and unmap functions originating from PowerPC and now also used by 32-bit ARM. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm64/include/asm/mmu.h | 2 +- arch/arm64/kernel/vdso.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 8d9fce0..5b00198 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -18,7 +18,7 @@ typedef struct { atomic64_t id; - void *vdso; + unsigned long vdso; } mm_context_t; /* diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index a2c2478..4b10e72 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -97,7 +97,7 @@ int aarch32_setup_vectors_page(struct linux_binprm *bprm, int uses_interp) if (down_write_killable(&mm->mmap_sem)) return -EINTR; - current->mm->context.vdso = (void *)addr; + current->mm->context.vdso = addr; /* Map vectors page at the high address. */ ret = _install_special_mapping(mm, addr, PAGE_SIZE, @@ -178,7 +178,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, goto up_fail; vdso_base += PAGE_SIZE; - mm->context.vdso = (void *)vdso_base; + mm->context.vdso = vdso_base; ret = _install_special_mapping(mm, vdso_base, vdso_text_len, VM_READ|VM_EXEC| VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, @@ -191,7 +191,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, return 0; up_fail: - mm->context.vdso = NULL; + mm->context.vdso = 0; up_write(&mm->mmap_sem); return PTR_ERR(ret); } -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 3/7] arm64: Use unsigned long for VDSO @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Catalin Marinas, linux-arm-kernel, linux-kernel Use an unsigned long type for the base address of the VDSO in order to be compatible with the new generic VDSO remap and unmap functions originating from PowerPC and now also used by 32-bit ARM. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm64/include/asm/mmu.h | 2 +- arch/arm64/kernel/vdso.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 8d9fce0..5b00198 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -18,7 +18,7 @@ typedef struct { atomic64_t id; - void *vdso; + unsigned long vdso; } mm_context_t; /* diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index a2c2478..4b10e72 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -97,7 +97,7 @@ int aarch32_setup_vectors_page(struct linux_binprm *bprm, int uses_interp) if (down_write_killable(&mm->mmap_sem)) return -EINTR; - current->mm->context.vdso = (void *)addr; + current->mm->context.vdso = addr; /* Map vectors page at the high address. */ ret = _install_special_mapping(mm, addr, PAGE_SIZE, @@ -178,7 +178,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, goto up_fail; vdso_base += PAGE_SIZE; - mm->context.vdso = (void *)vdso_base; + mm->context.vdso = vdso_base; ret = _install_special_mapping(mm, vdso_base, vdso_text_len, VM_READ|VM_EXEC| VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, @@ -191,7 +191,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, return 0; up_fail: - mm->context.vdso = NULL; + mm->context.vdso = 0; up_write(&mm->mmap_sem); return PTR_ERR(ret); } -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 3/7] arm64: Use unsigned long for VDSO @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Catalin Marinas, linux-arm-kernel, linux-kernel Use an unsigned long type for the base address of the VDSO in order to be compatible with the new generic VDSO remap and unmap functions originating from PowerPC and now also used by 32-bit ARM. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm64/include/asm/mmu.h | 2 +- arch/arm64/kernel/vdso.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 8d9fce0..5b00198 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -18,7 +18,7 @@ typedef struct { atomic64_t id; - void *vdso; + unsigned long vdso; } mm_context_t; /* diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index a2c2478..4b10e72 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -97,7 +97,7 @@ int aarch32_setup_vectors_page(struct linux_binprm *bprm, int uses_interp) if (down_write_killable(&mm->mmap_sem)) return -EINTR; - current->mm->context.vdso = (void *)addr; + current->mm->context.vdso = addr; /* Map vectors page at the high address. */ ret = _install_special_mapping(mm, addr, PAGE_SIZE, @@ -178,7 +178,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, goto up_fail; vdso_base += PAGE_SIZE; - mm->context.vdso = (void *)vdso_base; + mm->context.vdso = vdso_base; ret = _install_special_mapping(mm, vdso_base, vdso_text_len, VM_READ|VM_EXEC| VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, @@ -191,7 +191,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, return 0; up_fail: - mm->context.vdso = NULL; + mm->context.vdso = 0; up_write(&mm->mmap_sem); return PTR_ERR(ret); } -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions 2016-11-01 17:10 ` Christopher Covington (?) @ 2016-11-01 17:10 ` Christopher Covington -1 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: linux-arm-kernel Checkpoint/Restore In Userspace (CRIU) must be able to remap and unmap the Virtual Dynamic Shared Object (VDSO) to be able to handle the changing addresses that result from address space layout randomization. Now that generic support is available and arm64 has adopted unsigned long for the type of mm->context.vdso, opt-in to VDSO unmap and remap support. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 969ef88..534df3f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -50,6 +50,7 @@ config ARM64 select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO select HANDLE_DOMAIN_IRQ select HARDIRQS_SW_RESEND select HAVE_ALIGNED_STRUCT_PAGE if SLUB -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Catalin Marinas, linux-arm-kernel, linux-kernel Checkpoint/Restore In Userspace (CRIU) must be able to remap and unmap the Virtual Dynamic Shared Object (VDSO) to be able to handle the changing addresses that result from address space layout randomization. Now that generic support is available and arm64 has adopted unsigned long for the type of mm->context.vdso, opt-in to VDSO unmap and remap support. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 969ef88..534df3f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -50,6 +50,7 @@ config ARM64 select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO select HANDLE_DOMAIN_IRQ select HARDIRQS_SW_RESEND select HAVE_ALIGNED_STRUCT_PAGE if SLUB -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Catalin Marinas, linux-arm-kernel, linux-kernel Checkpoint/Restore In Userspace (CRIU) must be able to remap and unmap the Virtual Dynamic Shared Object (VDSO) to be able to handle the changing addresses that result from address space layout randomization. Now that generic support is available and arm64 has adopted unsigned long for the type of mm->context.vdso, opt-in to VDSO unmap and remap support. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 969ef88..534df3f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -50,6 +50,7 @@ config ARM64 select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO select HANDLE_DOMAIN_IRQ select HARDIRQS_SW_RESEND select HAVE_ALIGNED_STRUCT_PAGE if SLUB -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso 2016-11-01 17:10 ` Christopher Covington @ 2016-11-01 17:10 ` Christopher Covington -1 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, linuxppc-dev, linux-kernel Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap the VDSO to successfully checkpoint and restore applications in the face of changing VDSO addresses due to Address Space Layout Randomization (ASLR, randmaps). x86 and PowerPC have had architecture-specific code to support this. In order to expand the architectures that support this without unnecessary duplication of code, a generic version based on the PowerPC code was created. It differs slightly, based on the results of an informal survey of all architectures that indicated unsigned long vdso; is popular (and it's also concise). Therefore, change the variable name in powerpc from mm->context.vdso_base to mm->context.vdso. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- arch/powerpc/include/asm/mmu-40x.h | 2 +- arch/powerpc/include/asm/mmu-44x.h | 2 +- arch/powerpc/include/asm/mmu-8xx.h | 2 +- arch/powerpc/include/asm/mmu-book3e.h | 2 +- arch/powerpc/include/asm/mmu_context.h | 4 ++-- arch/powerpc/include/asm/vdso.h | 2 +- arch/powerpc/include/uapi/asm/elf.h | 2 +- arch/powerpc/kernel/signal_32.c | 8 ++++---- arch/powerpc/kernel/signal_64.c | 4 ++-- arch/powerpc/kernel/vdso.c | 8 ++++---- arch/powerpc/perf/callchain.c | 12 ++++++------ 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/32/mmu-hash.h b/arch/powerpc/include/asm/book3s/32/mmu-hash.h index b82e063..75738bb 100644 --- a/arch/powerpc/include/asm/book3s/32/mmu-hash.h +++ b/arch/powerpc/include/asm/book3s/32/mmu-hash.h @@ -79,7 +79,7 @@ struct hash_pte { typedef struct { unsigned long id; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h index 8afb0e0..8486a10 100644 --- a/arch/powerpc/include/asm/book3s/64/mmu.h +++ b/arch/powerpc/include/asm/book3s/64/mmu.h @@ -72,7 +72,7 @@ typedef struct { #else u16 sllp; /* SLB page size encoding */ #endif - unsigned long vdso_base; + unsigned long vdso; #ifdef CONFIG_PPC_SUBPAGE_PROT struct subpage_prot_table spt; #endif /* CONFIG_PPC_SUBPAGE_PROT */ diff --git a/arch/powerpc/include/asm/mm-arch-hooks.h b/arch/powerpc/include/asm/mm-arch-hooks.h index f2a2da8..ea6da89 100644 --- a/arch/powerpc/include/asm/mm-arch-hooks.h +++ b/arch/powerpc/include/asm/mm-arch-hooks.h @@ -18,10 +18,10 @@ static inline void arch_remap(struct mm_struct *mm, { /* * mremap() doesn't allow moving multiple vmas so we can limit the - * check to old_start == vdso_base. + * check to old_start == vdso. */ - if (old_start == mm->context.vdso_base) - mm->context.vdso_base = new_start; + if (old_start == mm->context.vdso) + mm->context.vdso = new_start; } #define arch_remap arch_remap diff --git a/arch/powerpc/include/asm/mmu-40x.h b/arch/powerpc/include/asm/mmu-40x.h index 3491686..e8e57b7 100644 --- a/arch/powerpc/include/asm/mmu-40x.h +++ b/arch/powerpc/include/asm/mmu-40x.h @@ -56,7 +56,7 @@ typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h index bf52d70..471891c 100644 --- a/arch/powerpc/include/asm/mmu-44x.h +++ b/arch/powerpc/include/asm/mmu-44x.h @@ -107,7 +107,7 @@ extern unsigned int tlb_44x_index; typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h index 3e0e492..2834af0 100644 --- a/arch/powerpc/include/asm/mmu-8xx.h +++ b/arch/powerpc/include/asm/mmu-8xx.h @@ -167,7 +167,7 @@ typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #define PHYS_IMMR_BASE (mfspr(SPRN_IMMR) & 0xfff80000) diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h index b62a8d4..28dc4e0 100644 --- a/arch/powerpc/include/asm/mmu-book3e.h +++ b/arch/powerpc/include/asm/mmu-book3e.h @@ -228,7 +228,7 @@ extern unsigned int tlbcam_index; typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; #ifdef CONFIG_PPC_MM_SLICES u64 low_slices_psize; /* SLB page size encodings */ u64 high_slices_psize; /* 4 bits per slice for now */ diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 5c45114..c907478 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -146,8 +146,8 @@ 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; + if (start <= mm->context.vdso && mm->context.vdso < end) + mm->context.vdso = 0; } static inline void arch_bprm_mm_init(struct mm_struct *mm, diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h index c53f5f6..fc90971 100644 --- a/arch/powerpc/include/asm/vdso.h +++ b/arch/powerpc/include/asm/vdso.h @@ -17,7 +17,7 @@ #ifndef __ASSEMBLY__ -/* Offsets relative to thread->vdso_base */ +/* Offsets relative to mm->context.vdso */ extern unsigned long vdso64_rt_sigtramp; extern unsigned long vdso32_sigtramp; extern unsigned long vdso32_rt_sigtramp; diff --git a/arch/powerpc/include/uapi/asm/elf.h b/arch/powerpc/include/uapi/asm/elf.h index 3a9e44c..d7c81ae 100644 --- a/arch/powerpc/include/uapi/asm/elf.h +++ b/arch/powerpc/include/uapi/asm/elf.h @@ -182,7 +182,7 @@ do { \ NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ - VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base); \ + VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso); \ } while (0) /* PowerPC64 relocations defined by the ABIs */ diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 27aa913..7bb0882 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -1006,9 +1006,9 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, /* Save user registers on the stack */ frame = &rt_sf->uc.uc_mcontext; addr = frame; - if (vdso32_rt_sigtramp && tsk->mm->context.vdso_base) { + if (vdso32_rt_sigtramp && tsk->mm->context.vdso) { sigret = 0; - tramp = tsk->mm->context.vdso_base + vdso32_rt_sigtramp; + tramp = tsk->mm->context.vdso + vdso32_rt_sigtramp; } else { sigret = __NR_rt_sigreturn; tramp = (unsigned long) frame->tramp; @@ -1449,9 +1449,9 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, || __put_user(ksig->sig, &sc->signal)) goto badframe; - if (vdso32_sigtramp && tsk->mm->context.vdso_base) { + if (vdso32_sigtramp && tsk->mm->context.vdso) { sigret = 0; - tramp = tsk->mm->context.vdso_base + vdso32_sigtramp; + tramp = tsk->mm->context.vdso + vdso32_sigtramp; } else { sigret = __NR_sigreturn; tramp = (unsigned long) frame->mctx.tramp; diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 96698fd..608a919 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -791,8 +791,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->link = tsk->mm->context.vdso_base + vdso64_rt_sigtramp; + if (vdso64_rt_sigtramp && tsk->mm->context.vdso) { + regs->link = 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 4111d30..33ea0f8 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -180,7 +180,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) vdso_base = VDSO32_MBASE; #endif - current->mm->context.vdso_base = 0; + current->mm->context.vdso = 0; /* vDSO has a problem and was disabled, just don't "enable" it for the * process @@ -215,7 +215,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) * install_special_mapping or the perf counter mmap tracking code * will fail to recognise it as a vDSO (since arch_vma_name fails). */ - current->mm->context.vdso_base = vdso_base; + current->mm->context.vdso = vdso_base; /* * our vma flags don't have VM_WRITE so by default, the process isn't @@ -232,7 +232,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, vdso_pagelist); if (rc) { - current->mm->context.vdso_base = 0; + current->mm->context.vdso = 0; goto fail_mmapsem; } @@ -246,7 +246,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) const char *arch_vma_name(struct vm_area_struct *vma) { - if (vma->vm_mm && vma->vm_start == vma->vm_mm->context.vdso_base) + if (vma->vm_mm && vma->vm_start == vma->vm_mm->context.vdso) return "[vdso]"; return NULL; } diff --git a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c index 0fc2671..5c893a2 100644 --- a/arch/powerpc/perf/callchain.c +++ b/arch/powerpc/perf/callchain.c @@ -209,8 +209,8 @@ static int is_sigreturn_64_address(unsigned long nip, unsigned long fp) { if (nip == fp + offsetof(struct signal_frame_64, tramp)) return 1; - if (vdso64_rt_sigtramp && current->mm->context.vdso_base && - nip == current->mm->context.vdso_base + vdso64_rt_sigtramp) + if (vdso64_rt_sigtramp && current->mm->context.vdso && + nip == current->mm->context.vdso + vdso64_rt_sigtramp) return 1; return 0; } @@ -368,8 +368,8 @@ static int is_sigreturn_32_address(unsigned int nip, unsigned int fp) { if (nip == fp + offsetof(struct signal_frame_32, mctx.mc_pad)) return 1; - if (vdso32_sigtramp && current->mm->context.vdso_base && - nip == current->mm->context.vdso_base + vdso32_sigtramp) + if (vdso32_sigtramp && current->mm->context.vdso && + nip == current->mm->context.vdso + vdso32_sigtramp) return 1; return 0; } @@ -379,8 +379,8 @@ static int is_rt_sigreturn_32_address(unsigned int nip, unsigned int fp) if (nip == fp + offsetof(struct rt_signal_frame_32, uc.uc_mcontext.mc_pad)) return 1; - if (vdso32_rt_sigtramp && current->mm->context.vdso_base && - nip == current->mm->context.vdso_base + vdso32_rt_sigtramp) + if (vdso32_rt_sigtramp && current->mm->context.vdso && + nip == current->mm->context.vdso + vdso32_rt_sigtramp) return 1; return 0; } -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso @ 2016-11-01 17:10 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, linuxppc-dev, linux-kernel Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap the VDSO to successfully checkpoint and restore applications in the face of changing VDSO addresses due to Address Space Layout Randomization (ASLR, randmaps). x86 and PowerPC have had architecture-specific code to support this. In order to expand the architectures that support this without unnecessary duplication of code, a generic version based on the PowerPC code was created. It differs slightly, based on the results of an informal survey of all architectures that indicated unsigned long vdso; is popular (and it's also concise). Therefore, change the variable name in powerpc from mm->context.vdso_base to mm->context.vdso. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- arch/powerpc/include/asm/mmu-40x.h | 2 +- arch/powerpc/include/asm/mmu-44x.h | 2 +- arch/powerpc/include/asm/mmu-8xx.h | 2 +- arch/powerpc/include/asm/mmu-book3e.h | 2 +- arch/powerpc/include/asm/mmu_context.h | 4 ++-- arch/powerpc/include/asm/vdso.h | 2 +- arch/powerpc/include/uapi/asm/elf.h | 2 +- arch/powerpc/kernel/signal_32.c | 8 ++++---- arch/powerpc/kernel/signal_64.c | 4 ++-- arch/powerpc/kernel/vdso.c | 8 ++++---- arch/powerpc/perf/callchain.c | 12 ++++++------ 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/32/mmu-hash.h b/arch/powerpc/include/asm/book3s/32/mmu-hash.h index b82e063..75738bb 100644 --- a/arch/powerpc/include/asm/book3s/32/mmu-hash.h +++ b/arch/powerpc/include/asm/book3s/32/mmu-hash.h @@ -79,7 +79,7 @@ struct hash_pte { typedef struct { unsigned long id; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h index 8afb0e0..8486a10 100644 --- a/arch/powerpc/include/asm/book3s/64/mmu.h +++ b/arch/powerpc/include/asm/book3s/64/mmu.h @@ -72,7 +72,7 @@ typedef struct { #else u16 sllp; /* SLB page size encoding */ #endif - unsigned long vdso_base; + unsigned long vdso; #ifdef CONFIG_PPC_SUBPAGE_PROT struct subpage_prot_table spt; #endif /* CONFIG_PPC_SUBPAGE_PROT */ diff --git a/arch/powerpc/include/asm/mm-arch-hooks.h b/arch/powerpc/include/asm/mm-arch-hooks.h index f2a2da8..ea6da89 100644 --- a/arch/powerpc/include/asm/mm-arch-hooks.h +++ b/arch/powerpc/include/asm/mm-arch-hooks.h @@ -18,10 +18,10 @@ static inline void arch_remap(struct mm_struct *mm, { /* * mremap() doesn't allow moving multiple vmas so we can limit the - * check to old_start == vdso_base. + * check to old_start == vdso. */ - if (old_start == mm->context.vdso_base) - mm->context.vdso_base = new_start; + if (old_start == mm->context.vdso) + mm->context.vdso = new_start; } #define arch_remap arch_remap diff --git a/arch/powerpc/include/asm/mmu-40x.h b/arch/powerpc/include/asm/mmu-40x.h index 3491686..e8e57b7 100644 --- a/arch/powerpc/include/asm/mmu-40x.h +++ b/arch/powerpc/include/asm/mmu-40x.h @@ -56,7 +56,7 @@ typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h index bf52d70..471891c 100644 --- a/arch/powerpc/include/asm/mmu-44x.h +++ b/arch/powerpc/include/asm/mmu-44x.h @@ -107,7 +107,7 @@ extern unsigned int tlb_44x_index; typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h index 3e0e492..2834af0 100644 --- a/arch/powerpc/include/asm/mmu-8xx.h +++ b/arch/powerpc/include/asm/mmu-8xx.h @@ -167,7 +167,7 @@ typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; } mm_context_t; #define PHYS_IMMR_BASE (mfspr(SPRN_IMMR) & 0xfff80000) diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h index b62a8d4..28dc4e0 100644 --- a/arch/powerpc/include/asm/mmu-book3e.h +++ b/arch/powerpc/include/asm/mmu-book3e.h @@ -228,7 +228,7 @@ extern unsigned int tlbcam_index; typedef struct { unsigned int id; unsigned int active; - unsigned long vdso_base; + unsigned long vdso; #ifdef CONFIG_PPC_MM_SLICES u64 low_slices_psize; /* SLB page size encodings */ u64 high_slices_psize; /* 4 bits per slice for now */ diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 5c45114..c907478 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -146,8 +146,8 @@ 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; + if (start <= mm->context.vdso && mm->context.vdso < end) + mm->context.vdso = 0; } static inline void arch_bprm_mm_init(struct mm_struct *mm, diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h index c53f5f6..fc90971 100644 --- a/arch/powerpc/include/asm/vdso.h +++ b/arch/powerpc/include/asm/vdso.h @@ -17,7 +17,7 @@ #ifndef __ASSEMBLY__ -/* Offsets relative to thread->vdso_base */ +/* Offsets relative to mm->context.vdso */ extern unsigned long vdso64_rt_sigtramp; extern unsigned long vdso32_sigtramp; extern unsigned long vdso32_rt_sigtramp; diff --git a/arch/powerpc/include/uapi/asm/elf.h b/arch/powerpc/include/uapi/asm/elf.h index 3a9e44c..d7c81ae 100644 --- a/arch/powerpc/include/uapi/asm/elf.h +++ b/arch/powerpc/include/uapi/asm/elf.h @@ -182,7 +182,7 @@ do { \ NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ - VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base); \ + VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso); \ } while (0) /* PowerPC64 relocations defined by the ABIs */ diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 27aa913..7bb0882 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -1006,9 +1006,9 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, /* Save user registers on the stack */ frame = &rt_sf->uc.uc_mcontext; addr = frame; - if (vdso32_rt_sigtramp && tsk->mm->context.vdso_base) { + if (vdso32_rt_sigtramp && tsk->mm->context.vdso) { sigret = 0; - tramp = tsk->mm->context.vdso_base + vdso32_rt_sigtramp; + tramp = tsk->mm->context.vdso + vdso32_rt_sigtramp; } else { sigret = __NR_rt_sigreturn; tramp = (unsigned long) frame->tramp; @@ -1449,9 +1449,9 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, || __put_user(ksig->sig, &sc->signal)) goto badframe; - if (vdso32_sigtramp && tsk->mm->context.vdso_base) { + if (vdso32_sigtramp && tsk->mm->context.vdso) { sigret = 0; - tramp = tsk->mm->context.vdso_base + vdso32_sigtramp; + tramp = tsk->mm->context.vdso + vdso32_sigtramp; } else { sigret = __NR_sigreturn; tramp = (unsigned long) frame->mctx.tramp; diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 96698fd..608a919 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -791,8 +791,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->link = tsk->mm->context.vdso_base + vdso64_rt_sigtramp; + if (vdso64_rt_sigtramp && tsk->mm->context.vdso) { + regs->link = 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 4111d30..33ea0f8 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -180,7 +180,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) vdso_base = VDSO32_MBASE; #endif - current->mm->context.vdso_base = 0; + current->mm->context.vdso = 0; /* vDSO has a problem and was disabled, just don't "enable" it for the * process @@ -215,7 +215,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) * install_special_mapping or the perf counter mmap tracking code * will fail to recognise it as a vDSO (since arch_vma_name fails). */ - current->mm->context.vdso_base = vdso_base; + current->mm->context.vdso = vdso_base; /* * our vma flags don't have VM_WRITE so by default, the process isn't @@ -232,7 +232,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, vdso_pagelist); if (rc) { - current->mm->context.vdso_base = 0; + current->mm->context.vdso = 0; goto fail_mmapsem; } @@ -246,7 +246,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) const char *arch_vma_name(struct vm_area_struct *vma) { - if (vma->vm_mm && vma->vm_start == vma->vm_mm->context.vdso_base) + if (vma->vm_mm && vma->vm_start == vma->vm_mm->context.vdso) return "[vdso]"; return NULL; } diff --git a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c index 0fc2671..5c893a2 100644 --- a/arch/powerpc/perf/callchain.c +++ b/arch/powerpc/perf/callchain.c @@ -209,8 +209,8 @@ static int is_sigreturn_64_address(unsigned long nip, unsigned long fp) { if (nip == fp + offsetof(struct signal_frame_64, tramp)) return 1; - if (vdso64_rt_sigtramp && current->mm->context.vdso_base && - nip == current->mm->context.vdso_base + vdso64_rt_sigtramp) + if (vdso64_rt_sigtramp && current->mm->context.vdso && + nip == current->mm->context.vdso + vdso64_rt_sigtramp) return 1; return 0; } @@ -368,8 +368,8 @@ static int is_sigreturn_32_address(unsigned int nip, unsigned int fp) { if (nip == fp + offsetof(struct signal_frame_32, mctx.mc_pad)) return 1; - if (vdso32_sigtramp && current->mm->context.vdso_base && - nip == current->mm->context.vdso_base + vdso32_sigtramp) + if (vdso32_sigtramp && current->mm->context.vdso && + nip == current->mm->context.vdso + vdso32_sigtramp) return 1; return 0; } @@ -379,8 +379,8 @@ static int is_rt_sigreturn_32_address(unsigned int nip, unsigned int fp) if (nip == fp + offsetof(struct rt_signal_frame_32, uc.uc_mcontext.mc_pad)) return 1; - if (vdso32_rt_sigtramp && current->mm->context.vdso_base && - nip == current->mm->context.vdso_base + vdso32_rt_sigtramp) + if (vdso32_rt_sigtramp && current->mm->context.vdso && + nip == current->mm->context.vdso + vdso32_rt_sigtramp) return 1; return 0; } -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso 2016-11-01 17:10 ` Christopher Covington @ 2016-11-04 4:58 ` Michael Ellerman -1 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-04 4:58 UTC (permalink / raw) To: Christopher Covington, criu, Will Deacon, linux-mm, Laurent Dufour, akpm Cc: Christopher Covington, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Christopher Covington <cov@codeaurora.org> writes: > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > the VDSO to successfully checkpoint and restore applications in the face of > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > randmaps). x86 and PowerPC have had architecture-specific code to support > this. In order to expand the architectures that support this without > unnecessary duplication of code, a generic version based on the PowerPC code > was created. It differs slightly, based on the results of an informal > survey of all architectures that indicated > > unsigned long vdso; > > is popular (and it's also concise). Therefore, change the variable name in > powerpc from mm->context.vdso_base to mm->context.vdso. > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > --- > arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- > arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- > arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- > arch/powerpc/include/asm/mmu-40x.h | 2 +- > arch/powerpc/include/asm/mmu-44x.h | 2 +- > arch/powerpc/include/asm/mmu-8xx.h | 2 +- > arch/powerpc/include/asm/mmu-book3e.h | 2 +- > arch/powerpc/include/asm/mmu_context.h | 4 ++-- > arch/powerpc/include/asm/vdso.h | 2 +- > arch/powerpc/include/uapi/asm/elf.h | 2 +- > arch/powerpc/kernel/signal_32.c | 8 ++++---- > arch/powerpc/kernel/signal_64.c | 4 ++-- > arch/powerpc/kernel/vdso.c | 8 ++++---- > arch/powerpc/perf/callchain.c | 12 ++++++------ > 14 files changed, 29 insertions(+), 29 deletions(-) This is kind of annoying, but I guess it's worth doing. It's going to conflict like hell though. Who were you thinking would merge this series? I think it should go via Andrew Morton's tree, as that way if we get bad conflicts we can pull it out and redo it. Assuming we agree on that I'm happy to ack it: Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) cheers ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso @ 2016-11-04 4:58 ` Michael Ellerman 0 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-04 4:58 UTC (permalink / raw) To: Christopher Covington, criu, Will Deacon, linux-mm, Laurent Dufour, akpm Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Christopher Covington <cov@codeaurora.org> writes: > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > the VDSO to successfully checkpoint and restore applications in the face of > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > randmaps). x86 and PowerPC have had architecture-specific code to support > this. In order to expand the architectures that support this without > unnecessary duplication of code, a generic version based on the PowerPC code > was created. It differs slightly, based on the results of an informal > survey of all architectures that indicated > > unsigned long vdso; > > is popular (and it's also concise). Therefore, change the variable name in > powerpc from mm->context.vdso_base to mm->context.vdso. > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > --- > arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- > arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- > arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- > arch/powerpc/include/asm/mmu-40x.h | 2 +- > arch/powerpc/include/asm/mmu-44x.h | 2 +- > arch/powerpc/include/asm/mmu-8xx.h | 2 +- > arch/powerpc/include/asm/mmu-book3e.h | 2 +- > arch/powerpc/include/asm/mmu_context.h | 4 ++-- > arch/powerpc/include/asm/vdso.h | 2 +- > arch/powerpc/include/uapi/asm/elf.h | 2 +- > arch/powerpc/kernel/signal_32.c | 8 ++++---- > arch/powerpc/kernel/signal_64.c | 4 ++-- > arch/powerpc/kernel/vdso.c | 8 ++++---- > arch/powerpc/perf/callchain.c | 12 ++++++------ > 14 files changed, 29 insertions(+), 29 deletions(-) This is kind of annoying, but I guess it's worth doing. It's going to conflict like hell though. Who were you thinking would merge this series? I think it should go via Andrew Morton's tree, as that way if we get bad conflicts we can pull it out and redo it. Assuming we agree on that I'm happy to ack it: Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) cheers -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso 2016-11-04 4:58 ` Michael Ellerman @ 2016-11-04 20:13 ` Will Deacon -1 siblings, 0 replies; 39+ messages in thread From: Will Deacon @ 2016-11-04 20:13 UTC (permalink / raw) To: Michael Ellerman Cc: Christopher Covington, criu, linux-mm, Laurent Dufour, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel [fixing akpm's email address] On Fri, Nov 04, 2016 at 03:58:22PM +1100, Michael Ellerman wrote: > Christopher Covington <cov@codeaurora.org> writes: > > > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > > the VDSO to successfully checkpoint and restore applications in the face of > > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > > randmaps). x86 and PowerPC have had architecture-specific code to support > > this. In order to expand the architectures that support this without > > unnecessary duplication of code, a generic version based on the PowerPC code > > was created. It differs slightly, based on the results of an informal > > survey of all architectures that indicated > > > > unsigned long vdso; > > > > is popular (and it's also concise). Therefore, change the variable name in > > powerpc from mm->context.vdso_base to mm->context.vdso. > > > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > > --- > > arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- > > arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- > > arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- > > arch/powerpc/include/asm/mmu-40x.h | 2 +- > > arch/powerpc/include/asm/mmu-44x.h | 2 +- > > arch/powerpc/include/asm/mmu-8xx.h | 2 +- > > arch/powerpc/include/asm/mmu-book3e.h | 2 +- > > arch/powerpc/include/asm/mmu_context.h | 4 ++-- > > arch/powerpc/include/asm/vdso.h | 2 +- > > arch/powerpc/include/uapi/asm/elf.h | 2 +- > > arch/powerpc/kernel/signal_32.c | 8 ++++---- > > arch/powerpc/kernel/signal_64.c | 4 ++-- > > arch/powerpc/kernel/vdso.c | 8 ++++---- > > arch/powerpc/perf/callchain.c | 12 ++++++------ > > 14 files changed, 29 insertions(+), 29 deletions(-) > > This is kind of annoying, but I guess it's worth doing. > > It's going to conflict like hell though. Who were you thinking would > merge this series? I think it should go via Andrew Morton's tree, as > that way if we get bad conflicts we can pull it out and redo it. The other thing you can do is generate the patch towards the end of the merge window and send it as a separate pull request. The disadvantage of that is that it can't spend any time in -next, but that might be ok for a mechanical rename. Will ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso @ 2016-11-04 20:13 ` Will Deacon 0 siblings, 0 replies; 39+ messages in thread From: Will Deacon @ 2016-11-04 20:13 UTC (permalink / raw) To: Michael Ellerman Cc: Christopher Covington, criu, linux-mm, Laurent Dufour, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel [fixing akpm's email address] On Fri, Nov 04, 2016 at 03:58:22PM +1100, Michael Ellerman wrote: > Christopher Covington <cov@codeaurora.org> writes: > > > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > > the VDSO to successfully checkpoint and restore applications in the face of > > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > > randmaps). x86 and PowerPC have had architecture-specific code to support > > this. In order to expand the architectures that support this without > > unnecessary duplication of code, a generic version based on the PowerPC code > > was created. It differs slightly, based on the results of an informal > > survey of all architectures that indicated > > > > unsigned long vdso; > > > > is popular (and it's also concise). Therefore, change the variable name in > > powerpc from mm->context.vdso_base to mm->context.vdso. > > > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > > --- > > arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- > > arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- > > arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- > > arch/powerpc/include/asm/mmu-40x.h | 2 +- > > arch/powerpc/include/asm/mmu-44x.h | 2 +- > > arch/powerpc/include/asm/mmu-8xx.h | 2 +- > > arch/powerpc/include/asm/mmu-book3e.h | 2 +- > > arch/powerpc/include/asm/mmu_context.h | 4 ++-- > > arch/powerpc/include/asm/vdso.h | 2 +- > > arch/powerpc/include/uapi/asm/elf.h | 2 +- > > arch/powerpc/kernel/signal_32.c | 8 ++++---- > > arch/powerpc/kernel/signal_64.c | 4 ++-- > > arch/powerpc/kernel/vdso.c | 8 ++++---- > > arch/powerpc/perf/callchain.c | 12 ++++++------ > > 14 files changed, 29 insertions(+), 29 deletions(-) > > This is kind of annoying, but I guess it's worth doing. > > It's going to conflict like hell though. Who were you thinking would > merge this series? I think it should go via Andrew Morton's tree, as > that way if we get bad conflicts we can pull it out and redo it. The other thing you can do is generate the patch towards the end of the merge window and send it as a separate pull request. The disadvantage of that is that it can't spend any time in -next, but that might be ok for a mechanical rename. Will -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso 2016-11-04 20:13 ` Will Deacon @ 2016-11-07 8:01 ` Michael Ellerman -1 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-07 8:01 UTC (permalink / raw) To: Will Deacon Cc: Christopher Covington, criu, linux-mm, Laurent Dufour, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Will Deacon <will.deacon@arm.com> writes: > On Fri, Nov 04, 2016 at 03:58:22PM +1100, Michael Ellerman wrote: >> Christopher Covington <cov@codeaurora.org> writes: >> > arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- >> > arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- >> > arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- >> > arch/powerpc/include/asm/mmu-40x.h | 2 +- >> > arch/powerpc/include/asm/mmu-44x.h | 2 +- >> > arch/powerpc/include/asm/mmu-8xx.h | 2 +- >> > arch/powerpc/include/asm/mmu-book3e.h | 2 +- >> > arch/powerpc/include/asm/mmu_context.h | 4 ++-- >> > arch/powerpc/include/asm/vdso.h | 2 +- >> > arch/powerpc/include/uapi/asm/elf.h | 2 +- >> > arch/powerpc/kernel/signal_32.c | 8 ++++---- >> > arch/powerpc/kernel/signal_64.c | 4 ++-- >> > arch/powerpc/kernel/vdso.c | 8 ++++---- >> > arch/powerpc/perf/callchain.c | 12 ++++++------ >> > 14 files changed, 29 insertions(+), 29 deletions(-) >> >> This is kind of annoying, but I guess it's worth doing. >> >> It's going to conflict like hell though. Who were you thinking would >> merge this series? I think it should go via Andrew Morton's tree, as >> that way if we get bad conflicts we can pull it out and redo it. > > The other thing you can do is generate the patch towards the end of the > merge window and send it as a separate pull request. The disadvantage of > that is that it can't spend any time in -next, but that might be ok for a > mechanical rename. True. Though in this case it's a mechanical rename that then allows us to use the generic code, so I'd prefer we had some -next coverage on the latter. The other other option would be to wrap all uses of the arch value in a macro (or actually two probably, one a getter one a setter). That would then allow arches to use the generic code regardless of the name and type of their mm->context.vdso_whatever. That would allow the basic series to go in, and then each arch could do a series later that switches it to the "standard" name and type. cheers ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso @ 2016-11-07 8:01 ` Michael Ellerman 0 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-07 8:01 UTC (permalink / raw) To: Will Deacon Cc: Christopher Covington, criu, linux-mm, Laurent Dufour, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Will Deacon <will.deacon@arm.com> writes: > On Fri, Nov 04, 2016 at 03:58:22PM +1100, Michael Ellerman wrote: >> Christopher Covington <cov@codeaurora.org> writes: >> > arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 +- >> > arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- >> > arch/powerpc/include/asm/mm-arch-hooks.h | 6 +++--- >> > arch/powerpc/include/asm/mmu-40x.h | 2 +- >> > arch/powerpc/include/asm/mmu-44x.h | 2 +- >> > arch/powerpc/include/asm/mmu-8xx.h | 2 +- >> > arch/powerpc/include/asm/mmu-book3e.h | 2 +- >> > arch/powerpc/include/asm/mmu_context.h | 4 ++-- >> > arch/powerpc/include/asm/vdso.h | 2 +- >> > arch/powerpc/include/uapi/asm/elf.h | 2 +- >> > arch/powerpc/kernel/signal_32.c | 8 ++++---- >> > arch/powerpc/kernel/signal_64.c | 4 ++-- >> > arch/powerpc/kernel/vdso.c | 8 ++++---- >> > arch/powerpc/perf/callchain.c | 12 ++++++------ >> > 14 files changed, 29 insertions(+), 29 deletions(-) >> >> This is kind of annoying, but I guess it's worth doing. >> >> It's going to conflict like hell though. Who were you thinking would >> merge this series? I think it should go via Andrew Morton's tree, as >> that way if we get bad conflicts we can pull it out and redo it. > > The other thing you can do is generate the patch towards the end of the > merge window and send it as a separate pull request. The disadvantage of > that is that it can't spend any time in -next, but that might be ok for a > mechanical rename. True. Though in this case it's a mechanical rename that then allows us to use the generic code, so I'd prefer we had some -next coverage on the latter. The other other option would be to wrap all uses of the arch value in a macro (or actually two probably, one a getter one a setter). That would then allow arches to use the generic code regardless of the name and type of their mm->context.vdso_whatever. That would allow the basic series to go in, and then each arch could do a series later that switches it to the "standard" name and type. cheers -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions 2016-11-01 17:10 ` Christopher Covington @ 2016-11-01 17:11 ` Christopher Covington -1 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:11 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, linuxppc-dev, linux-kernel The PowerPC VDSO remap and unmap code was copied to a generic location, only modifying the variable name expected in mm->context (vdso instead of vdso_base) to match most other architectures. Having adopted this generic naming, drop the code in arch/powerpc and use the generic version. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/Kbuild | 1 + arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- 4 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 65fba4c..f4a1cb9 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -134,6 +134,7 @@ config PPC select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER + select GENERIC_VDSO select HAVE_MOD_ARCH_SPECIFIC select MODULES_USE_ELF_RELA select CLONE_BACKWARDS diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild index 5c4fbc8..4d89ec6 100644 --- a/arch/powerpc/include/asm/Kbuild +++ b/arch/powerpc/include/asm/Kbuild @@ -8,3 +8,4 @@ generic-y += mcs_spinlock.h generic-y += preempt.h generic-y += rwsem.h generic-y += vtime.h +generic-y += mm-arch-hooks.h diff --git a/arch/powerpc/include/asm/mm-arch-hooks.h b/arch/powerpc/include/asm/mm-arch-hooks.h deleted file mode 100644 index ea6da89..0000000 --- a/arch/powerpc/include/asm/mm-arch-hooks.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Architecture specific mm hooks - * - * Copyright (C) 2015, IBM Corporation - * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> - * - * 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 - -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. - */ - if (old_start == mm->context.vdso) - mm->context.vdso = new_start; -} -#define arch_remap arch_remap - -#endif /* _ASM_POWERPC_MM_ARCH_HOOKS_H */ diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index c907478..d8dcf45 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -8,6 +8,7 @@ #include <linux/spinlock.h> #include <asm/mmu.h> #include <asm/cputable.h> +#include <asm-generic/mm_hooks.h> #include <asm/cputhreads.h> /* @@ -133,39 +134,5 @@ 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 && mm->context.vdso < end) - mm->context.vdso = 0; -} - -static inline void arch_bprm_mm_init(struct mm_struct *mm, - struct vm_area_struct *vma) -{ -} - -static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, - bool write, bool execute, bool foreign) -{ - /* by default, allow everything */ - return true; -} - -static inline bool arch_pte_access_permitted(pte_t pte, bool write) -{ - /* by default, allow everything */ - return true; -} #endif /* __KERNEL__ */ #endif /* __ASM_POWERPC_MMU_CONTEXT_H */ -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions @ 2016-11-01 17:11 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:11 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, linuxppc-dev, linux-kernel The PowerPC VDSO remap and unmap code was copied to a generic location, only modifying the variable name expected in mm->context (vdso instead of vdso_base) to match most other architectures. Having adopted this generic naming, drop the code in arch/powerpc and use the generic version. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/Kbuild | 1 + arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- 4 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 65fba4c..f4a1cb9 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -134,6 +134,7 @@ config PPC select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER + select GENERIC_VDSO select HAVE_MOD_ARCH_SPECIFIC select MODULES_USE_ELF_RELA select CLONE_BACKWARDS diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild index 5c4fbc8..4d89ec6 100644 --- a/arch/powerpc/include/asm/Kbuild +++ b/arch/powerpc/include/asm/Kbuild @@ -8,3 +8,4 @@ generic-y += mcs_spinlock.h generic-y += preempt.h generic-y += rwsem.h generic-y += vtime.h +generic-y += mm-arch-hooks.h diff --git a/arch/powerpc/include/asm/mm-arch-hooks.h b/arch/powerpc/include/asm/mm-arch-hooks.h deleted file mode 100644 index ea6da89..0000000 --- a/arch/powerpc/include/asm/mm-arch-hooks.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Architecture specific mm hooks - * - * Copyright (C) 2015, IBM Corporation - * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> - * - * 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 - -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. - */ - if (old_start == mm->context.vdso) - mm->context.vdso = new_start; -} -#define arch_remap arch_remap - -#endif /* _ASM_POWERPC_MM_ARCH_HOOKS_H */ diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index c907478..d8dcf45 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -8,6 +8,7 @@ #include <linux/spinlock.h> #include <asm/mmu.h> #include <asm/cputable.h> +#include <asm-generic/mm_hooks.h> #include <asm/cputhreads.h> /* @@ -133,39 +134,5 @@ 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 && mm->context.vdso < end) - mm->context.vdso = 0; -} - -static inline void arch_bprm_mm_init(struct mm_struct *mm, - struct vm_area_struct *vma) -{ -} - -static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, - bool write, bool execute, bool foreign) -{ - /* by default, allow everything */ - return true; -} - -static inline bool arch_pte_access_permitted(pte_t pte, bool write) -{ - /* by default, allow everything */ - return true; -} #endif /* __KERNEL__ */ #endif /* __ASM_POWERPC_MMU_CONTEXT_H */ -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions 2016-11-01 17:11 ` Christopher Covington @ 2016-11-04 4:59 ` Michael Ellerman -1 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-04 4:59 UTC (permalink / raw) To: Christopher Covington, criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Christopher Covington <cov@codeaurora.org> writes: > The PowerPC VDSO remap and unmap code was copied to a generic location, > only modifying the variable name expected in mm->context (vdso instead of > vdso_base) to match most other architectures. Having adopted this generic > naming, drop the code in arch/powerpc and use the generic version. > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/include/asm/Kbuild | 1 + > arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- > arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- > 4 files changed, 3 insertions(+), 62 deletions(-) > delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h This looks OK. Have you tested it on powerpc? I could but I don't know how to actually trigger these paths, I assume I need a CRIU setup? Can you flip the subject to "powerpc/mm: ...". cheers ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions @ 2016-11-04 4:59 ` Michael Ellerman 0 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-04 4:59 UTC (permalink / raw) To: Christopher Covington, criu, Will Deacon, linux-mm, Laurent Dufour Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Christopher Covington <cov@codeaurora.org> writes: > The PowerPC VDSO remap and unmap code was copied to a generic location, > only modifying the variable name expected in mm->context (vdso instead of > vdso_base) to match most other architectures. Having adopted this generic > naming, drop the code in arch/powerpc and use the generic version. > > Signed-off-by: Christopher Covington <cov@codeaurora.org> > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/include/asm/Kbuild | 1 + > arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- > arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- > 4 files changed, 3 insertions(+), 62 deletions(-) > delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h This looks OK. Have you tested it on powerpc? I could but I don't know how to actually trigger these paths, I assume I need a CRIU setup? Can you flip the subject to "powerpc/mm: ...". cheers -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions 2016-11-04 4:59 ` Michael Ellerman @ 2016-11-07 20:20 ` Laurent Dufour -1 siblings, 0 replies; 39+ messages in thread From: Laurent Dufour @ 2016-11-07 20:20 UTC (permalink / raw) To: Michael Ellerman, Christopher Covington, criu, Will Deacon, linux-mm Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel On 04/11/2016 05:59, Michael Ellerman wrote: > Christopher Covington <cov@codeaurora.org> writes: > >> The PowerPC VDSO remap and unmap code was copied to a generic location, >> only modifying the variable name expected in mm->context (vdso instead of >> vdso_base) to match most other architectures. Having adopted this generic >> naming, drop the code in arch/powerpc and use the generic version. >> >> Signed-off-by: Christopher Covington <cov@codeaurora.org> >> --- >> arch/powerpc/Kconfig | 1 + >> arch/powerpc/include/asm/Kbuild | 1 + >> arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- >> arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- >> 4 files changed, 3 insertions(+), 62 deletions(-) >> delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h > > This looks OK. > > Have you tested it on powerpc? I could but I don't know how to actually > trigger these paths, I assume I need a CRIU setup? FWIW, tested on ppc64le using a sample test process moving its VDSO and then catching a signal on 4.9-rc4 and using CRIU on top of 4.8 with sightly changes to due minor upstream changes. Reviewed-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Tested-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions @ 2016-11-07 20:20 ` Laurent Dufour 0 siblings, 0 replies; 39+ messages in thread From: Laurent Dufour @ 2016-11-07 20:20 UTC (permalink / raw) To: Michael Ellerman, Christopher Covington, criu, Will Deacon, linux-mm Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel On 04/11/2016 05:59, Michael Ellerman wrote: > Christopher Covington <cov@codeaurora.org> writes: > >> The PowerPC VDSO remap and unmap code was copied to a generic location, >> only modifying the variable name expected in mm->context (vdso instead of >> vdso_base) to match most other architectures. Having adopted this generic >> naming, drop the code in arch/powerpc and use the generic version. >> >> Signed-off-by: Christopher Covington <cov@codeaurora.org> >> --- >> arch/powerpc/Kconfig | 1 + >> arch/powerpc/include/asm/Kbuild | 1 + >> arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- >> arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- >> 4 files changed, 3 insertions(+), 62 deletions(-) >> delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h > > This looks OK. > > Have you tested it on powerpc? I could but I don't know how to actually > trigger these paths, I assume I need a CRIU setup? FWIW, tested on ppc64le using a sample test process moving its VDSO and then catching a signal on 4.9-rc4 and using CRIU on top of 4.8 with sightly changes to due minor upstream changes. Reviewed-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Tested-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions 2016-11-07 20:20 ` Laurent Dufour @ 2016-11-07 23:51 ` Michael Ellerman -1 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-07 23:51 UTC (permalink / raw) To: Laurent Dufour, Christopher Covington, criu, Will Deacon, linux-mm Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Laurent Dufour <ldufour@linux.vnet.ibm.com> writes: > On 04/11/2016 05:59, Michael Ellerman wrote: >> Christopher Covington <cov@codeaurora.org> writes: >> >>> The PowerPC VDSO remap and unmap code was copied to a generic location, >>> only modifying the variable name expected in mm->context (vdso instead of >>> vdso_base) to match most other architectures. Having adopted this generic >>> naming, drop the code in arch/powerpc and use the generic version. >>> >>> Signed-off-by: Christopher Covington <cov@codeaurora.org> >>> --- >>> arch/powerpc/Kconfig | 1 + >>> arch/powerpc/include/asm/Kbuild | 1 + >>> arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- >>> arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- >>> 4 files changed, 3 insertions(+), 62 deletions(-) >>> delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h >> >> This looks OK. >> >> Have you tested it on powerpc? I could but I don't know how to actually >> trigger these paths, I assume I need a CRIU setup? > > FWIW, tested on ppc64le using a sample test process moving its VDSO and > then catching a signal on 4.9-rc4 and using CRIU on top of 4.8 with > sightly changes to due minor upstream changes. > > Reviewed-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> > Tested-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Thanks, in that case: Acked-by: Michael Ellerman <mpe@ellerman.id.au> cheers ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions @ 2016-11-07 23:51 ` Michael Ellerman 0 siblings, 0 replies; 39+ messages in thread From: Michael Ellerman @ 2016-11-07 23:51 UTC (permalink / raw) To: Laurent Dufour, Christopher Covington, criu, Will Deacon, linux-mm Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel Laurent Dufour <ldufour@linux.vnet.ibm.com> writes: > On 04/11/2016 05:59, Michael Ellerman wrote: >> Christopher Covington <cov@codeaurora.org> writes: >> >>> The PowerPC VDSO remap and unmap code was copied to a generic location, >>> only modifying the variable name expected in mm->context (vdso instead of >>> vdso_base) to match most other architectures. Having adopted this generic >>> naming, drop the code in arch/powerpc and use the generic version. >>> >>> Signed-off-by: Christopher Covington <cov@codeaurora.org> >>> --- >>> arch/powerpc/Kconfig | 1 + >>> arch/powerpc/include/asm/Kbuild | 1 + >>> arch/powerpc/include/asm/mm-arch-hooks.h | 28 ------------------------- >>> arch/powerpc/include/asm/mmu_context.h | 35 +------------------------------- >>> 4 files changed, 3 insertions(+), 62 deletions(-) >>> delete mode 100644 arch/powerpc/include/asm/mm-arch-hooks.h >> >> This looks OK. >> >> Have you tested it on powerpc? I could but I don't know how to actually >> trigger these paths, I assume I need a CRIU setup? > > FWIW, tested on ppc64le using a sample test process moving its VDSO and > then catching a signal on 4.9-rc4 and using CRIU on top of 4.8 with > sightly changes to due minor upstream changes. > > Reviewed-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> > Tested-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Thanks, in that case: Acked-by: Michael Ellerman <mpe@ellerman.id.au> cheers -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [RFC v2 7/7] mm: Remove mm-arch-hooks.h 2016-11-01 17:10 ` Christopher Covington ` (2 preceding siblings ...) (?) @ 2016-11-01 17:11 ` Christopher Covington -1 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:11 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta, Russell King, Catalin Marinas, Haavard Skinnemoen, Hans-Christian Egtvedt, Steven Miao, Mark Salter, Aurelien Jacquiot, Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek, Ralf Baechle, David Howells The only use case, VDSO remap support for PowerPC, has been made generic instead of architecture-specific. Since the infrastructure is no longer needed, remove it. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/alpha/include/asm/Kbuild | 1 - arch/arc/include/asm/Kbuild | 1 - arch/arm/include/asm/Kbuild | 1 - arch/arm64/include/asm/Kbuild | 1 - arch/avr32/include/asm/Kbuild | 1 - arch/blackfin/include/asm/Kbuild | 1 - arch/c6x/include/asm/Kbuild | 1 - arch/cris/include/asm/Kbuild | 1 - arch/frv/include/asm/Kbuild | 1 - arch/h8300/include/asm/Kbuild | 1 - arch/hexagon/include/asm/Kbuild | 1 - arch/ia64/include/asm/Kbuild | 1 - arch/m32r/include/asm/Kbuild | 1 - arch/m68k/include/asm/Kbuild | 1 - arch/metag/include/asm/Kbuild | 1 - arch/microblaze/include/asm/Kbuild | 1 - arch/mips/include/asm/Kbuild | 1 - arch/mn10300/include/asm/Kbuild | 1 - arch/nios2/include/asm/Kbuild | 1 - arch/openrisc/include/asm/Kbuild | 1 - arch/parisc/include/asm/Kbuild | 1 - arch/s390/include/asm/Kbuild | 1 - arch/score/include/asm/Kbuild | 1 - arch/sh/include/asm/Kbuild | 1 - arch/sparc/include/asm/Kbuild | 1 - arch/tile/include/asm/Kbuild | 1 - arch/um/include/asm/Kbuild | 1 - arch/unicore32/include/asm/Kbuild | 1 - arch/x86/include/asm/Kbuild | 1 - arch/xtensa/include/asm/Kbuild | 1 - include/asm-generic/mm_hooks.h | 16 ---------------- mm/mremap.c | 20 +++++++++++++++++--- 32 files changed, 17 insertions(+), 49 deletions(-) diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index bf8475c..0a5e0ec 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += exec.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index c332604..e6059a8 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild @@ -22,7 +22,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 0745538..44b717c 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += irq_regs.h generic-y += kdebug.h generic-y += local.h generic-y += local64.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += msi.h generic-y += param.h diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 44e1d7f..a42a136 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -20,7 +20,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index 241b9b9..519810d 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild @@ -12,7 +12,6 @@ generic-y += irq_work.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += param.h generic-y += percpu.h generic-y += preempt.h diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 91d49c0..c80181e 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild @@ -21,7 +21,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += mutex.h diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index 64465e7..1b9cbed 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild @@ -27,7 +27,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index 1778805..8e98d03 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild @@ -24,7 +24,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild index 1fa084c..2c987dc 100644 --- a/arch/frv/include/asm/Kbuild +++ b/arch/frv/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 373cb23..2a63a32 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -33,7 +33,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index db8ddab..0988816 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -28,7 +28,6 @@ generic-y += kmap_types.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += pci.h diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 502a91d..dc05773 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += vtime.h diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild index 860e440..f09a5fd 100644 --- a/arch/m32r/include/asm/Kbuild +++ b/arch/m32r/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += preempt.h generic-y += sections.h diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index eb85bd9..1555bc1 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mutex.h generic-y += percpu.h diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild index 29acb89d..611c0df 100644 --- a/arch/metag/include/asm/Kbuild +++ b/arch/metag/include/asm/Kbuild @@ -25,7 +25,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild index b0ae88c..cefeaba 100644 --- a/arch/microblaze/include/asm/Kbuild +++ b/arch/microblaze/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += device.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += syscalls.h generic-y += trace_clock.h diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 9740066..f0ce0ae 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -8,7 +8,6 @@ generic-y += emergency-restart.h generic-y += irq_work.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += parport.h generic-y += percpu.h diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild index 1c8dd0f..27cbc02 100644 --- a/arch/mn10300/include/asm/Kbuild +++ b/arch/mn10300/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/nios2/include/asm/Kbuild b/arch/nios2/include/asm/Kbuild index d63330e..e224789 100644 --- a/arch/nios2/include/asm/Kbuild +++ b/arch/nios2/include/asm/Kbuild @@ -30,7 +30,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 2832f03..2a2e39b 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -36,7 +36,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index f9b3a81..12b341d 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += percpu.h diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index 20f196b..c1ef825 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += clkdev.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index a05218f..ff19975 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -7,7 +7,6 @@ generic-y += clkdev.h generic-y += cputime.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 751c337..7d1fb2c 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild @@ -17,7 +17,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += param.h diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index cfc9180..0867d5a 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild @@ -13,7 +13,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += mutex.h generic-y += preempt.h diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild index ba35c41..40d22b4 100644 --- a/arch/tile/include/asm/Kbuild +++ b/arch/tile/include/asm/Kbuild @@ -19,7 +19,6 @@ generic-y += irq_regs.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index 904f3eb..33c1d3e 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -16,7 +16,6 @@ generic-y += irq_regs.h generic-y += irq_work.h generic-y += kdebug.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += pci.h diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index 256c45b..932070c 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild @@ -26,7 +26,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 2cfed17..51b3d95 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -15,4 +15,3 @@ generic-y += cputime.h generic-y += dma-contiguous.h generic-y += early_ioremap.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 28cf4c5..bdade99 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += percpu.h generic-y += preempt.h generic-y += resource.h diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 73f09f1..f4d43aa 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -3,7 +3,6 @@ * included in asm-FOO/mmu_context.h for any arch FOO which doesn't need to * specially hook these. * - * arch_remap originally from include/linux-mm-arch-hooks.h * arch_unmap originally from arch/powerpc/include/asm/mmu_context.h * Copyright (C) 2015, IBM Corporation * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> @@ -35,21 +34,6 @@ static inline void arch_unmap(struct mm_struct *mm, #endif /* CONFIG_GENERIC_VDSO */ } -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) -{ -#ifdef CONFIG_GENERIC_VDSO - /* - * mremap() doesn't allow moving multiple vmas so we can limit the - * check to old_addr == vdso. - */ - if (old_addr == mm->context.vdso) - mm->context.vdso = new_addr; - -#endif /* CONFIG_GENERIC_VDSO */ -} - static inline void arch_bprm_mm_init(struct mm_struct *mm, struct vm_area_struct *vma) { diff --git a/mm/mremap.c b/mm/mremap.c index da22ad2..0d0ea14 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -5,6 +5,14 @@ * * Address space accounting code <alan@lxorguk.ukuu.org.uk> * (C) Copyright 2002 Red Hat Inc, All Rights Reserved + * + * arch_remap originally from include/linux-mm-arch-hooks.h + * Copyright (C) 2015, IBM Corporation + * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> + * + * 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. */ #include <linux/mm.h> @@ -21,7 +29,6 @@ #include <linux/syscalls.h> #include <linux/mmu_notifier.h> #include <linux/uaccess.h> -#include <linux/mm-arch-hooks.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> @@ -293,8 +300,15 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_addr = new_addr; new_addr = err; } else { - arch_remap(mm, old_addr, old_addr + old_len, - new_addr, new_addr + new_len); +#ifdef CONFIG_GENERIC_VDSO + /* + * mremap() doesn't allow moving multiple vmas so we can limit + * the check to old_addr == vdso. + */ + if (old_addr == mm->context.vdso) + mm->context.vdso = new_addr; + +#endif /* CONFIG_GENERIC_VDSO */ } /* Conceal VM_ACCOUNT so old reservation is not undone */ -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 7/7] mm: Remove mm-arch-hooks.h @ 2016-11-01 17:11 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:11 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta, Russell King, Catalin Marinas, Haavard Skinnemoen, Hans-Christian Egtvedt, Steven Miao, Mark Salter, Aurelien Jacquiot, Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan, Jonas Bonn, James E.J. Bottomley, Helge Deller, Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Chris Metcalf, Jeff Dike, Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel, Max Filippov, Arnd Bergmann, linux-alpha, linux-kernel, linux-snps-arc, linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64, linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev, linux-parisc, linux-s390, linux-sh, sparclinux, user-mode-linux-devel, user-mode-linux-user, linux-xtensa, linux-arch The only use case, VDSO remap support for PowerPC, has been made generic instead of architecture-specific. Since the infrastructure is no longer needed, remove it. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/alpha/include/asm/Kbuild | 1 - arch/arc/include/asm/Kbuild | 1 - arch/arm/include/asm/Kbuild | 1 - arch/arm64/include/asm/Kbuild | 1 - arch/avr32/include/asm/Kbuild | 1 - arch/blackfin/include/asm/Kbuild | 1 - arch/c6x/include/asm/Kbuild | 1 - arch/cris/include/asm/Kbuild | 1 - arch/frv/include/asm/Kbuild | 1 - arch/h8300/include/asm/Kbuild | 1 - arch/hexagon/include/asm/Kbuild | 1 - arch/ia64/include/asm/Kbuild | 1 - arch/m32r/include/asm/Kbuild | 1 - arch/m68k/include/asm/Kbuild | 1 - arch/metag/include/asm/Kbuild | 1 - arch/microblaze/include/asm/Kbuild | 1 - arch/mips/include/asm/Kbuild | 1 - arch/mn10300/include/asm/Kbuild | 1 - arch/nios2/include/asm/Kbuild | 1 - arch/openrisc/include/asm/Kbuild | 1 - arch/parisc/include/asm/Kbuild | 1 - arch/s390/include/asm/Kbuild | 1 - arch/score/include/asm/Kbuild | 1 - arch/sh/include/asm/Kbuild | 1 - arch/sparc/include/asm/Kbuild | 1 - arch/tile/include/asm/Kbuild | 1 - arch/um/include/asm/Kbuild | 1 - arch/unicore32/include/asm/Kbuild | 1 - arch/x86/include/asm/Kbuild | 1 - arch/xtensa/include/asm/Kbuild | 1 - include/asm-generic/mm_hooks.h | 16 ---------------- mm/mremap.c | 20 +++++++++++++++++--- 32 files changed, 17 insertions(+), 49 deletions(-) diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index bf8475c..0a5e0ec 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += exec.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index c332604..e6059a8 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild @@ -22,7 +22,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 0745538..44b717c 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += irq_regs.h generic-y += kdebug.h generic-y += local.h generic-y += local64.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += msi.h generic-y += param.h diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 44e1d7f..a42a136 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -20,7 +20,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index 241b9b9..519810d 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild @@ -12,7 +12,6 @@ generic-y += irq_work.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += param.h generic-y += percpu.h generic-y += preempt.h diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 91d49c0..c80181e 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild @@ -21,7 +21,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += mutex.h diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index 64465e7..1b9cbed 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild @@ -27,7 +27,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index 1778805..8e98d03 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild @@ -24,7 +24,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild index 1fa084c..2c987dc 100644 --- a/arch/frv/include/asm/Kbuild +++ b/arch/frv/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 373cb23..2a63a32 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -33,7 +33,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index db8ddab..0988816 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -28,7 +28,6 @@ generic-y += kmap_types.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += pci.h diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 502a91d..dc05773 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += vtime.h diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild index 860e440..f09a5fd 100644 --- a/arch/m32r/include/asm/Kbuild +++ b/arch/m32r/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += preempt.h generic-y += sections.h diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index eb85bd9..1555bc1 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mutex.h generic-y += percpu.h diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild index 29acb89d..611c0df 100644 --- a/arch/metag/include/asm/Kbuild +++ b/arch/metag/include/asm/Kbuild @@ -25,7 +25,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild index b0ae88c..cefeaba 100644 --- a/arch/microblaze/include/asm/Kbuild +++ b/arch/microblaze/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += device.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += syscalls.h generic-y += trace_clock.h diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 9740066..f0ce0ae 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -8,7 +8,6 @@ generic-y += emergency-restart.h generic-y += irq_work.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += parport.h generic-y += percpu.h diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild index 1c8dd0f..27cbc02 100644 --- a/arch/mn10300/include/asm/Kbuild +++ b/arch/mn10300/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/nios2/include/asm/Kbuild b/arch/nios2/include/asm/Kbuild index d63330e..e224789 100644 --- a/arch/nios2/include/asm/Kbuild +++ b/arch/nios2/include/asm/Kbuild @@ -30,7 +30,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 2832f03..2a2e39b 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -36,7 +36,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index f9b3a81..12b341d 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += percpu.h diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index 20f196b..c1ef825 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += clkdev.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index a05218f..ff19975 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -7,7 +7,6 @@ generic-y += clkdev.h generic-y += cputime.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 751c337..7d1fb2c 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild @@ -17,7 +17,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += param.h diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index cfc9180..0867d5a 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild @@ -13,7 +13,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += mutex.h generic-y += preempt.h diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild index ba35c41..40d22b4 100644 --- a/arch/tile/include/asm/Kbuild +++ b/arch/tile/include/asm/Kbuild @@ -19,7 +19,6 @@ generic-y += irq_regs.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index 904f3eb..33c1d3e 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -16,7 +16,6 @@ generic-y += irq_regs.h generic-y += irq_work.h generic-y += kdebug.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += pci.h diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index 256c45b..932070c 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild @@ -26,7 +26,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 2cfed17..51b3d95 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -15,4 +15,3 @@ generic-y += cputime.h generic-y += dma-contiguous.h generic-y += early_ioremap.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 28cf4c5..bdade99 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += percpu.h generic-y += preempt.h generic-y += resource.h diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 73f09f1..f4d43aa 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -3,7 +3,6 @@ * included in asm-FOO/mmu_context.h for any arch FOO which doesn't need to * specially hook these. * - * arch_remap originally from include/linux-mm-arch-hooks.h * arch_unmap originally from arch/powerpc/include/asm/mmu_context.h * Copyright (C) 2015, IBM Corporation * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> @@ -35,21 +34,6 @@ static inline void arch_unmap(struct mm_struct *mm, #endif /* CONFIG_GENERIC_VDSO */ } -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) -{ -#ifdef CONFIG_GENERIC_VDSO - /* - * mremap() doesn't allow moving multiple vmas so we can limit the - * check to old_addr == vdso. - */ - if (old_addr == mm->context.vdso) - mm->context.vdso = new_addr; - -#endif /* CONFIG_GENERIC_VDSO */ -} - static inline void arch_bprm_mm_init(struct mm_struct *mm, struct vm_area_struct *vma) { diff --git a/mm/mremap.c b/mm/mremap.c index da22ad2..0d0ea14 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -5,6 +5,14 @@ * * Address space accounting code <alan@lxorguk.ukuu.org.uk> * (C) Copyright 2002 Red Hat Inc, All Rights Reserved + * + * arch_remap originally from include/linux-mm-arch-hooks.h + * Copyright (C) 2015, IBM Corporation + * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> + * + * 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. */ #include <linux/mm.h> @@ -21,7 +29,6 @@ #include <linux/syscalls.h> #include <linux/mmu_notifier.h> #include <linux/uaccess.h> -#include <linux/mm-arch-hooks.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> @@ -293,8 +300,15 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_addr = new_addr; new_addr = err; } else { - arch_remap(mm, old_addr, old_addr + old_len, - new_addr, new_addr + new_len); +#ifdef CONFIG_GENERIC_VDSO + /* + * mremap() doesn't allow moving multiple vmas so we can limit + * the check to old_addr == vdso. + */ + if (old_addr == mm->context.vdso) + mm->context.vdso = new_addr; + +#endif /* CONFIG_GENERIC_VDSO */ } /* Conceal VM_ACCOUNT so old reservation is not undone */ -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 7/7] mm: Remove mm-arch-hooks.h @ 2016-11-01 17:11 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:11 UTC (permalink / raw) To: linux-snps-arc The only use case, VDSO remap support for PowerPC, has been made generic instead of architecture-specific. Since the infrastructure is no longer needed, remove it. Signed-off-by: Christopher Covington <cov at codeaurora.org> --- arch/alpha/include/asm/Kbuild | 1 - arch/arc/include/asm/Kbuild | 1 - arch/arm/include/asm/Kbuild | 1 - arch/arm64/include/asm/Kbuild | 1 - arch/avr32/include/asm/Kbuild | 1 - arch/blackfin/include/asm/Kbuild | 1 - arch/c6x/include/asm/Kbuild | 1 - arch/cris/include/asm/Kbuild | 1 - arch/frv/include/asm/Kbuild | 1 - arch/h8300/include/asm/Kbuild | 1 - arch/hexagon/include/asm/Kbuild | 1 - arch/ia64/include/asm/Kbuild | 1 - arch/m32r/include/asm/Kbuild | 1 - arch/m68k/include/asm/Kbuild | 1 - arch/metag/include/asm/Kbuild | 1 - arch/microblaze/include/asm/Kbuild | 1 - arch/mips/include/asm/Kbuild | 1 - arch/mn10300/include/asm/Kbuild | 1 - arch/nios2/include/asm/Kbuild | 1 - arch/openrisc/include/asm/Kbuild | 1 - arch/parisc/include/asm/Kbuild | 1 - arch/s390/include/asm/Kbuild | 1 - arch/score/include/asm/Kbuild | 1 - arch/sh/include/asm/Kbuild | 1 - arch/sparc/include/asm/Kbuild | 1 - arch/tile/include/asm/Kbuild | 1 - arch/um/include/asm/Kbuild | 1 - arch/unicore32/include/asm/Kbuild | 1 - arch/x86/include/asm/Kbuild | 1 - arch/xtensa/include/asm/Kbuild | 1 - include/asm-generic/mm_hooks.h | 16 ---------------- mm/mremap.c | 20 +++++++++++++++++--- 32 files changed, 17 insertions(+), 49 deletions(-) diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index bf8475c..0a5e0ec 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += exec.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index c332604..e6059a8 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild @@ -22,7 +22,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 0745538..44b717c 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += irq_regs.h generic-y += kdebug.h generic-y += local.h generic-y += local64.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += msi.h generic-y += param.h diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 44e1d7f..a42a136 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -20,7 +20,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index 241b9b9..519810d 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild @@ -12,7 +12,6 @@ generic-y += irq_work.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += param.h generic-y += percpu.h generic-y += preempt.h diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 91d49c0..c80181e 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild @@ -21,7 +21,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += mutex.h diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index 64465e7..1b9cbed 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild @@ -27,7 +27,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index 1778805..8e98d03 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild @@ -24,7 +24,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild index 1fa084c..2c987dc 100644 --- a/arch/frv/include/asm/Kbuild +++ b/arch/frv/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 373cb23..2a63a32 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -33,7 +33,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index db8ddab..0988816 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -28,7 +28,6 @@ generic-y += kmap_types.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += pci.h diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 502a91d..dc05773 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += vtime.h diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild index 860e440..f09a5fd 100644 --- a/arch/m32r/include/asm/Kbuild +++ b/arch/m32r/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += preempt.h generic-y += sections.h diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index eb85bd9..1555bc1 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mutex.h generic-y += percpu.h diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild index 29acb89d..611c0df 100644 --- a/arch/metag/include/asm/Kbuild +++ b/arch/metag/include/asm/Kbuild @@ -25,7 +25,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild index b0ae88c..cefeaba 100644 --- a/arch/microblaze/include/asm/Kbuild +++ b/arch/microblaze/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += device.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += syscalls.h generic-y += trace_clock.h diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 9740066..f0ce0ae 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -8,7 +8,6 @@ generic-y += emergency-restart.h generic-y += irq_work.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += parport.h generic-y += percpu.h diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild index 1c8dd0f..27cbc02 100644 --- a/arch/mn10300/include/asm/Kbuild +++ b/arch/mn10300/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/nios2/include/asm/Kbuild b/arch/nios2/include/asm/Kbuild index d63330e..e224789 100644 --- a/arch/nios2/include/asm/Kbuild +++ b/arch/nios2/include/asm/Kbuild @@ -30,7 +30,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 2832f03..2a2e39b 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -36,7 +36,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index f9b3a81..12b341d 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += percpu.h diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index 20f196b..c1ef825 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += clkdev.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index a05218f..ff19975 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -7,7 +7,6 @@ generic-y += clkdev.h generic-y += cputime.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 751c337..7d1fb2c 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild @@ -17,7 +17,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += param.h diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index cfc9180..0867d5a 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild @@ -13,7 +13,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += mutex.h generic-y += preempt.h diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild index ba35c41..40d22b4 100644 --- a/arch/tile/include/asm/Kbuild +++ b/arch/tile/include/asm/Kbuild @@ -19,7 +19,6 @@ generic-y += irq_regs.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index 904f3eb..33c1d3e 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -16,7 +16,6 @@ generic-y += irq_regs.h generic-y += irq_work.h generic-y += kdebug.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += pci.h diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index 256c45b..932070c 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild @@ -26,7 +26,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 2cfed17..51b3d95 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -15,4 +15,3 @@ generic-y += cputime.h generic-y += dma-contiguous.h generic-y += early_ioremap.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 28cf4c5..bdade99 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += percpu.h generic-y += preempt.h generic-y += resource.h diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 73f09f1..f4d43aa 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -3,7 +3,6 @@ * included in asm-FOO/mmu_context.h for any arch FOO which doesn't need to * specially hook these. * - * arch_remap originally from include/linux-mm-arch-hooks.h * arch_unmap originally from arch/powerpc/include/asm/mmu_context.h * Copyright (C) 2015, IBM Corporation * Author: Laurent Dufour <ldufour at linux.vnet.ibm.com> @@ -35,21 +34,6 @@ static inline void arch_unmap(struct mm_struct *mm, #endif /* CONFIG_GENERIC_VDSO */ } -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) -{ -#ifdef CONFIG_GENERIC_VDSO - /* - * mremap() doesn't allow moving multiple vmas so we can limit the - * check to old_addr == vdso. - */ - if (old_addr == mm->context.vdso) - mm->context.vdso = new_addr; - -#endif /* CONFIG_GENERIC_VDSO */ -} - static inline void arch_bprm_mm_init(struct mm_struct *mm, struct vm_area_struct *vma) { diff --git a/mm/mremap.c b/mm/mremap.c index da22ad2..0d0ea14 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -5,6 +5,14 @@ * * Address space accounting code <alan at lxorguk.ukuu.org.uk> * (C) Copyright 2002 Red Hat Inc, All Rights Reserved + * + * arch_remap originally from include/linux-mm-arch-hooks.h + * Copyright (C) 2015, IBM Corporation + * Author: Laurent Dufour <ldufour at linux.vnet.ibm.com> + * + * 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. */ #include <linux/mm.h> @@ -21,7 +29,6 @@ #include <linux/syscalls.h> #include <linux/mmu_notifier.h> #include <linux/uaccess.h> -#include <linux/mm-arch-hooks.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> @@ -293,8 +300,15 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_addr = new_addr; new_addr = err; } else { - arch_remap(mm, old_addr, old_addr + old_len, - new_addr, new_addr + new_len); +#ifdef CONFIG_GENERIC_VDSO + /* + * mremap() doesn't allow moving multiple vmas so we can limit + * the check to old_addr == vdso. + */ + if (old_addr == mm->context.vdso) + mm->context.vdso = new_addr; + +#endif /* CONFIG_GENERIC_VDSO */ } /* Conceal VM_ACCOUNT so old reservation is not undone */ -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 7/7] mm: Remove mm-arch-hooks.h @ 2016-11-01 17:11 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:11 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta, Russell King, Catalin Marinas, Haavard Skinnemoen, Hans-Christian Egtvedt, Steven Miao, Mark Salter, Aurelien Jacquiot, Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek, Ralf Baechle, David Howells The only use case, VDSO remap support for PowerPC, has been made generic instead of architecture-specific. Since the infrastructure is no longer needed, remove it. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/alpha/include/asm/Kbuild | 1 - arch/arc/include/asm/Kbuild | 1 - arch/arm/include/asm/Kbuild | 1 - arch/arm64/include/asm/Kbuild | 1 - arch/avr32/include/asm/Kbuild | 1 - arch/blackfin/include/asm/Kbuild | 1 - arch/c6x/include/asm/Kbuild | 1 - arch/cris/include/asm/Kbuild | 1 - arch/frv/include/asm/Kbuild | 1 - arch/h8300/include/asm/Kbuild | 1 - arch/hexagon/include/asm/Kbuild | 1 - arch/ia64/include/asm/Kbuild | 1 - arch/m32r/include/asm/Kbuild | 1 - arch/m68k/include/asm/Kbuild | 1 - arch/metag/include/asm/Kbuild | 1 - arch/microblaze/include/asm/Kbuild | 1 - arch/mips/include/asm/Kbuild | 1 - arch/mn10300/include/asm/Kbuild | 1 - arch/nios2/include/asm/Kbuild | 1 - arch/openrisc/include/asm/Kbuild | 1 - arch/parisc/include/asm/Kbuild | 1 - arch/s390/include/asm/Kbuild | 1 - arch/score/include/asm/Kbuild | 1 - arch/sh/include/asm/Kbuild | 1 - arch/sparc/include/asm/Kbuild | 1 - arch/tile/include/asm/Kbuild | 1 - arch/um/include/asm/Kbuild | 1 - arch/unicore32/include/asm/Kbuild | 1 - arch/x86/include/asm/Kbuild | 1 - arch/xtensa/include/asm/Kbuild | 1 - include/asm-generic/mm_hooks.h | 16 ---------------- mm/mremap.c | 20 +++++++++++++++++--- 32 files changed, 17 insertions(+), 49 deletions(-) diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index bf8475c..0a5e0ec 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += exec.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index c332604..e6059a8 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild @@ -22,7 +22,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 0745538..44b717c 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += irq_regs.h generic-y += kdebug.h generic-y += local.h generic-y += local64.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += msi.h generic-y += param.h diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 44e1d7f..a42a136 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -20,7 +20,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index 241b9b9..519810d 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild @@ -12,7 +12,6 @@ generic-y += irq_work.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += param.h generic-y += percpu.h generic-y += preempt.h diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 91d49c0..c80181e 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild @@ -21,7 +21,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += mutex.h diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index 64465e7..1b9cbed 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild @@ -27,7 +27,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index 1778805..8e98d03 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild @@ -24,7 +24,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild index 1fa084c..2c987dc 100644 --- a/arch/frv/include/asm/Kbuild +++ b/arch/frv/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 373cb23..2a63a32 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -33,7 +33,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index db8ddab..0988816 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -28,7 +28,6 @@ generic-y += kmap_types.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += pci.h diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 502a91d..dc05773 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += vtime.h diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild index 860e440..f09a5fd 100644 --- a/arch/m32r/include/asm/Kbuild +++ b/arch/m32r/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += preempt.h generic-y += sections.h diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index eb85bd9..1555bc1 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mutex.h generic-y += percpu.h diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild index 29acb89d..611c0df 100644 --- a/arch/metag/include/asm/Kbuild +++ b/arch/metag/include/asm/Kbuild @@ -25,7 +25,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild index b0ae88c..cefeaba 100644 --- a/arch/microblaze/include/asm/Kbuild +++ b/arch/microblaze/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += device.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += syscalls.h generic-y += trace_clock.h diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 9740066..f0ce0ae 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -8,7 +8,6 @@ generic-y += emergency-restart.h generic-y += irq_work.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += parport.h generic-y += percpu.h diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild index 1c8dd0f..27cbc02 100644 --- a/arch/mn10300/include/asm/Kbuild +++ b/arch/mn10300/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/nios2/include/asm/Kbuild b/arch/nios2/include/asm/Kbuild index d63330e..e224789 100644 --- a/arch/nios2/include/asm/Kbuild +++ b/arch/nios2/include/asm/Kbuild @@ -30,7 +30,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 2832f03..2a2e39b 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -36,7 +36,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index f9b3a81..12b341d 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += percpu.h diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index 20f196b..c1ef825 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += clkdev.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index a05218f..ff19975 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -7,7 +7,6 @@ generic-y += clkdev.h generic-y += cputime.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 751c337..7d1fb2c 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild @@ -17,7 +17,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += param.h diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index cfc9180..0867d5a 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild @@ -13,7 +13,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += mutex.h generic-y += preempt.h diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild index ba35c41..40d22b4 100644 --- a/arch/tile/include/asm/Kbuild +++ b/arch/tile/include/asm/Kbuild @@ -19,7 +19,6 @@ generic-y += irq_regs.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index 904f3eb..33c1d3e 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -16,7 +16,6 @@ generic-y += irq_regs.h generic-y += irq_work.h generic-y += kdebug.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += pci.h diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index 256c45b..932070c 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild @@ -26,7 +26,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 2cfed17..51b3d95 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -15,4 +15,3 @@ generic-y += cputime.h generic-y += dma-contiguous.h generic-y += early_ioremap.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 28cf4c5..bdade99 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += percpu.h generic-y += preempt.h generic-y += resource.h diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 73f09f1..f4d43aa 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -3,7 +3,6 @@ * included in asm-FOO/mmu_context.h for any arch FOO which doesn't need to * specially hook these. * - * arch_remap originally from include/linux-mm-arch-hooks.h * arch_unmap originally from arch/powerpc/include/asm/mmu_context.h * Copyright (C) 2015, IBM Corporation * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> @@ -35,21 +34,6 @@ static inline void arch_unmap(struct mm_struct *mm, #endif /* CONFIG_GENERIC_VDSO */ } -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) -{ -#ifdef CONFIG_GENERIC_VDSO - /* - * mremap() doesn't allow moving multiple vmas so we can limit the - * check to old_addr == vdso. - */ - if (old_addr == mm->context.vdso) - mm->context.vdso = new_addr; - -#endif /* CONFIG_GENERIC_VDSO */ -} - static inline void arch_bprm_mm_init(struct mm_struct *mm, struct vm_area_struct *vma) { diff --git a/mm/mremap.c b/mm/mremap.c index da22ad2..0d0ea14 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -5,6 +5,14 @@ * * Address space accounting code <alan@lxorguk.ukuu.org.uk> * (C) Copyright 2002 Red Hat Inc, All Rights Reserved + * + * arch_remap originally from include/linux-mm-arch-hooks.h + * Copyright (C) 2015, IBM Corporation + * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> + * + * 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. */ #include <linux/mm.h> @@ -21,7 +29,6 @@ #include <linux/syscalls.h> #include <linux/mmu_notifier.h> #include <linux/uaccess.h> -#include <linux/mm-arch-hooks.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> @@ -293,8 +300,15 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_addr = new_addr; new_addr = err; } else { - arch_remap(mm, old_addr, old_addr + old_len, - new_addr, new_addr + new_len); +#ifdef CONFIG_GENERIC_VDSO + /* + * mremap() doesn't allow moving multiple vmas so we can limit + * the check to old_addr == vdso. + */ + if (old_addr == mm->context.vdso) + mm->context.vdso = new_addr; + +#endif /* CONFIG_GENERIC_VDSO */ } /* Conceal VM_ACCOUNT so old reservation is not undone */ -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [RFC v2 7/7] mm: Remove mm-arch-hooks.h @ 2016-11-01 17:11 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-01 17:11 UTC (permalink / raw) To: criu, Will Deacon, linux-mm, Laurent Dufour Cc: Christopher Covington, Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta, Russell King, Catalin Marinas, Haavard Skinnemoen, Hans-Christian Egtvedt, Steven Miao, Mark Salter, Aurelien Jacquiot, Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan, Jonas Bonn, James E.J. Bottomley, Helge Deller, Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Chris Metcalf, Jeff Dike, Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel, Max Filippov, Arnd Bergmann, linux-alpha, linux-kernel, linux-snps-arc, linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64, linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev, linux-parisc, linux-s390, linux-sh, sparclinux, user-mode-linux-devel, user-mode-linux-user, linux-xtensa, linux-arch The only use case, VDSO remap support for PowerPC, has been made generic instead of architecture-specific. Since the infrastructure is no longer needed, remove it. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/alpha/include/asm/Kbuild | 1 - arch/arc/include/asm/Kbuild | 1 - arch/arm/include/asm/Kbuild | 1 - arch/arm64/include/asm/Kbuild | 1 - arch/avr32/include/asm/Kbuild | 1 - arch/blackfin/include/asm/Kbuild | 1 - arch/c6x/include/asm/Kbuild | 1 - arch/cris/include/asm/Kbuild | 1 - arch/frv/include/asm/Kbuild | 1 - arch/h8300/include/asm/Kbuild | 1 - arch/hexagon/include/asm/Kbuild | 1 - arch/ia64/include/asm/Kbuild | 1 - arch/m32r/include/asm/Kbuild | 1 - arch/m68k/include/asm/Kbuild | 1 - arch/metag/include/asm/Kbuild | 1 - arch/microblaze/include/asm/Kbuild | 1 - arch/mips/include/asm/Kbuild | 1 - arch/mn10300/include/asm/Kbuild | 1 - arch/nios2/include/asm/Kbuild | 1 - arch/openrisc/include/asm/Kbuild | 1 - arch/parisc/include/asm/Kbuild | 1 - arch/s390/include/asm/Kbuild | 1 - arch/score/include/asm/Kbuild | 1 - arch/sh/include/asm/Kbuild | 1 - arch/sparc/include/asm/Kbuild | 1 - arch/tile/include/asm/Kbuild | 1 - arch/um/include/asm/Kbuild | 1 - arch/unicore32/include/asm/Kbuild | 1 - arch/x86/include/asm/Kbuild | 1 - arch/xtensa/include/asm/Kbuild | 1 - include/asm-generic/mm_hooks.h | 16 ---------------- mm/mremap.c | 20 +++++++++++++++++--- 32 files changed, 17 insertions(+), 49 deletions(-) diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index bf8475c..0a5e0ec 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += exec.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index c332604..e6059a8 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild @@ -22,7 +22,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 0745538..44b717c 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += irq_regs.h generic-y += kdebug.h generic-y += local.h generic-y += local64.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += msi.h generic-y += param.h diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 44e1d7f..a42a136 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -20,7 +20,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += msi.h diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index 241b9b9..519810d 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild @@ -12,7 +12,6 @@ generic-y += irq_work.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += param.h generic-y += percpu.h generic-y += preempt.h diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 91d49c0..c80181e 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild @@ -21,7 +21,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += mutex.h diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index 64465e7..1b9cbed 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild @@ -27,7 +27,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index 1778805..8e98d03 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild @@ -24,7 +24,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild index 1fa084c..2c987dc 100644 --- a/arch/frv/include/asm/Kbuild +++ b/arch/frv/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 373cb23..2a63a32 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -33,7 +33,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mmu.h generic-y += mmu_context.h diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index db8ddab..0988816 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -28,7 +28,6 @@ generic-y += kmap_types.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += pci.h diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 502a91d..dc05773 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += vtime.h diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild index 860e440..f09a5fd 100644 --- a/arch/m32r/include/asm/Kbuild +++ b/arch/m32r/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += exec.h generic-y += irq_work.h generic-y += kvm_para.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += preempt.h generic-y += sections.h diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index eb85bd9..1555bc1 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += mutex.h generic-y += percpu.h diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild index 29acb89d..611c0df 100644 --- a/arch/metag/include/asm/Kbuild +++ b/arch/metag/include/asm/Kbuild @@ -25,7 +25,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild index b0ae88c..cefeaba 100644 --- a/arch/microblaze/include/asm/Kbuild +++ b/arch/microblaze/include/asm/Kbuild @@ -6,7 +6,6 @@ generic-y += device.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += syscalls.h generic-y += trace_clock.h diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 9740066..f0ce0ae 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -8,7 +8,6 @@ generic-y += emergency-restart.h generic-y += irq_work.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += parport.h generic-y += percpu.h diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild index 1c8dd0f..27cbc02 100644 --- a/arch/mn10300/include/asm/Kbuild +++ b/arch/mn10300/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/nios2/include/asm/Kbuild b/arch/nios2/include/asm/Kbuild index d63330e..e224789 100644 --- a/arch/nios2/include/asm/Kbuild +++ b/arch/nios2/include/asm/Kbuild @@ -30,7 +30,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 2832f03..2a2e39b 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -36,7 +36,6 @@ generic-y += kmap_types.h generic-y += kvm_para.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index f9b3a81..12b341d 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild @@ -15,7 +15,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += percpu.h diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index 20f196b..c1ef825 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild @@ -4,7 +4,6 @@ generic-y += clkdev.h generic-y += export.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += trace_clock.h generic-y += word-at-a-time.h diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index a05218f..ff19975 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -7,7 +7,6 @@ generic-y += clkdev.h generic-y += cputime.h generic-y += irq_work.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += preempt.h generic-y += sections.h generic-y += trace_clock.h diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 751c337..7d1fb2c 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild @@ -17,7 +17,6 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += msgbuf.h generic-y += param.h diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index cfc9180..0867d5a 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild @@ -13,7 +13,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += module.h generic-y += mutex.h generic-y += preempt.h diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild index ba35c41..40d22b4 100644 --- a/arch/tile/include/asm/Kbuild +++ b/arch/tile/include/asm/Kbuild @@ -19,7 +19,6 @@ generic-y += irq_regs.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index 904f3eb..33c1d3e 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -16,7 +16,6 @@ generic-y += irq_regs.h generic-y += irq_work.h generic-y += kdebug.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mutex.h generic-y += param.h generic-y += pci.h diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index 256c45b..932070c 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild @@ -26,7 +26,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += mman.h generic-y += module.h generic-y += msgbuf.h diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 2cfed17..51b3d95 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -15,4 +15,3 @@ generic-y += cputime.h generic-y += dma-contiguous.h generic-y += early_ioremap.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 28cf4c5..bdade99 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild @@ -18,7 +18,6 @@ generic-y += linkage.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h generic-y += percpu.h generic-y += preempt.h generic-y += resource.h diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 73f09f1..f4d43aa 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -3,7 +3,6 @@ * included in asm-FOO/mmu_context.h for any arch FOO which doesn't need to * specially hook these. * - * arch_remap originally from include/linux-mm-arch-hooks.h * arch_unmap originally from arch/powerpc/include/asm/mmu_context.h * Copyright (C) 2015, IBM Corporation * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> @@ -35,21 +34,6 @@ static inline void arch_unmap(struct mm_struct *mm, #endif /* CONFIG_GENERIC_VDSO */ } -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) -{ -#ifdef CONFIG_GENERIC_VDSO - /* - * mremap() doesn't allow moving multiple vmas so we can limit the - * check to old_addr == vdso. - */ - if (old_addr == mm->context.vdso) - mm->context.vdso = new_addr; - -#endif /* CONFIG_GENERIC_VDSO */ -} - static inline void arch_bprm_mm_init(struct mm_struct *mm, struct vm_area_struct *vma) { diff --git a/mm/mremap.c b/mm/mremap.c index da22ad2..0d0ea14 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -5,6 +5,14 @@ * * Address space accounting code <alan@lxorguk.ukuu.org.uk> * (C) Copyright 2002 Red Hat Inc, All Rights Reserved + * + * arch_remap originally from include/linux-mm-arch-hooks.h + * Copyright (C) 2015, IBM Corporation + * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> + * + * 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. */ #include <linux/mm.h> @@ -21,7 +29,6 @@ #include <linux/syscalls.h> #include <linux/mmu_notifier.h> #include <linux/uaccess.h> -#include <linux/mm-arch-hooks.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> @@ -293,8 +300,15 @@ static unsigned long move_vma(struct vm_area_struct *vma, old_addr = new_addr; new_addr = err; } else { - arch_remap(mm, old_addr, old_addr + old_len, - new_addr, new_addr + new_len); +#ifdef CONFIG_GENERIC_VDSO + /* + * mremap() doesn't allow moving multiple vmas so we can limit + * the check to old_addr == vdso. + */ + if (old_addr == mm->context.vdso) + mm->context.vdso = new_addr; + +#endif /* CONFIG_GENERIC_VDSO */ } /* Conceal VM_ACCOUNT so old reservation is not undone */ -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions 2016-11-01 17:10 ` Christopher Covington @ 2016-11-01 17:23 ` Dmitry Safonov -1 siblings, 0 replies; 39+ messages in thread From: Dmitry Safonov @ 2016-11-01 17:23 UTC (permalink / raw) To: Christopher Covington Cc: crml, Will Deacon, linux-mm, Laurent Dufour, Arnd Bergmann, linux-arch, open list Hi Christopher, by this moment I got another patch for this. I hope, you don't mind if I send it concurrently. I haven't sent it yet as I was testing it in qemu. Thanks, Dmitry ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions @ 2016-11-01 17:23 ` Dmitry Safonov 0 siblings, 0 replies; 39+ messages in thread From: Dmitry Safonov @ 2016-11-01 17:23 UTC (permalink / raw) To: Christopher Covington Cc: crml, Will Deacon, linux-mm, Laurent Dufour, Arnd Bergmann, linux-arch, open list Hi Christopher, by this moment I got another patch for this. I hope, you don't mind if I send it concurrently. I haven't sent it yet as I was testing it in qemu. Thanks, Dmitry -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions 2016-11-01 17:23 ` Dmitry Safonov @ 2016-11-02 0:23 ` Christopher Covington -1 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-02 0:23 UTC (permalink / raw) To: Dmitry Safonov Cc: crml, Will Deacon, linux-mm, Laurent Dufour, Arnd Bergmann, linux-arch, open list On November 1, 2016 11:23:54 AM MDT, Dmitry Safonov <0x7f454c46@gmail.com> wrote: >Hi Christopher, > > by this moment I got another patch for this. I hope, you don't mind >if I send it concurrently. I haven't sent it yet as I was testing it in > qemu. Please do, that'd be great. Thanks, Cov -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. Sent from my Snapdragon powered Android device with K-9 Mail. Please excuse my brevity. ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions @ 2016-11-02 0:23 ` Christopher Covington 0 siblings, 0 replies; 39+ messages in thread From: Christopher Covington @ 2016-11-02 0:23 UTC (permalink / raw) To: Dmitry Safonov Cc: crml, Will Deacon, linux-mm, Laurent Dufour, Arnd Bergmann, linux-arch, open list On November 1, 2016 11:23:54 AM MDT, Dmitry Safonov <0x7f454c46@gmail.com> wrote: >Hi Christopher, > > by this moment I got another patch for this. I hope, you don't mind >if I send it concurrently. I haven't sent it yet as I was testing it in > qemu. Please do, that'd be great. Thanks, Cov -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. Sent from my Snapdragon powered Android device with K-9 Mail. Please excuse my brevity. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2016-11-07 23:58 UTC | newest] Thread overview: 39+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-11-01 17:10 [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:10 ` [RFC v2 2/7] arm: Use generic VDSO unmap and remap Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:18 ` Russell King - ARM Linux 2016-11-01 17:18 ` Russell King - ARM Linux 2016-11-01 17:18 ` Russell King - ARM Linux 2016-11-01 17:10 ` [RFC v2 3/7] arm64: Use unsigned long for VDSO Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:10 ` [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:10 ` [RFC v2 5/7] powerpc: Rename context.vdso_base to context.vdso Christopher Covington 2016-11-01 17:10 ` Christopher Covington 2016-11-04 4:58 ` Michael Ellerman 2016-11-04 4:58 ` Michael Ellerman 2016-11-04 20:13 ` Will Deacon 2016-11-04 20:13 ` Will Deacon 2016-11-07 8:01 ` Michael Ellerman 2016-11-07 8:01 ` Michael Ellerman 2016-11-01 17:11 ` [RFC v2 6/7] mm/powerpc: Use generic VDSO remap and unmap functions Christopher Covington 2016-11-01 17:11 ` Christopher Covington 2016-11-04 4:59 ` Michael Ellerman 2016-11-04 4:59 ` Michael Ellerman 2016-11-07 20:20 ` Laurent Dufour 2016-11-07 20:20 ` Laurent Dufour 2016-11-07 23:51 ` Michael Ellerman 2016-11-07 23:51 ` Michael Ellerman 2016-11-01 17:11 ` [RFC v2 7/7] mm: Remove mm-arch-hooks.h Christopher Covington 2016-11-01 17:11 ` Christopher Covington 2016-11-01 17:11 ` Christopher Covington 2016-11-01 17:11 ` Christopher Covington 2016-11-01 17:11 ` Christopher Covington 2016-11-01 17:23 ` [RFC v2 1/7] mm: Provide generic VDSO unmap and remap functions Dmitry Safonov 2016-11-01 17:23 ` Dmitry Safonov 2016-11-02 0:23 ` Christopher Covington 2016-11-02 0:23 ` Christopher Covington
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.