Skip to content

RFC jump-label/x86: Compress jmps to 2 bytes where possible

Steven Rostedt lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2jump labels: Add infrastructure to update jump labels at compile timeMakefile arch/Kconfig scripts/Makefile +3 more+645 -22 replies
2/2jump labels/x86: Use etiher 5 byte or 2 byte jumpsarch/x86/Kconfig arch/x86/include/asm/jump_label.h arch/x86/kernel/jump_label.c+81 -87 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] [RFC] jump-label/x86: Compress jmps to 2 bytes where possible

As discussed previously, it can save a lot of text space if we could use the 2 byte jump for jump labels instead of always using the 5 byte version. But to do this, the jmps must be put into the kernel first (always on). Then at compile time, the jmps are examined and converted to nops.

At boot up, the jump-labels are examined again and the nops are converted to the CPU native best 5 byte nops for just the 5 byte nop locations.

The actual op is examined to determine if the jmp was 2 or 5 bytes, and dealt with accordingly.

I forward ported old work I did before and cleaned it up a bit. This can also be made to make a "default on" case at compile time if necessary.

Thoughts?

-- Steve

Steven Rostedt (2):
jump labels: Add infrastructure to update jump labels at compile time jump labels/x86: Use etiher 5 byte or 2 byte jumps

----

 Makefile                          |    7 +
 arch/Kconfig                      |    6 +
 arch/x86/Kconfig                  |    1 +
 arch/x86/include/asm/jump_label.h |    2 +-
 arch/x86/kernel/jump_label.c      |   86 +++++++++-
 scripts/Makefile                  |    1 +
 scripts/Makefile.build            |   15 ++-
 scripts/update_jump_label.c       |  335 +++++++++++++++++++++++++++++++++++++
 scripts/update_jump_label.h       |  283 +++++++++++++++++++++++++++++++
 9 files changed, 726 insertions(+), 10 deletions(-)