From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Jason Baron <jbaron@redhat.com>
Subject: [PATCH 0/2] [RFC] jump-label/x86: Compress jmps to 2 bytes where possible
Date: Wed, 18 Jan 2012 14:53:40 -0500 [thread overview]
Message-ID: <20120118195340.767928915@goodmis.org> (raw)
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(-)
next reply other threads:[~2012-01-18 19:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 19:53 Steven Rostedt [this message]
2012-01-18 19:53 ` [PATCH 1/2] jump labels: Add infrastructure to update jump labels at compile time Steven Rostedt
2012-01-19 14:24 ` Mathieu Desnoyers
2012-01-19 14:52 ` Steven Rostedt
2012-01-18 19:53 ` [PATCH 2/2] jump labels/x86: Use etiher 5 byte or 2 byte jumps Steven Rostedt
2012-01-19 12:22 ` Ingo Molnar
2012-01-19 14:41 ` Mathieu Desnoyers
2012-01-19 14:46 ` H. Peter Anvin
2012-01-19 14:58 ` Steven Rostedt
2012-01-19 15:19 ` Steven Rostedt
2012-01-19 14:56 ` Steven Rostedt
2012-01-19 14:58 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120118195340.767928915@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox