From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@osdl.org>, Chaz Masden <zamsden@gmail.com>,
Andi Kleen <ak@muc.de>, Petr Vandrovec <petr@vmware.com>,
Chris Wright <chrisw@sous-sol.org>,
Virtualization Mailing List <virtualization@lists.osdl.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [RFC, PATCH 5/5] Paravirt_ops export.patch
Date: Sun, 22 Apr 2007 09:20:26 -0700 [thread overview]
Message-ID: <462B8B4A.6060408@goop.org> (raw)
In-Reply-To: <m1y7kkzdon.fsf@ebiederm.dsl.xmission.com>
Eric W. Biederman wrote:
> Yes. Has anyone thought more about David Miller's suggesting of just
> using the linker and not doing the fancy binary replacement?
>
> Especially if you are beginning to reimplement the linker anyway.
I did spend some effort on it. The first stumbling block was getting
the reloc info into the vmlinux itself, rather than putting it in the
bzImage wrapper. It was getting into a complex kallsyms-like
arrangement, which I wasn't feeling equipped to solve.
But one of the objections to making paravirt_ops calls where there would
otherwise be small inline functions is that the calls significantly add
to the register pressure and therefore would result in worse code. This
is particularly acute in the assember parts, since there are places in
entry.S where paravirt operations need to be performed, but there are no
available registers.
We currently deal with that by including push/pops around the actual
indirect callsite, which the patcher can either choose to overwrite (if
the inserted sequence doesn't clobber registers anyway), or replace with
a set which is appropriate for the callsite and the inserted code.
Also, in many cases we can usefully patch inline code and eliminate the
need for any call at all. To do this, we need to know 1) the start and
size of the replacable code, 2) the register environment at that site,
and 3) what to actually put there.
The reloc info only gives us 3 (by looking at the call/jmp instruction's
target), and 1 to a limited extent (we get 5 bytes). Unfortunately, 5
bytes is too small for anything except patching in native versions, and
the surrounding generated code will still assume the patched code will
clobber all the normal C caller-save registers.
J
next prev parent reply other threads:[~2007-04-22 16:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-20 1:53 [RFC, PATCH 5/5] Paravirt_ops export.patch Zachary Amsden
2007-04-20 5:10 ` Jeremy Fitzhardinge
2007-04-22 14:28 ` Eric W. Biederman
2007-04-22 16:20 ` Jeremy Fitzhardinge [this message]
2007-04-22 16:59 ` Zachary Amsden
2007-04-22 17:31 ` Jeremy Fitzhardinge
2007-04-23 20:53 ` Zachary Amsden
2007-04-23 21:14 ` Eric W. Biederman
2007-04-23 21:40 ` Zachary Amsden
2007-04-23 21:29 ` Jeremy Fitzhardinge
2007-04-23 21:54 ` Zachary Amsden
2007-04-23 22:15 ` Jeremy Fitzhardinge
2007-04-23 22:24 ` Zachary Amsden
2007-04-23 22:29 ` Andi Kleen
2007-04-22 23:57 ` Rusty Russell
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=462B8B4A.6060408@goop.org \
--to=jeremy@goop.org \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=chrisw@sous-sol.org \
--cc=ebiederm@xmission.com \
--cc=mingo@elte.hu \
--cc=petr@vmware.com \
--cc=virtualization@lists.osdl.org \
--cc=zamsden@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).