alloc_tag: hide execmem_vmap() on !MMU
Subsystems (2)
PATCH 1/1 alloc_tag: hide execmem_vmap() on !MMU
From: Arnd Bergmann <[email protected]>
The newly added function fails to link on nommu kernels, but is also not needed there:
ld.lld-20: error: undefined symbol: __get_vm_area_node
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
referenced by
execmem.c
mm/execmem.o:(execmem_vmap) in archive vmlinux.a
referenced byexecmem.c
mm/execmem.o:(execmem_vmap) in archive vmlinux.a
--- mm/execmem.c | 2 ++ 1 file changed, 2 insertions(+)
mm/execmem.c +2 -0
@@ -368,6 +368,7 @@ void execmem_free(void *ptr)vfree (ptr); } +#ifdef CONFIG_MMU struct vm_struct *execmem_vmap (size_t size) {struct execmem_range *range = &execmem_info->ranges[EXECMEM_MODULE_DATA ];
@@ -383,6 +384,7 @@ struct vm_struct *execmem_vmap(size_t size) return area; } +#endif void *execmem_update_copy (void *dst,const void *src,size_t size) {
Signature · 1 line
2.39.5
Quoted 30 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The newly added function fails to link on nommu kernels, but is also not needed there:
ld.lld-20: error: undefined symbol:
__get_vm_area_nodeQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
referenced by
execmem.c
mm/execmem.o:(execmem_vmap) in archive vmlinux.a
referenced byexecmem.c
mm/execmem.o:(execmem_vmap) in archive vmlinux.aFixes 57bc3834fb6f ("alloc_tag: populate memory for module tags as needed")Signed-off-by Arnd Bergmann <[email protected]>--- mm/execmem.c | 2 ++ 1 file changed, 2 insertions(+)mm/execmem.c +1
-0@@ -368,6 +368,7 @@ void execmem_free(void *ptr)vfree (ptr); } +#ifdef CONFIG_MMU struct vm_struct *execmem_vmap (size_t size) {struct execmem_range *range = &execmem_info->ranges[EXECMEM_MODULE_DATA ];
mm/execmem.c struct vm_struct *execmem_vmap(size_t size) · line 387
Quoted 4 lines
mm/execmem.c +1
-0@@ -383,6 +384,7 @@ struct vm_struct *execmem_vmap(size_t size) return area; } +#endif
Nit: there is already #ifdef CONFIG_MMU block in execmem.c, better to move execmem_vmap() there
Other than that
Quoted 5 lines
mm/execmem.c +0
-0void *execmem_update_copy (void *dst,const void *src,size_t size) {Signature · 1 line
2.39.5
Signature · 2 lines
Sincerely yours, Mike.
Quoted 40 lines · Mike Rapoport
Quoted 30 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The newly added function fails to link on nommu kernels, but is also not needed there:
ld.lld-20: error: undefined symbol:
__get_vm_area_nodeQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
referenced by
execmem.c
mm/execmem.o:(execmem_vmap) in archive vmlinux.a
referenced byexecmem.c
mm/execmem.o:(execmem_vmap) in archive vmlinux.aFixes 57bc3834fb6f ("alloc_tag: populate memory for module tags as needed")Signed-off-by Arnd Bergmann <[email protected]>--- mm/execmem.c | 2 ++ 1 file changed, 2 insertions(+)mm/execmem.c +1
-0@@ -368,6 +368,7 @@ void execmem_free(void *ptr)vfree (ptr); } +#ifdef CONFIG_MMU struct vm_struct *execmem_vmap (size_t size) {struct execmem_range *range = &execmem_info->ranges[EXECMEM_MODULE_DATA ];mm/execmem.c struct vm_struct *execmem_vmap(size_t size) · line 387
Quoted 4 lines
mm/execmem.c +1
-0@@ -383,6 +384,7 @@ struct vm_struct *execmem_vmap(size_t size) return area; } +#endif Nit: there is already #ifdef
CONFIG_MMUblock inexecmem.c, better to moveexecmem_vmap()there
Quoted 3 lines
Other than that
Thanks for the fix but execmem_vmap() is used if CONFIG_MEM_ALLOC_PROFILING=y. Please give me an hour to post a fix dealing with that.
Quoted 10 lines
Quoted 6 lines
mm/execmem.c +0
-1void *execmem_update_copy (void *dst,const void *src,size_t size) { --2.39.5
--
Sincerely yours,
Mike.