Messages in this thread | | | Date | Wed, 18 Jan 2012 14:53:40 -0500 | From | Steven Rostedt <> | Subject | [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(-)
| |