Finalize separation of extable.h from module.h
Subsystems (12)
v3 cover Finalize separation of extable.h from module.h
If you already read the v2 00/NN, then you can skip this v3; the only change is to add new arch specific patches that extended build coverage and more intelligent regex patterns lead to.
Updated copy of the original v2 00/NN text follows:
Some of the arch specific changes have already been picked up by the arch maintainers in v1, so I'm assuming the other folks just figured I'd ask Linus to pull the remainder. Which is the current plan ; soak this in linux-next on 4.10-rcN and request a pull in the next merge window.
So please shout if you are an arch maintainer and see something here you have questions or comments on. Otherwise, you don't have to do anything.
Once all the old users who expected extable content via module.h are gone, then and only then can we remove the back compat line as done in the final patch in this series.
I've been build testing this locally on a regular basis in with my other pending work, on a bunch of different architectures, so hopefully we don't see anything go pear shaped when it goes into sfr's linux-next.
The only real change in the v1 ---> v2 aside from dropping merged content was the restructuring in the ia64 based on comments from Al Viro to improve some header separation at the same time. I'd resent just those two for follow up comments and nobody seemed to have further suggestions. Note that I'm not able to run test ia64; just compile.
There was also a minor context refresh required due to the recent treewide asm/uaccess --> linux/uaccess change, which gave me the motivation to get this out of my queue and finalized.
RFC/V1: https://lkml.kernel.org/r/CA+55aFyDw_jK609LcjpWvVMTzCWuH6nLUXiZDeYC2tpSaZqhXA@mail.gmail.com
V2: https://lkml.kernel.org/r/[email protected]
ia64: https://lkml.kernel.org/r/[email protected]
---
Paul Gortmaker (20):
ia64: move ia64_done_with_exception out of asm/uaccess.h
ia64: ensure exception table search users include extable.h
m32r: migrate exception table users off module.h and onto extable.h
arm: migrate exception table users off module.h and onto extable.h
alpha: migrate exception table users off module.h and onto extable.h
mn10300: migrate exception table users off module.h and onto extable.h
xtensa: migrate exception table users off module.h and onto extable.h
sh: migrate exception table users off module.h and onto extable.h
frv: migrate exception table users off module.h and onto extable.h
openrisc: migrate exception table users off module.h and onto extable.h
sparc: migrate exception table users onto extable.h
nios2: migrate exception table users off module.h and onto extable.h
arc: migrate exception table users off module.h and onto extable.h
metag: migrate exception table users off module.h and onto extable.h
score: migrate exception table users off module.h and onto extable.h
unicore32: migrate exception table users off module.h and onto extable.h
microblaze: migrate exception table users off module.h and onto extable.h
hexagon: migrate exception table users off module.h and onto extable.h
core: migrate exception table users off module.h and onto extable.h module.h: remove extable.h include now users have migrated
arch/alpha/kernel/traps.c | 2 +- arch/alpha/mm/fault.c | 2 +- arch/arc/mm/extable.c | 3 ++- arch/arm/mm/extable.c | 2 +- arch/arm/mm/fault.c | 2 +- arch/frv/mm/extable.c | 2 +- arch/hexagon/mm/vm_fault.c | 2 +- arch/ia64/include/asm/exception.h | 35 +++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/uaccess.h | 15 --------------- arch/ia64/kernel/kprobes.c | 4 ++-- arch/ia64/kernel/traps.c | 6 ++++-- arch/ia64/kernel/unaligned.c | 4 +++- arch/ia64/mm/fault.c | 2 ++ arch/m32r/mm/extable.c | 2 +- arch/m32r/mm/fault.c | 2 +- arch/metag/mm/extable.c | 3 +-- arch/microblaze/mm/fault.c | 2 +- arch/mn10300/mm/extable.c | 2 +- arch/mn10300/mm/misalignment.c | 2 +- arch/nios2/mm/extable.c | 2 +- arch/nios2/mm/fault.c | 2 +- arch/openrisc/mm/fault.c | 2 +- arch/score/mm/extable.c | 2 +- arch/score/mm/fault.c | 2 +- arch/sh/include/asm/uaccess.h | 1 - arch/sh/kernel/kprobes.c | 2 +- arch/sh/kernel/traps.c | 3 ++- arch/sh/mm/extable_32.c | 2 +- arch/sh/mm/extable_64.c | 2 +- arch/sparc/mm/extable.c | 1 + arch/unicore32/mm/extable.c | 2 +- arch/unicore32/mm/fault.c | 2 +- arch/xtensa/mm/fault.c | 2 +- include/linux/module.h | 1 - init/main.c | 1 + kernel/extable.c | 1 + kernel/module.c | 1 + 37 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 arch/ia64/include/asm/exception.h
Signature · 1 line
2.11.0
PATCH v3 1/20 ia64: move ia64_done_with_exception out of asm/uaccess.h
Move ia64_done_with_exception out of asm/uaccess.h (which is widely used) and into asm/exception.h (like ARM has) and then ensure the few callers of it include this new header.
Most of the other C content in asm files is implemented in macro form. So we do that conversion at the same time as the move.
There are two C exception prototypes that move along with the macro. One of them will become redundant when we switch over to using the <linux/extable.h> instead of <linux/module.h> header in a subsequent commit.
Also relocate a couple of the automated asm --> linux uaccess conversions to preserve the linux and asm independent grouping, since we are in the file at that location anyway.
--- arch/ia64/include/asm/exception.h | 36 ++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/uaccess.h | 15 --------------- arch/ia64/kernel/kprobes.c | 2 +- arch/ia64/kernel/traps.c | 3 ++- arch/ia64/kernel/unaligned.c | 3 ++- arch/ia64/mm/fault.c | 1 + 6 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 arch/ia64/include/asm/exception.h
arch/ia64/include/asm/exception.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* 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. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ +#ifndef __ASM_EXCEPTION_H +#define __ASM_EXCEPTION_H + +struct pt_regs ; +struct exception_table_entry ; + +extern void ia64_handle_exception (struct pt_regs *regs, +const struct exception_table_entry *e); +extern const struct exception_table_entry *search_exception_tables (unsigned long addr); + +#define ia64_done_with_exception (regs) \ +({ \ + int __ex_ret = 0; \ + const struct exception_table_entry *e; \ + e = search_exception_tables((regs)->cr_iip + ia64_psr(regs)->ri); \ + if (e) { \ + ia64_handle_exception(regs, e); \ + __ex_ret = 1; \ + } \ + __ex_ret; \ +}) + +#endif /* __ASM_EXCEPTION_H */
arch/ia64/include/asm/uaccess.h +0 -15
@@ -353,21 +353,6 @@ struct exception_table_entry {int fixup;/* location-relative continuation addr.; if bit 2 is set, r9 is set to 0 */ }; -extern void ia64_handle_exception (struct pt_regs *regs,const struct exception_table_entry *e); -extern const struct exception_table_entry *search_exception_tables (unsigned long addr); - -static inline int -ia64_done_with_exception (struct pt_regs *regs) -{ -const struct exception_table_entry *e; - e =search_exception_tables (regs->cr_iip +ia64_psr (regs)->ri); -if (e) { -ia64_handle_exception (regs, e); -return 1 ; - } -return 0 ; -} -#define ARCH_HAS_TRANSLATE_MEM_PTR 1static __inline__void *xlate_dev_mem_ptr (phys_addr_t p)
arch/ia64/kernel/kprobes.c +1 -1
@@ -33,7 +33,7 @@#include <asm/pgtable.h> #include <asm/sections.h> -#include <linux/uaccess.h> +#include <asm/exception.h> extern void jprobe_inst_return (void );
arch/ia64/kernel/traps.c +2 -1
@@ -17,11 +17,12 @@#include <linux/kprobes.h> #include <linux/delay.h> /* for ssleep() */ #include <linux/kdebug.h> +#include <linux/uaccess.h> #include <asm/fpswa.h> #include <asm/intrinsics.h> #include <asm/processor.h> -#include <linux/uaccess.h> +#include <asm/exception.h> #include <asm/setup.h> fpswa_interface_t *fpswa_interface;
arch/ia64/kernel/unaligned.c +2 -1
@@ -18,11 +18,12 @@#include <linux/sched.h> #include <linux/tty.h> #include <linux/ratelimit.h> +#include <linux/uaccess.h> #include <asm/intrinsics.h> #include <asm/processor.h> #include <asm/rse.h> -#include <linux/uaccess.h> +#include <asm/exception.h> #include <asm/unaligned.h> extern int die_if_kernel (char *str,struct pt_regs *regs,long err);
arch/ia64/mm/fault.c +1 -0
@@ -15,6 +15,7 @@#include <asm/pgtable.h> #include <asm/processor.h> +#include <asm/exception.h> extern int die (char *,struct pt_regs *,long );
Signature · 1 line
2.11.0
PATCH v3 2/20 ia64: ensure exception table search users include extable.h
In reply to Paul GortmakerWe start with a delete of a duplicate prototype in asm/exception.h that no longer needs to exist, as it duplicates content in extable.h and since that header is so small, there is no point trying to avoid using it.
Then we make sure anyone using search_exception_tables directly or via the ia64_done_with_exception macro has included extable.h
In the process, we remove an include of moduleloader.h that was apparently not really required; it would have been fetching in module.h and hence the previous location of the exception search function prototypes, but we need not rely on that anymore.
--- arch/ia64/include/asm/exception.h | 1 - arch/ia64/kernel/kprobes.c | 2 +- arch/ia64/kernel/traps.c | 3 ++- arch/ia64/kernel/unaligned.c | 1 + arch/ia64/mm/fault.c | 1 + 5 files changed, 5 insertions(+), 3 deletions(-)
arch/ia64/include/asm/exception.h +0 -1
@@ -19,7 +19,6 @@ struct exception_table_entry;extern void ia64_handle_exception (struct pt_regs *regs,const struct exception_table_entry *e); -extern const struct exception_table_entry *search_exception_tables (unsigned long addr);#define ia64_done_with_exception (regs) \ ({ \
arch/ia64/kernel/kprobes.c +1 -1
@@ -28,7 +28,7 @@#include <linux/string.h> #include <linux/slab.h> #include <linux/preempt.h> -#include <linux/moduleloader.h> +#include <linux/extable.h> #include <linux/kdebug.h> #include <asm/pgtable.h>
arch/ia64/kernel/traps.c +2 -1
@@ -12,7 +12,8 @@#include <linux/sched.h> #include <linux/tty.h> #include <linux/vt_kern.h> /* For unblank_screen() */ -#include <linux/module.h> /* for EXPORT_SYMBOL */ +#include <linux/export.h> +#include <linux/extable.h> #include <linux/hardirq.h> #include <linux/kprobes.h> #include <linux/delay.h> /* for ssleep() */
arch/ia64/kernel/unaligned.c +1 -0
@@ -17,6 +17,7 @@#include <linux/kernel.h> #include <linux/sched.h> #include <linux/tty.h> +#include <linux/extable.h> #include <linux/ratelimit.h> #include <linux/uaccess.h>
arch/ia64/mm/fault.c +1 -0
@@ -7,6 +7,7 @@#include <linux/sched.h> #include <linux/kernel.h> #include <linux/mm.h> +#include <linux/extable.h> #include <linux/interrupt.h> #include <linux/kprobes.h> #include <linux/kdebug.h>
Signature · 1 line
2.11.0
PATCH v3 3/20 m32r: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThese files were only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
--- arch/m32r/mm/extable.c | 2 +- arch/m32r/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/m32r/mm/extable.c +1 -1
@@ -2,7 +2,7 @@* linux/arch/m32r/mm/extable.c */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> int fixup_exception (struct pt_regs *regs)
arch/m32r/mm/fault.c +1 -1
@@ -23,7 +23,7 @@#include <linux/tty.h> #include <linux/vt_kern.h> /* For unblank_screen() */ #include <linux/highmem.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> #include <asm/m32r.h>
Signature · 1 line
2.11.0
PATCH v3 4/20 arm: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThese files were only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
--- arch/arm/mm/extable.c | 2 +- arch/arm/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mm/extable.c +1 -1
@@ -1,7 +1,7 @@/* * linux/arch/arm/mm/extable.c */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> int fixup_exception (struct pt_regs *regs)
arch/arm/mm/fault.c +1 -1
@@ -8,7 +8,7 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/signal.h> #include <linux/mm.h> #include <linux/hardirq.h>
Signature · 1 line
2.11.0
PATCH v3 5/20 alpha: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThese files were only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
--- arch/alpha/kernel/traps.c | 2 +- arch/alpha/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/alpha/kernel/traps.c +1 -1
@@ -13,7 +13,7 @@#include <linux/sched.h> #include <linux/tty.h> #include <linux/delay.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/kallsyms.h> #include <linux/ratelimit.h>
arch/alpha/mm/fault.c +1 -1
@@ -22,7 +22,7 @@#include <linux/mman.h> #include <linux/smp.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> extern void die_if_kernel (char *,struct pt_regs *,long ,unsigned long *);
Signature · 1 line
2.11.0
PATCH v3 6/20 mn10300: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThese files were only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
--- arch/mn10300/mm/extable.c | 2 +- arch/mn10300/mm/misalignment.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mn10300/mm/extable.c +1 -1
@@ -8,7 +8,7 @@* as published by the Free Software Foundation; either version * 2 of the Licence, or (at your option) any later version. */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/spinlock.h> #include <linux/uaccess.h>
arch/mn10300/mm/misalignment.c +1 -1
@@ -8,7 +8,7 @@* as published by the Free Software Foundation; either version * 2 of the Licence, or (at your option) any later version. */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/string.h>
Signature · 1 line
2.11.0
PATCH v3 7/20 xtensa: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/xtensa/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/xtensa/mm/fault.c +1 -1
@@ -13,7 +13,7 @@*/ #include <linux/mm.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/hardirq.h> #include <linux/perf_event.h> #include <linux/uaccess.h>
Signature · 1 line
2.11.0
PATCH v3 8/20 sh: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThese files were only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
One uses "print_modules" so that prevents us removing module.h in that case, however.
We also delete a duplicate prototype that doesn't need to exist, as it duplicates content in extable.h
--- arch/sh/include/asm/uaccess.h | 1 - arch/sh/kernel/kprobes.c | 2 +- arch/sh/kernel/traps.c | 3 ++- arch/sh/mm/extable_32.c | 2 +- arch/sh/mm/extable_64.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/sh/include/asm/uaccess.h +0 -1
@@ -192,7 +192,6 @@ struct exception_table_entry {#endif int fixup_exception (struct pt_regs *regs); -const struct exception_table_entry *search_exception_tables (unsigned long addr);extern void *set_exception_table_vec (unsigned int vec,void *handler);
arch/sh/kernel/kprobes.c +1 -1
@@ -9,7 +9,7 @@* for more details. */ #include <linux/kprobes.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/ptrace.h> #include <linux/preempt.h> #include <linux/kdebug.h>
arch/sh/kernel/traps.c +2 -1
@@ -8,7 +8,8 @@#include <linux/hardirq.h> #include <linux/kernel.h> #include <linux/kexec.h> -#include <linux/module.h> +#include <linux/extable.h> +#include <linux/module.h> /* print_modules */ #include <asm/unwinder.h> #include <asm/traps.h>
arch/sh/mm/extable_32.c +1 -1
@@ -4,7 +4,7 @@* linux/arch/i386/mm/extable.c */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> int fixup_exception (struct pt_regs *regs)
arch/sh/mm/extable_64.c +1 -1
@@ -11,7 +11,7 @@* for more details. */ #include <linux/rwsem.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> extern unsigned long copy_user_memcpy, copy_user_memcpy_end;
Signature · 1 line
2.11.0
PATCH v3 9/20 frv: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/frv/mm/extable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/frv/mm/extable.c +1 -1
@@ -2,7 +2,7 @@* linux/arch/frv/mm/extable.c */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/spinlock.h> #include <linux/uaccess.h>
Signature · 1 line
2.11.0
PATCH v3 10/20 openrisc: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
--- arch/openrisc/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/openrisc/mm/fault.c +1 -1
@@ -17,7 +17,7 @@#include <linux/mm.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/sched.h> #include <linux/uaccess.h>
Signature · 1 line
2.11.0
PATCH v2 1/1 openrisc: migrate exception table users off module.h and onto extable.h
These files were only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
---
[v2: add traps.c to conversion, as without a toolchain, I'm at the
mercy of the things found by kbuild; fixing them iteratively... ]
arch/openrisc/kernel/traps.c | 2 +- arch/openrisc/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/openrisc/kernel/traps.c +1 -1
@@ -23,7 +23,7 @@#include <linux/init.h> #include <linux/sched.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/exception.h> #include <linux/kmod.h> #include <linux/string.h> #include <linux/errno.h>
arch/openrisc/mm/fault.c +1 -1
@@ -17,7 +17,7 @@#include <linux/mm.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/sched.h> #include <linux/uaccess.h>
Signature · 1 line
2.11.0
Stafford Horne
maintainerRe: [PATCH v2] openrisc: migrate exception table users off module.h and onto extable.h
Quoted 25 lines · Paul Gortmaker
These files were only including
module.hfor exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content inmodule.hthat we don't really need to compile these files.Reported-by kbuild test robot <[email protected]>Cc Jonas Bonn <[email protected]>Cc Stefan Kristiansson <[email protected]>Cc Stafford Horne <[email protected]>Cc openrisc at lists.librecores.orgSigned-off-by Paul Gortmaker <[email protected]>---
[v2: add
traps.cto conversion, as without a toolchain, I'm at the
mercy of the things found by kbuild; fixing them iteratively... ]arch/openrisc/kernel/traps.c | 2 +- arch/openrisc/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/openrisc/kernel/traps.c +0
-0
arch/openrisc/kernel/traps.c line 26
Quoted 5 lines
arch/openrisc/kernel/traps.c +1
-1@@ -23,7 +23,7 @@#include <linux/init.h> #include <linux/sched.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/exception.h>
Is this correct or did you want extable.h?
Quoted 19 lines
arch/openrisc/kernel/traps.c +0
-0#include <linux/kmod.h> #include <linux/string.h> #include <linux/errno.h> arch/openrisc/mm/fault.c +1
-1@@ -17,7 +17,7 @@#include <linux/mm.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/sched.h> #include <linux/uaccess.h> Signature · 1 line
2.11.0
Re: [PATCH v2] openrisc: migrate exception table users off module.h and onto extable.h
Quoted 21 lines · [Re: [PATCH v2] openrisc: migrate exception table users off module.h and onto…
Quoted 20 lines · Paul Gortmaker
These files were only including
module.hfor exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content inmodule.hthat we don't really need to compile these files.Reported-by kbuild test robot <[email protected]>Cc Jonas Bonn <[email protected]>Cc Stefan Kristiansson <[email protected]>Cc Stafford Horne <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>---
[v2: add
traps.cto conversion, as without a toolchain, I'm at the
mercy of the things found by kbuild; fixing them iteratively... ]arch/openrisc/kernel/traps.c | 2 +- arch/openrisc/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 12 lines
arch/openrisc/kernel/traps.c line 26
Quoted 10 lines
arch/openrisc/kernel/traps.c +1
-1@@ -23,7 +23,7 @@#include <linux/init.h> #include <linux/sched.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/exception.h> Is this correct or did you want
extable.h?
Gah, of course. Thanks for spotting that. It will be good to have a working cross compiler for or32 someday to spot thinko items like this.
Thanks,
Paul.
--
Quoted 20 lines
Quoted 20 lines
arch/openrisc/kernel/traps.c +0
-0#include <linux/kmod.h> #include <linux/string.h> #include <linux/errno.h> arch/openrisc/mm/fault.c +1
-1@@ -17,7 +17,7 @@#include <linux/mm.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/sched.h> #include <linux/uaccess.h> Signature · 1 line
2.11.0
PATCH v2 1/1 openrisc: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThese files were only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile these files.
---
[v2: add traps.c to conversion, as without a toolchain, I'm at the
mercy of the things found by kbuild; fixing them iteratively... ]
arch/openrisc/kernel/traps.c | 2 +- arch/openrisc/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/openrisc/kernel/traps.c +1 -1
@@ -23,7 +23,7 @@#include <linux/init.h> #include <linux/sched.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/exception.h> #include <linux/kmod.h> #include <linux/string.h> #include <linux/errno.h>
arch/openrisc/mm/fault.c +1 -1
@@ -17,7 +17,7 @@#include <linux/mm.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/sched.h> #include <linux/uaccess.h>
Signature · 1 line
2.11.0
PATCH v3 11/20 sparc: migrate exception table users onto extable.h
In reply to Paul GortmakerThis file was using module.h for search_exception_table. We've now separated that content out into its own file "extable.h" so now move over to that. Unlike most other instances, we can't delete the module.h include here since the file needs that for the within_module_init definition.
--- arch/sparc/mm/extable.c | 1 + 1 file changed, 1 insertion(+)
arch/sparc/mm/extable.c +1 -0
@@ -3,6 +3,7 @@*/ #include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> void sort_extable(struct exception_table_entry *start,
Signature · 1 line
2.11.0
PATCH v3 12/20 nios2: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/nios2/mm/extable.c | 2 +- arch/nios2/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/nios2/mm/extable.c +1 -1
@@ -8,7 +8,7 @@* for more details. */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> int fixup_exception (struct pt_regs *regs)
arch/nios2/mm/fault.c +1 -1
@@ -21,7 +21,7 @@#include <linux/ptrace.h> #include <linux/mman.h> #include <linux/mm.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> #include <linux/ptrace.h>
Signature · 1 line
2.11.0
Re: [PATCH 12/20] nios2: migrate exception table users off module.h and onto extable.h
Quoted 9 lines · Paul Gortmaker
This file was only including
module.hfor exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content inmodule.hthat we don't really need to compile this file.Reported-by kbuild test robot <[email protected]>Cc Ley Foon Tan <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
PATCH v3 13/20 arc: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file. Since the file does have some EXPORT_SYMBOL, we add export.h include.
--- arch/arc/mm/extable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arc/mm/extable.c +2 -1
@@ -8,7 +8,8 @@* Borrowed heavily from MIPS */ -#include <linux/module.h> +#include <linux/export.h> +#include <linux/extable.h> #include <linux/uaccess.h> int fixup_exception (struct pt_regs *regs)
Signature · 1 line
2.11.0
Re: [PATCH 13/20] arc: migrate exception table users off module.h and onto extable.h
Quoted 9 lines · Paul Gortmaker
This file was only including
module.hfor exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content inmodule.hthat we don't really need to compile this file. Since the file does have someEXPORT_SYMBOL, we addexport.hinclude.Cc Vineet Gupta <vgupta at synopsys.com>Cc linux-snps-arc at lists.infradead.orgSigned-off-by Paul Gortmaker <paul.gortmaker at windriver.com>
Thx,
-Vineet
PATCH v3 14/20 metag: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/metag/mm/extable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/metag/mm/extable.c +1 -2
@@ -1,5 +1,4 @@ - -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> int fixup_exception (struct pt_regs *regs)
Signature · 1 line
2.11.0
PATCH v3 15/20 score: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/score/mm/extable.c | 2 +- arch/score/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/score/mm/extable.c +1 -1
@@ -23,7 +23,7 @@* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <linux/module.h> +#include <linux/extable.h> int fixup_exception (struct pt_regs *regs) {
arch/score/mm/fault.c +1 -1
@@ -28,7 +28,7 @@#include <linux/kernel.h> #include <linux/mm.h> #include <linux/mman.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/string.h>
Signature · 1 line
2.11.0
PATCH v3 16/20 unicore32: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/unicore32/mm/extable.c | 2 +- arch/unicore32/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/unicore32/mm/extable.c +1 -1
@@ -9,7 +9,7 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> int fixup_exception (struct pt_regs *regs)
arch/unicore32/mm/fault.c +1 -1
@@ -9,7 +9,7 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/signal.h> #include <linux/mm.h> #include <linux/hardirq.h>
Signature · 1 line
2.11.0
PATCH v3 17/20 microblaze: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/microblaze/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/microblaze/mm/fault.c +1 -1
@@ -17,7 +17,7 @@* */ -#include <linux/module.h> +#include <linux/extable.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/kernel.h>
Signature · 1 line
2.11.0
PATCH v3 18/20 hexagon: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThis file was only including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and avoid all the extra header content in module.h that we don't really need to compile this file.
--- arch/hexagon/mm/vm_fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/hexagon/mm/vm_fault.c +1 -1
@@ -29,7 +29,7 @@#include <linux/uaccess.h> #include <linux/mm.h> #include <linux/signal.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/hardirq.h> /*
Signature · 1 line
2.11.0
PATCH v3 19/20 core: migrate exception table users off module.h and onto extable.h
In reply to Paul GortmakerThese files were including module.h for exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and where possible, avoid all the extra header content in module.h that we don't really need to compile these non-modular files.
Note:
init/main.c still needs module.h for __init_or_module kernel/extable.c still needs module.h for is_module_text_address
...and so we don't get the benefit of removing module.h from the cpp feed for these two files, unlike the almost universal 1:1 exchange of module.h for extable.h we were able to do in the arch dirs.
--- init/main.c | 1 + kernel/extable.c | 1 + kernel/module.c | 1 + 3 files changed, 3 insertions(+)
init/main.c +1 -0
@@ -12,6 +12,7 @@#define DEBUG /* Enable initcall_debug */ #include <linux/types.h> +#include <linux/extable.h> #include <linux/module.h> #include <linux/proc_fs.h> #include <linux/kernel.h>
kernel/extable.c +1 -0
@@ -17,6 +17,7 @@*/ #include <linux/ftrace.h> #include <linux/memory.h> +#include <linux/extable.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/init.h>
kernel/module.c +1 -0
@@ -17,6 +17,7 @@Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <linux/export.h> +#include <linux/extable.h> #include <linux/moduleloader.h> #include <linux/trace_events.h> #include <linux/init.h>
Signature · 1 line
2.11.0
Re: core: migrate exception table users off module.h and onto extable.h
+++ Paul Gortmaker [22/01/17 11:32 -0500]:
Quoted 10 lines
These files were including
module.hfor exception table related functions. We've now separated that content out into its own file "extable.h" so now move over to that and where possible, avoid all the extra header content inmodule.hthat we don't really need to compile these non-modular files.Note:
init/main.cstill needsmodule.hfor__init_or_modulekernel/extable.cstill needsmodule.hforis_module_text_address
Quoted 8 lines
...and so we don't get the benefit of removing
module.hfrom the cpp feed for these two files, unlike the almost universal 1:1 exchange ofmodule.hforextable.hwe were able to do in the arch dirs.Cc Rusty Russell <[email protected]>Cc Andrew Morton <[email protected]>Cc Linus Torvalds <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
For the module.c bit:
PATCH v3 20/20 module.h: remove extable.h include now users have migrated
In reply to Paul GortmakerWith hopefully most/all users of module.h that were looking for exception table functions moved over to the new extable.h header, we can remove the back-compat include that let us transition without introducing build regressions.
--- include/linux/module.h | 1 - 1 file changed, 1 deletion(-)
include/linux/module.h +0 -1
@@ -18,7 +18,6 @@#include <linux/moduleparam.h> #include <linux/jump_label.h> #include <linux/export.h> -#include <linux/extable.h> /* only as arch move module.h -> extable.h */ #include <linux/rbtree_latch.h> #include <linux/percpu.h>
Signature · 1 line
2.11.0
kbuild test robot
build botRe: [PATCH 20/20] module.h: remove extable.h include now users have migrated
url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/ia64-move-ia64_done_with_exception-out-of-asm-uaccess-h/20170123-004155 config: cris-etraxfs_defconfig (attached as .config) compiler…
Hi Paul,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc5 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/ia64-move-ia64_done_with_exception-out-of-asm-uaccess-h/20170123-004155
config: cris-etraxfs_defconfig (attached as .config)
compiler: cris-linux-gcc (GCC) 6.2.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=cris
All error/warnings (new ones prefixed by >>):
arch/cris/arch-v32/kernel/traps.c: In function 'fixup_BUG':
>> arch/cris/arch-v32/kernel/traps.c:159:11: error: implicit declaration of function 'search_exception_tables' [-Werror=implicit-function-declaration]
fixup = search_exception_tables(instruction_pointer(regs) - 2);
^~~~~~~~~~~~~~~~~~~~~~~
>> arch/cris/arch-v32/kernel/traps.c:159:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
fixup = search_exception_tables(instruction_pointer(regs) - 2);
^cc1: some warnings being treated as errors
vim +/search_exception_tables +159 arch/cris/arch-v32/kernel/traps.c
51533b61 Mikael Starvik 2005-07-27 143
9ce1ea75 Jesper Nilsson 2007-12-03 144 void fixup_BUG(struct pt_regs *regs)
51533b61 Mikael Starvik 2005-07-27 145 {
9ce1ea75 Jesper Nilsson 2007-12-03 146 BUG_regs = *regs;
9ce1ea75 Jesper Nilsson 2007-12-03 147
9ce1ea75 Jesper Nilsson 2007-12-03 148 #ifdef CONFIG_DEBUG_BUGVERBOSE
9ce1ea75 Jesper Nilsson 2007-12-03 149 /*
9ce1ea75 Jesper Nilsson 2007-12-03 150 * Fixup the BUG arguments through exception handlers.
9ce1ea75 Jesper Nilsson 2007-12-03 151 */
9ce1ea75 Jesper Nilsson 2007-12-03 152 {
9ce1ea75 Jesper Nilsson 2007-12-03 153 const struct exception_table_entry *fixup;
9ce1ea75 Jesper Nilsson 2007-12-03 154
9ce1ea75 Jesper Nilsson 2007-12-03 155 /*
9ce1ea75 Jesper Nilsson 2007-12-03 156 * ERP points at the "break 14" + 2, compensate for the 2
9ce1ea75 Jesper Nilsson 2007-12-03 157 * bytes.
9ce1ea75 Jesper Nilsson 2007-12-03 158 */
9ce1ea75 Jesper Nilsson 2007-12-03 @159 fixup = search_exception_tables(instruction_pointer(regs) - 2);
9ce1ea75 Jesper Nilsson 2007-12-03 160 if (fixup) {
9ce1ea75 Jesper Nilsson 2007-12-03 161 /* Adjust the instruction pointer in the stackframe. */
9ce1ea75 Jesper Nilsson 2007-12-03 162 instruction_pointer(regs) = fixup->fixup;
9ce1ea75 Jesper Nilsson 2007-12-03 163 arch_fixup(regs);
51533b61 Mikael Starvik 2005-07-27 164 }
9ce1ea75 Jesper Nilsson 2007-12-03 165 }
9ce1ea75 Jesper Nilsson 2007-12-03 166 #else
9ce1ea75 Jesper Nilsson 2007-12-03 167 /* Dont try to lookup the filename + line, just dump regs. */:::::: The code at line 159 was first introduced by commit
:::::: 9ce1ea751f7256b2248321c2427612a295f15137 CRIS v32: Update and improve kernel/traps.c
:::::: TO: Jesper Nilsson <[email protected]> :::::: CC: Jesper Nilsson <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH 20/20] module.h: remove extable.h include now users have migrated
Quoted 8 lines · [Re: [PATCH 20/20] module.h: remove extable.h include now users have migrated]…
Hi Paul,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc5 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/ia64-move-ia64_done_with_exception-out-of-asm-uaccess-h/20170123-004155 config: cris-etraxfs_defconfig (attached as .config)
Thanks (once again) for the build coverage. I'd actually built cris (allmodconfig) but strangely enough it didn't show this particular defconfig issue. I'll fix it to ensure this file includes extable.h
Paul.
--
Quoted 55 lines
compiler: cris-linux-gcc (GCC) 6.2.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=crisAll error/warnings (new ones prefixed by >>):
arch/cris/arch-v32/kernel/traps.c: In function 'fixup_BUG':Quoted 1 line
Quoted 1 line
arch/cris/arch-v32/kernel/traps.c:159:11: error: implicit declaration of function 'search_exception_tables' [-Werror=implicit-function-declaration]fixup = search_exception_tables(instruction_pointer(regs) - 2); ^~~~~~~~~~~~~~~~~~~~~~~Quoted 1 line
Quoted 1 line
arch/cris/arch-v32/kernel/traps.c:159:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]fixup = search_exception_tables(instruction_pointer(regs) - 2); ^cc1: some warnings being treated as errors
vim +/search_exception_tables +159
arch/cris/arch-v32/kernel/traps.c51533b61 Mikael Starvik 2005-07-27 143 9ce1ea75 Jesper Nilsson 2007-12-03 144 void fixup_BUG(struct pt_regs *regs) 51533b61 Mikael Starvik 2005-07-27 145 { 9ce1ea75 Jesper Nilsson 2007-12-03 146 BUG_regs = *regs; 9ce1ea75 Jesper Nilsson 2007-12-03 147 9ce1ea75 Jesper Nilsson 2007-12-03 148 #ifdef CONFIG_DEBUG_BUGVERBOSE 9ce1ea75 Jesper Nilsson 2007-12-03 149 /* 9ce1ea75 Jesper Nilsson 2007-12-03 150 * Fixup the BUG arguments through exception handlers. 9ce1ea75 Jesper Nilsson 2007-12-03 151 */ 9ce1ea75 Jesper Nilsson 2007-12-03 152 { 9ce1ea75 Jesper Nilsson 2007-12-03 153 const struct exception_table_entry *fixup; 9ce1ea75 Jesper Nilsson 2007-12-03 154 9ce1ea75 Jesper Nilsson 2007-12-03 155 /* 9ce1ea75 Jesper Nilsson 2007-12-03 156 * ERP points at the "break 14" + 2, compensate for the 2 9ce1ea75 Jesper Nilsson 2007-12-03 157 * bytes. 9ce1ea75 Jesper Nilsson 2007-12-03 158 */ 9ce1ea75 Jesper Nilsson 2007-12-03 @159 fixup = search_exception_tables(instruction_pointer(regs) - 2); 9ce1ea75 Jesper Nilsson 2007-12-03 160 if (fixup) { 9ce1ea75 Jesper Nilsson 2007-12-03 161 /* Adjust the instruction pointer in the stackframe. */ 9ce1ea75 Jesper Nilsson 2007-12-03 162 instruction_pointer(regs) = fixup->fixup; 9ce1ea75 Jesper Nilsson 2007-12-03 163 arch_fixup(regs); 51533b61 Mikael Starvik 2005-07-27 164 } 9ce1ea75 Jesper Nilsson 2007-12-03 165 } 9ce1ea75 Jesper Nilsson 2007-12-03 166 #else 9ce1ea75 Jesper Nilsson 2007-12-03 167 /* Dont try to lookup the filename + line, just dump regs. */:::::: The code at line 159 was first introduced by commit
::::::9ce1ea751f7256b2248321c2427612a295f15137CRIS v32: Update and improvekernel/traps.c:::::: TO: Jesper Nilsson <[email protected]> :::::: CC: Jesper Nilsson <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: module.h: remove extable.h include now users have migrated
In reply to Paul Gortmaker+++ Paul Gortmaker [22/01/17 11:32 -0500]:
Quoted 9 lines
With hopefully most/all users of
module.hthat were looking for exception table functions moved over to the newextable.hheader, we can remove the back-compat include that let us transition without introducing build regressions.Cc Rusty Russell <[email protected]>Cc Andrew Morton <[email protected]>Cc Linus Torvalds <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>