RFC jump-label/x86: Compress jmps to 2 bytes where possible
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | jump labels: Add infrastructure to update jump labels at compile timeMakefile arch/ scripts/ +3 more | +645 | 2 replies | |
| 2/2 | jump labels/x86: Use etiher 5 byte or 2 byte jumpsarch/ arch/ arch/ | +81 | 7 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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(-)