xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [RFC v2 0/7] linux: add linker tables
@ 2016-02-19 13:45 Luis R. Rodriguez
  2016-02-19 13:45 ` [RFC v2 1/7] sections.h: add sections header to collect all section info Luis R. Rodriguez
                   ` (7 more replies)
  0 siblings, 8 replies; 46+ messages in thread
From: Luis R. Rodriguez @ 2016-02-19 13:45 UTC (permalink / raw)
  To: hpa, tglx, mingo, bp
  Cc: x86, linux-kernel, luto, boris.ostrovsky, rusty, david.vrabel,
	konrad.wilk, mcb30, jgross, ming.lei, gregkh, arnd, linux-arch,
	linux, benh, jbaron, ananth, anil.s.keshavamurthy, davem,
	masami.hiramatsu.pt, andriy.shevchenko, dwmw2, xen-devel,
	Luis R. Rodriguez

This is my v2 of the original linker table work [0], now with
six proof of concepts ports of existing code using custom section
with custom linker script modifications:

  * DEFINE_LINKTABLE_TEXT(char, kprobes);
  * DEFINE_LINKTABLE_DATA(struct jump_entry, __jump_table);
  * DEFINE_LINKTABLE_DATA(struct _ddebug, __verbose);
  * DEFINE_LINKTABLE_RO(struct builtin_fw, builtin_fw);
  * DEFINE_LINKTABLE_INIT(struct x86_init_fn, x86_init_fns);
  * DEFINE_LINKTABLE_INIT_DATA(unsigned long, _kprobe_blacklist);

I've tested all except jump tables, I'd appreaciate some help with that.

As requested by hpa I've used standard sections and by doing so it
gives us the ability to simply categorize any custom table by actual
section used.

To help avoid further unnecessary linker script modifications,
and to help bring some clarify to how all these works I went
to some lengths to give documentating standard kernel sections
a shot.

The implementation deviates now from iPXE's linker table
solution more in favor for what we're used to and expect on
Linux. This series leaves out the paravirt_enabled() changes,
and the x86 use of linker tables. The paravirt_enabled() stuff
is now being dealt with separately [1] [2], and the x86 use case
for this will be sent as a separate series for review.

Although the diffstat is large, that's mostly documentation
and the new code. If you skip that you get:

 54 files changed, 104 insertions(+), 136 deletions(-)

Most of the savings come from the ability to skip custom
linker table entries. The users space solutoin has a new home [3].

[0] http://1450217797-19295-1-git-send-email-mcgrof@do-not-panic.com
[1] http://kernelnewbies.org/KernelProjects/remove-paravirt-enabled
[2] http://lkml.kernel.org/r/1455887316-9223-1-git-send-email-mcgrof@kernel.org
[3] https://git.kernel.org/cgit/linux/kernel/git/mcgrof/linker-tables.git/

Luis R. Rodriguez (7):
  sections.h: add sections header to collect all section info
  tables.h: add linker table support
  firmware: port built-in section to linker table
  asm/sections: add a generic push_section_tbl()
  jump_label: port __jump_table to linker tables
  dynamic_debug: port to use linker tables
  kprobes: port to linker table

 Documentation/DocBook/Makefile           |   3 +-
 Documentation/DocBook/linker-tables.tmpl | 169 ++++++++
 Documentation/DocBook/sections.tmpl      |  99 +++++
 Documentation/kbuild/makefiles.txt       |  19 +
 arch/arc/kernel/vmlinux.lds.S            |   1 -
 arch/arm/include/asm/jump_label.h        |   4 +-
 arch/arm/kernel/entry-armv.S             |   2 +-
 arch/arm/kernel/vmlinux.lds.S            |   1 -
 arch/arm64/include/asm/jump_label.h      |   4 +-
 arch/avr32/kernel/entry-avr32b.S         |   4 +-
 arch/avr32/kernel/vmlinux.lds.S          |   1 -
 arch/blackfin/kernel/vmlinux.lds.S       |   1 -
 arch/c6x/kernel/vmlinux.lds.S            |   1 -
 arch/hexagon/kernel/vmlinux.lds.S        |   1 -
 arch/ia64/kernel/jprobes.S               |   2 +-
 arch/ia64/kernel/vmlinux.lds.S           |   1 -
 arch/ia64/lib/flush.S                    |   4 +-
 arch/metag/kernel/vmlinux.lds.S          |   1 -
 arch/microblaze/kernel/vmlinux.lds.S     |   1 -
 arch/mips/include/asm/jump_label.h       |   4 +-
 arch/mips/kernel/vmlinux.lds.S           |   1 -
 arch/mn10300/kernel/vmlinux.lds.S        |   1 -
 arch/nios2/kernel/vmlinux.lds.S          |   1 -
 arch/openrisc/kernel/vmlinux.lds.S       |   1 -
 arch/parisc/kernel/vmlinux.lds.S         |   1 -
 arch/powerpc/include/asm/jump_label.h    |   6 +-
 arch/powerpc/include/asm/ppc_asm.h       |   6 +-
 arch/powerpc/kernel/vmlinux.lds.S        |   1 -
 arch/s390/include/asm/jump_label.h       |   4 +-
 arch/s390/kernel/entry.S                 |   4 +-
 arch/s390/kernel/kprobes.c               |   2 +-
 arch/s390/kernel/mcount.S                |   2 +-
 arch/s390/kernel/vmlinux.lds.S           |   1 -
 arch/score/kernel/vmlinux.lds.S          |   1 -
 arch/sh/kernel/vmlinux.lds.S             |   1 -
 arch/sparc/include/asm/jump_label.h      |   4 +-
 arch/sparc/kernel/vmlinux.lds.S          |   1 -
 arch/sparc/mm/ultra.S                    |   2 +-
 arch/tile/kernel/vmlinux.lds.S           |   1 -
 arch/x86/include/asm/jump_label.h        |   9 +-
 arch/x86/kernel/cpu/microcode/core.c     |   7 +-
 arch/x86/kernel/kprobes/core.c           |  10 +-
 arch/x86/kernel/vmlinux.lds.S            |   1 -
 arch/x86/tools/relocs.c                  |   3 +
 drivers/base/firmware_class.c            |  11 +-
 firmware/Makefile                        |   2 +-
 include/asm-generic/sections.h           |  14 +-
 include/asm-generic/vmlinux.lds.h        |  47 +--
 include/linux/compiler.h                 |   3 +-
 include/linux/dynamic_debug.h            |   6 +-
 include/linux/jump_label.h               |   5 +-
 include/linux/kprobes.h                  |   7 +-
 include/linux/sections.h                 | 224 ++++++++++
 include/linux/tables.h                   | 696 +++++++++++++++++++++++++++++++
 kernel/jump_label.c                      |  16 +-
 kernel/kprobes.c                         |  16 +-
 kernel/module.c                          |   6 +-
 lib/dynamic_debug.c                      |  13 +-
 scripts/Makefile.build                   |   4 +-
 scripts/Makefile.clean                   |   1 +
 scripts/Makefile.lib                     |  12 +
 scripts/mod/modpost.c                    |   3 +-
 scripts/recordmcount.c                   |   3 +-
 scripts/recordmcount.pl                  |   2 +-
 tools/include/linux/sections.h           |  13 +
 65 files changed, 1355 insertions(+), 143 deletions(-)
 create mode 100644 Documentation/DocBook/linker-tables.tmpl
 create mode 100644 Documentation/DocBook/sections.tmpl
 create mode 100644 include/linux/sections.h
 create mode 100644 include/linux/tables.h
 create mode 100644 tools/include/linux/sections.h

-- 
2.7.0

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2016-07-21 23:53 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-19 13:45 [RFC v2 0/7] linux: add linker tables Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 1/7] sections.h: add sections header to collect all section info Luis R. Rodriguez
2016-02-19 16:23   ` Greg KH
2016-02-19 20:06     ` Luis R. Rodriguez
2016-02-19 21:25       ` Greg KH
2016-02-19 21:59         ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 2/7] tables.h: add linker table support Luis R. Rodriguez
2016-02-19 20:25   ` H. Peter Anvin
2016-02-19 21:48     ` Luis R. Rodriguez
2016-02-23 23:08       ` Luis R. Rodriguez
2016-02-23 23:22         ` H. Peter Anvin
2016-02-23 23:36           ` Luis R. Rodriguez
2016-02-24  0:06             ` H. Peter Anvin
2016-02-24  0:54               ` Luis R. Rodriguez
2016-02-19 20:33   ` H. Peter Anvin
2016-02-19 21:12     ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 3/7] firmware: port built-in section to linker table Luis R. Rodriguez
2016-02-29 10:12   ` David Woodhouse
2016-02-29 18:56     ` Luis R. Rodriguez
2016-05-02 18:34       ` Kees Cook
2016-05-02 18:41         ` Greg KH
2016-05-03 17:08           ` Luis R. Rodriguez
2016-05-03 17:07         ` Luis R. Rodriguez
2016-05-03 17:10           ` Luis R. Rodriguez
2016-05-03 17:11             ` Luis R. Rodriguez
2016-05-03 17:21             ` Kees Cook
2016-05-03 18:12             ` Greg KH
2016-03-01 16:10     ` James Bottomley
2016-03-01 17:54       ` Luis R. Rodriguez
2016-04-29 19:24         ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 4/7] asm/sections: add a generic push_section_tbl() Luis R. Rodriguez
2016-02-19 20:26   ` H. Peter Anvin
2016-02-19 21:06     ` Luis R. Rodriguez
2016-02-22  2:55       ` H. Peter Anvin
2016-02-26 14:56         ` Heiko Carstens
2016-05-20 19:53           ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 5/7] jump_label: port __jump_table to linker tables Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 6/7] dynamic_debug: port to use " Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 7/7] kprobes: port to linker table Luis R. Rodriguez
2016-02-19 14:15   ` Russell King - ARM Linux
2016-02-19 14:55     ` Luis R. Rodriguez
2016-02-22  1:34   ` 平松雅巳 / HIRAMATU,MASAMI
2016-02-23  0:52     ` [Xen-devel] " Luis R. Rodriguez
2016-07-21 23:53       ` Luis R. Rodriguez
2016-02-19 20:16 ` [RFC v2 0/7] linux: add linker tables H. Peter Anvin
2016-02-19 21:19   ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).