Skip to content

split exception table content out of module.h into extable.h

Paul Gortmaker linux-alpha linux-arch linux-arm-kernel linux-m68k linux-mips linux-parisc linux-s390 linuxppc-dev lkml sparclinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14exceptions: fork exception table content from module.h into extable.hinclude/linux/extable.h include/linux/module.h+32 -251 reply
2/14x86: migrate exception table users off module.h and onto extable.harch/x86/kernel/kprobes/core.c arch/x86/kernel/kprobes/opt.c arch/x86/mm/extable.c +1 more+4 -41 reply
3/14arm: migrate exception table users off module.h and onto extable.harch/arm/mm/extable.c arch/arm/mm/fault.c+2 -20 replies
4/14arm64: migrate exception table users off module.h and onto extable.harch/arm64/kernel/probes/kprobes.c arch/arm64/mm/extable.c arch/arm64/mm/fault.c+3 -31 reply
5/14mips: migrate exception table users off module.h and onto extable.harch/mips/kernel/module.c arch/mips/kernel/traps.c arch/mips/mm/extable.c+3 -20 replies
6/14sparc: migrate exception table users off module.h and onto extable.harch/sparc/kernel/kprobes.c arch/sparc/kernel/traps_64.c arch/sparc/kernel/unaligned_64.c +2 more+5 -50 replies
7/14powerpc: migrate exception table users off module.h and onto extable.harch/powerpc/kernel/kprobes.c arch/powerpc/mm/fault.c+2 -20 replies
8/14m68k: migrate exception table users off module.h and onto extable.harch/m68k/kernel/signal.c+1 -10 replies
9/14s390: migrate exception table users off module.h and onto extable.harch/s390/kernel/early.c arch/s390/kernel/kprobes.c arch/s390/kernel/traps.c +1 more+6 -30 replies
10/14tile: migrate exception table users off module.h and onto extable.harch/tile/kernel/unaligned.c arch/tile/mm/extable.c arch/tile/mm/fault.c+3 -30 replies
11/14alpha: migrate exception table users off module.h and onto extable.harch/alpha/kernel/traps.c arch/alpha/mm/fault.c+2 -20 replies
12/14parisc: migrate exception table users off module.h and onto extable.harch/parisc/mm/fault.c+1 -10 replies
13/14core: migrate exception table users off module.h and onto extable.hinit/main.c kernel/extable.c kernel/module.c+3 -00 replies
14/14module.h: remove extable.h include now users have migratedinclude/linux/module.h+0 -10 replies

Reviews trailers per patch

2 of 14 patches have a Reviewed-by or Acked-by.

PatchIngo MolnarCatalin Marinas
1/14
2/14A-b
3/14
4/14A-b
5/14
6/14
7/14
8/14
9/14
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC/PATCH 00/14] split exception table content out of module.h into extable.h

[RFC: Not looking for detailed review given the merge window is open.
As long as nobody thinks the general idea is horrible, I'll expand into more fringe arch and resend in 2wks and get it added then to linux-next.]

While doing an audit looking for unnecessary instances of module.h inclusion across arch/x86/ I found a significant number of includes of module.h were for things like search_exception_table and friends.

For historical reasons (i.e. pre-git) the exception table stuff was buried in the middle of the module.h file. So we have core kernel files that are completely non-modular (both arch specific and arch independent) that are just including module.h for this.

The converse is also true, in that conventional drivers, be they for filesystems or actual hardware peripherals or similar, do not normally care about the exception tables.

Here we fork the exception table content out of module.h into a new extable.h file. The gain here is that module.h gets a bit smaller; a win for all modular drivers that we build for allmodconfig. Also most core files that only need exception table stuff get to shed an include of module.h that brings in lots of extra stuff and just looks generally out of place. They use the tiny extable.h instead.

We temporarily include extable.h into the module.h itself. Then we will work our way across the arch independent and arch specific files needing just exception table content, and move them off module.h and onto extable.h

Once that is done, we can remove the extable.h from module.h and in doing it like this, we avoid introducing build failures into the git history.

We have the option of taking this final one line commit and pushing it out a complete release if we want to open up a bigger window for converting some of the more fringe archtectures.

I've converted about a dozen architectures here w/o issue; that largely reflects what I currently have toolchains for. Build testing seems necessary in all instances, since the odds are high that the module.h presence was hiding implicit use of other headers, as was the case for s390.

Paul.

Signature · 89 lines
Cc: Andrew Morton <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Matt Turner <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Russell King <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Paul Gortmaker (14):
  exceptions: fork exception table content from module.h into extable.h
  x86: migrate exception table users off module.h and onto extable.h
  arm: migrate exception table users off module.h and onto extable.h
  arm64: migrate exception table users off module.h and onto extable.h
  mips: migrate exception table users off module.h and onto extable.h
  sparc: migrate exception table users off module.h and onto extable.h
  powerpc: migrate exception table users off module.h and onto extable.h
  m68k: migrate exception table users off module.h and onto extable.h
  s390: migrate exception table users off module.h and onto extable.h
  tile: migrate exception table users off module.h and onto extable.h
  alpha: migrate exception table users off module.h and onto extable.h
  parisc: 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/arm64/kernel/probes/kprobes.c |  2 +-
 arch/arm64/mm/extable.c            |  2 +-
 arch/arm64/mm/fault.c              |  2 +-
 arch/m68k/kernel/signal.c          |  2 +-
 arch/mips/kernel/module.c          |  1 +
 arch/mips/kernel/traps.c           |  2 +-
 arch/mips/mm/extable.c             |  2 +-
 arch/parisc/mm/fault.c             |  2 +-
 arch/powerpc/kernel/kprobes.c      |  2 +-
 arch/powerpc/mm/fault.c            |  2 +-
 arch/s390/kernel/early.c           |  2 +-
 arch/s390/kernel/kprobes.c         |  2 ++
 arch/s390/kernel/traps.c           |  3 ++-
 arch/s390/mm/fault.c               |  2 +-
 arch/sparc/kernel/kprobes.c        |  2 +-
 arch/sparc/kernel/traps_64.c       |  2 +-
 arch/sparc/kernel/unaligned_64.c   |  2 +-
 arch/sparc/mm/fault_64.c           |  2 +-
 arch/sparc/mm/init_64.c            |  2 +-
 arch/tile/kernel/unaligned.c       |  2 +-
 arch/tile/mm/extable.c             |  2 +-
 arch/tile/mm/fault.c               |  2 +-
 arch/x86/kernel/kprobes/core.c     |  2 +-
 arch/x86/kernel/kprobes/opt.c      |  2 +-
 arch/x86/mm/extable.c              |  2 +-
 arch/x86/mm/fault.c                |  2 +-
 include/linux/extable.h            | 30 ++++++++++++++++++++++++++++++
 include/linux/module.h             | 26 +-------------------------
 init/main.c                        |  1 +
 kernel/extable.c                   |  1 +
 kernel/module.c                    |  1 +
 35 files changed, 66 insertions(+), 53 deletions(-)
 create mode 100644 include/linux/extable.h

-- 
2.8.4