Skip to contentSkip to conversation

Finalize separation of extable.h from module.h

PATCH Superseded Paul Gortmaker 4 participants 15 messages Jan 9, 2017 – Jan 24, 2017

Subsystems (6)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Finalize separation of extable.h from module.h

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-rc3 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
ia64: https://lkml.kernel.org/r/[email protected]

---

Cc Al Viro <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Chris Zankel <[email protected]>
Cc David Howells <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Matt Turner <[email protected]>
Cc Max Filippov <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Rich Felker <[email protected]>
Cc Russell King <[email protected]>
Cc Rusty Russell <[email protected]>
Cc Sudip Mukherjee <[email protected]>
Cc Tony Luck <[email protected]>
Cc Yoshinori Sato <[email protected]>

Paul Gortmaker (10):
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
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/arm/mm/extable.c             |  2 +-
 arch/arm/mm/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/mn10300/mm/extable.c         |  2 +-
 arch/mn10300/mm/misalignment.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/xtensa/mm/fault.c            |  2 +-
 include/linux/module.h            |  1 -
 init/main.c                       |  1 +
 kernel/extable.c                  |  1 +
 kernel/module.c                   |  1 +
 24 files changed, 63 insertions(+), 35 deletions(-)
 create mode 100644 arch/ia64/include/asm/exception.h
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/10 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
new file mode 100644
index 000000000000..d90236090e8c
@@ -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
index bfe13196f770..471044be2a3b 100644
@@ -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	1
 static __inline__ void *
 xlate_dev_mem_ptr(phys_addr_t p)
arch/ia64/kernel/kprobes.c +1 -1
index 45ff27e9edbb..55b18e1b67a8 100644
@@ -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
index 095bfaff82d0..d3e1f1ee465f 100644
@@ -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
index 9cd01c2200ee..e697403b0ec1 100644
@@ -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
index fa6ad95e992e..52b41dad9704 100644
@@ -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
#2 lore raw

PATCH v2 2/10 ia64: ensure exception table search users include extable.h

In reply to Paul Gortmaker

We 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
index d90236090e8c..6bb246dcdaeb 100644
@@ -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
index 55b18e1b67a8..f5f3a5e6fcd1 100644
@@ -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
index d3e1f1ee465f..8981ce98afb3 100644
@@ -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
index e697403b0ec1..99348d7f2255 100644
@@ -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
index 52b41dad9704..7f2feb21753c 100644
@@ -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
#3 lore raw

PATCH v2 3/10 m32r: migrate exception table users off module.h and onto extable.h

In reply to Paul Gortmaker

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.

---
 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
index 40ccf80d29cf..8ac8ba6ef60c 100644
@@ -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
index a3785d3644c2..a05dc3184594 100644
@@ -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
Acked-by on v2 3/10
#4 lore raw

Re: [PATCH 03/10] m32r: migrate exception table users off module.h and onto extable.h

Quoted 9 lines · Paul Gortmaker

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.

---

regards
sudip

#5 lore raw

PATCH v2 4/10 arm: migrate exception table users off module.h and onto extable.h

In reply to Paul Gortmaker

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.

---
 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
index 312e15e6d00b..f436f7439e46 100644
@@ -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
index 3a2e678b8d30..94de590db99e 100644
@@ -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
#6 lore raw

PATCH v2 5/10 alpha: migrate exception table users off module.h and onto extable.h

In reply to Paul Gortmaker

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.

Cc Richard Henderson <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Matt Turner <[email protected]>
---
 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
index 3328af7c2776..af2994206b4b 100644
@@ -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
index 83e9eee57a55..47948b4dd157 100644
@@ -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
#7 lore raw

PATCH v2 6/10 mn10300: migrate exception table users off module.h and onto extable.h

In reply to Paul Gortmaker

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.

---
 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
index 305de461cb8f..045a903ee6b9 100644
@@ -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
index 31d04da85743..b39a388825ae 100644
@@ -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
#8 lore raw

PATCH v2 7/10 xtensa: migrate exception table users off module.h and onto extable.h

In reply to Paul Gortmaker

This 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
index 2725e08ef353..a14df5aa98c8 100644
@@ -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
#9 lore raw

PATCH v2 8/10 sh: migrate exception table users off module.h and onto extable.h

In reply to Paul Gortmaker

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.

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
index a38d0c7b818f..c4f0fee812c3 100644
@@ -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
index 1653ff64b103..52a5e11247d1 100644
@@ -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
index dfdad72c61ca..9513fa7840aa 100644
@@ -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
index 9cfcbb5848e4..24a75d315dcb 100644
@@ -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
index 96edaff8c983..b90cdfad2c78 100644
@@ -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
#10 lore raw

PATCH v2 9/10 core: migrate exception table users off module.h and onto extable.h

In reply to Paul Gortmaker

These 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.

Cc Rusty Russell <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>
---
 init/main.c      | 1 +
 kernel/extable.c | 1 +
 kernel/module.c  | 1 +
 3 files changed, 3 insertions(+)
init/main.c +1 -0
index b0c9d6facef9..5b244bc1c176 100644
@@ -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
index e3beec4a2339..b25d9901e431 100644
@@ -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
index 5088784c0cf9..43b6fb20fdf4 100644
@@ -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
#11 lore raw

PATCH v2 10/10 module.h: remove extable.h include now users have migrated

In reply to Paul Gortmaker

With 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.

Cc Rusty Russell <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>
---
 include/linux/module.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/module.h +0 -1
index 7c84273d60b9..2e6df4c41c86 100644
@@ -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
#12 lore raw

Re: [PATCH 10/10] module.h: remove extable.h include now users have migrated

url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/Finalize-separation-of-extable-h-from-module-h/20170110-095123 config: openrisc-or1ksim_defconfig (attached as .config) compiler…

Hi Paul,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc3 next-20170106]
[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/Finalize-separation-of-extable-h-from-module-h/20170110-095123
config: openrisc-or1ksim_defconfig (attached as .config)
compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
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=openrisc

All error/warnings (new ones prefixed by >>):

arch/openrisc/mm/fault.c: In function 'do_page_fault':

>> arch/openrisc/mm/fault.c:240:3: error: implicit declaration of function 'search_exception_tables'
>> arch/openrisc/mm/fault.c:240:14: warning: assignment makes pointer from integer without a cast

vim +/search_exception_tables +240 arch/openrisc/mm/fault.c

61e85e36 Jonas Bonn 2011-06-04  224  no_context:
61e85e36 Jonas Bonn 2011-06-04  225  
61e85e36 Jonas Bonn 2011-06-04  226  	/* Are we prepared to handle this kernel fault?
61e85e36 Jonas Bonn 2011-06-04  227  	 *
61e85e36 Jonas Bonn 2011-06-04  228  	 * (The kernel has valid exception-points in the source
61e85e36 Jonas Bonn 2011-06-04  229  	 *  when it acesses user-memory. When it fails in one
61e85e36 Jonas Bonn 2011-06-04  230  	 *  of those points, we find it in a table and do a jump
61e85e36 Jonas Bonn 2011-06-04  231  	 *  to some fixup code that loads an appropriate error
61e85e36 Jonas Bonn 2011-06-04  232  	 *  code)
61e85e36 Jonas Bonn 2011-06-04  233  	 */
61e85e36 Jonas Bonn 2011-06-04  234  
61e85e36 Jonas Bonn 2011-06-04  235  	{
61e85e36 Jonas Bonn 2011-06-04  236  		const struct exception_table_entry *entry;
61e85e36 Jonas Bonn 2011-06-04  237  
61e85e36 Jonas Bonn 2011-06-04  238  		__asm__ __volatile__("l.nop 42");
61e85e36 Jonas Bonn 2011-06-04  239  
61e85e36 Jonas Bonn 2011-06-04 @240  		if ((entry = search_exception_tables(regs->pc)) != NULL) {
61e85e36 Jonas Bonn 2011-06-04  241  			/* Adjust the instruction pointer in the stackframe */
61e85e36 Jonas Bonn 2011-06-04  242  			regs->pc = entry->fixup;
61e85e36 Jonas Bonn 2011-06-04  243  			return;
61e85e36 Jonas Bonn 2011-06-04  244  		}
61e85e36 Jonas Bonn 2011-06-04  245  	}
61e85e36 Jonas Bonn 2011-06-04  246  
61e85e36 Jonas Bonn 2011-06-04  247  	/*
61e85e36 Jonas Bonn 2011-06-04  248  	 * Oops. The kernel tried to access some bad page. We'll have to

:::::: The code at line 240 was first introduced by commit :::::: 61e85e367535a7b6385b404bef93928768140f96 OpenRISC: Memory management

:::::: TO: Jonas Bonn <[email protected]>
:::::: CC: Jonas Bonn <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#13 lore raw

Re: [PATCH 10/10] module.h: remove extable.h include now users have migrated

In reply to Paul Gortmaker
url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/Finalize-separation-of-extable-h-from-module-h/20170110-095123 config: frv-defconfig (attached as .config) compiler: frv-linux-gcc (GCC)…

Hi Paul,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc3 next-20170106]
[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/Finalize-separation-of-extable-h-from-module-h/20170110-095123
config: frv-defconfig (attached as .config)
compiler: frv-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=frv

All error/warnings (new ones prefixed by >>):

arch/frv/mm/extable.c: In function 'search_exception_table':

>> arch/frv/mm/extable.c:43:10: error: implicit declaration of function 'search_exception_tables' [-Werror=implicit-function-declaration]
     extab = search_exception_tables(pc);
             ^~~~~~~~~~~~~~~~~~~~~~~
>> arch/frv/mm/extable.c:43:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     extab = search_exception_tables(pc);
           ^

cc1: some warnings being treated as errors

vim +/search_exception_tables +43 arch/frv/mm/extable.c

^1da177e Linus Torvalds 2005-04-16  27  		 * - we search for the return address (in LR) instead of the program counter
^1da177e Linus Torvalds 2005-04-16  28  		 * - it was probably during a clear_user()
^1da177e Linus Torvalds 2005-04-16  29  		 */
^1da177e Linus Torvalds 2005-04-16  30  		return (unsigned long) &__memset_user_error_handler;
^1da177e Linus Torvalds 2005-04-16  31  	}
018b8d12 David Howells  2006-01-08  32  
018b8d12 David Howells  2006-01-08  33  	if (__frame->lr == (unsigned long) &__memcpy_user_error_lr &&
^1da177e Linus Torvalds 2005-04-16  34  	    (unsigned long) &memcpy <= pc && pc < (unsigned long) &__memcpy_end
^1da177e Linus Torvalds 2005-04-16  35  	    ) {
^1da177e Linus Torvalds 2005-04-16  36  		/* the fault occurred in a protected memset
^1da177e Linus Torvalds 2005-04-16  37  		 * - we search for the return address (in LR) instead of the program counter
^1da177e Linus Torvalds 2005-04-16  38  		 * - it was probably during a copy_to/from_user()
^1da177e Linus Torvalds 2005-04-16  39  		 */
^1da177e Linus Torvalds 2005-04-16  40  		return (unsigned long) &__memcpy_user_error_handler;
^1da177e Linus Torvalds 2005-04-16  41  	}
^1da177e Linus Torvalds 2005-04-16  42  
018b8d12 David Howells  2006-01-08 @43  	extab = search_exception_tables(pc);
018b8d12 David Howells  2006-01-08  44  	if (extab)
018b8d12 David Howells  2006-01-08  45  		return extab->fixup;
^1da177e Linus Torvalds 2005-04-16  46  
018b8d12 David Howells  2006-01-08  47  	return 0;
^1da177e Linus Torvalds 2005-04-16  48  
^1da177e Linus Torvalds 2005-04-16  49  } /* end search_exception_table() */

:::::: The code at line 43 was first introduced by commit
:::::: 018b8d12bc85f8fb332239b11d919ea0724c49a4 [PATCH] frv: support module exception tables

:::::: TO: David Howells <[email protected]> :::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Acked-by on the v2 series
#14 lore raw
In reply to Paul Gortmaker

BTW, you missed Jeyu, the current module maintainer.

Not that we care, I think, it's pretty trivial:

Cheers,
Rusty.

Quoted 95 lines · Paul Gortmaker

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-rc3 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
ia64: https://lkml.kernel.org/r/[email protected]

---

Cc Al Viro <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Chris Zankel <[email protected]>
Cc David Howells <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Matt Turner <[email protected]>
Cc Max Filippov <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Rich Felker <[email protected]>
Cc Russell King <[email protected]>
Cc Rusty Russell <[email protected]>
Cc Sudip Mukherjee <[email protected]>
Cc Tony Luck <[email protected]>
Cc Yoshinori Sato <[email protected]>

Paul Gortmaker (10):
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
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/arm/mm/extable.c             |  2 +-
 arch/arm/mm/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/mn10300/mm/extable.c         |  2 +-
 arch/mn10300/mm/misalignment.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/xtensa/mm/fault.c            |  2 +-
 include/linux/module.h            |  1 -
 init/main.c                       |  1 +
 kernel/extable.c                  |  1 +
 kernel/module.c                   |  1 +
 24 files changed, 63 insertions(+), 35 deletions(-)
 create mode 100644 arch/ia64/include/asm/exception.h
Signature · 1 line
2.11.0