From: Zachary Amsden <zach@vmware.com>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Andi Kleen <ak@suse.de>,
virtualization <virtualization@lists.osdl.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Xen-devel <xen-devel@lists.xensource.com>,
Dan Hecht <dhecht@vmware.com>, Chris Wright <chrisw@sous-sol.org>
Subject: Re: [RFC, PATCH 5/24] i386 Vmi code patching
Date: Mon, 27 Mar 2006 17:48:54 -0800 [thread overview]
Message-ID: <44289606.4070902@vmware.com> (raw)
In-Reply-To: <200603271955_MC3-1-BBB1-E3F1@compuserve.com>
Chuck Ebbert wrote:
> In-Reply-To: <200603222115.46926.ak@suse.de>
>
> On Wed, 22 Mar 2006 21:15:44 +0100, Andi Kleen wrote:
>
>
>> On Monday 13 March 2006 19:02, Zachary Amsden wrote:
>>
>>> The VMI ROM detection and code patching mechanism is illustrated in
>>> setup.c. There ROM is a binary block published by the hypervisor, and
>>> and there are certainly implications of this. ROMs certainly have a
>>> history of being proprietary, very differently licensed pieces of
>>> software, and mostly under non-free licenses. Before jumping to the
>>> conclusion that this is a bad thing, let us consider more carefully
>>> why hiding the interface layer to the hypervisor is actually a good
>>> thing.
>>>
>> How about you fix all these issues you describe here first
>> and then submit it again?
>>
>> The disassembly stuff indeed doesn't look like something
>> that belongs in the kernel.
>>
>
> I think they put the disassembler in there as a joke. ;)
>
> It's not necessary for fixing up the call site, anyway. Something like
> this should work, assuming there is always a call in every vmi
> translation.
>
Very good observation. The code you illustrate is roughly what the
patch mechanism used to do. The disassembly serves one purpose, which
is incomplete in our current implementation. It provides live register
information and constant propagation that can be used by an inliner in
the VMI layer to inline hypervisor calls. This information gets encoded
naturally in the push sequence before the call instruction.
But considering it is currently incomplete, and most of the benefit can
be had be special casing just 4 VMI calls to allow selective inlining,
it does seem like a lot of complexity for little payoff. I really don't
like special casing, but in this scenario, it does seem to make sense.
And of the 4 VMI calls, only one (SetInterruptMask) takes an input, and
it takes that input in a fixed register.
Based on suggestions from Anthony Liguori and others, we are going to
drop this extra complexity - we can get to hypervisor inlining later.
Right now having the simplest and cleanest interface is more important.
Actually, adding the required padding for inlining is quite easy:
#define FILL(n) ".fill " #n "-1,1,0x66; nop"
static inline void local_irq_restore(const unsigned long flags)
{
vmi_wrap_call(
SetInterruptMask, "pushl %0; popfl" FILL(6),
VMI_NO_OUTPUT,
1, VMI_IREG1 (flags),
XCONC("cc", "memory"));
}
Now you have 8 bytes to overwrite, which is sufficient for byte
arithmetic operations to a memory address, plus a segment override.
This seems like a much simpler solution than run-time disassembly.
> - /*
> - * Don't printk - it may acquire spinlocks with
> - * partially completed VMI translations, causing
> - * nuclear meltdown of the core.
> - */
> - BUG();
> - return;
> - }
> - }
>
This part was a joke ;)
next prev parent reply other threads:[~2006-03-28 1:50 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-28 0:52 [RFC, PATCH 5/24] i386 Vmi code patching Chuck Ebbert
2006-03-28 1:48 ` Zachary Amsden [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-03-22 23:41 Volkmar Uhlig
2006-03-13 18:02 Zachary Amsden
2006-03-15 10:02 ` Chris Wright
2006-03-15 16:01 ` Zachary Amsden
2006-03-15 22:05 ` Anthony Liguori
2006-03-15 23:00 ` Pavel Machek
2006-03-17 0:51 ` Zachary Amsden
2006-03-17 10:08 ` Joshua LeVasseur
2006-03-17 21:11 ` Chris Wright
2006-03-18 0:49 ` Joshua LeVasseur
2006-03-16 19:10 ` Jan Engelhardt
2006-03-16 19:45 ` Rik van Riel
2006-03-16 21:54 ` Zachary Amsden
2006-03-22 20:15 ` Andi Kleen
2006-03-22 21:40 ` Chris Wright
2006-03-22 22:16 ` Zachary Amsden
2006-03-22 22:33 ` Daniel Arai
2006-03-22 23:02 ` Chris Wright
2006-03-22 22:51 ` Chris Wright
2006-03-22 23:36 ` Zachary Amsden
2006-03-23 0:41 ` Chris Wright
2006-03-23 0:54 ` Zachary Amsden
2006-03-23 1:06 ` Chris Wright
2006-03-23 4:04 ` Zachary Amsden
2006-03-23 11:42 ` Joshua LeVasseur
2006-03-23 0:31 ` Anthony Liguori
2006-03-23 0:40 ` Chris Wright
2006-03-23 9:25 ` Keir Fraser
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=44289606.4070902@vmware.com \
--to=zach@vmware.com \
--cc=76306.1226@compuserve.com \
--cc=ak@suse.de \
--cc=chrisw@sous-sol.org \
--cc=dhecht@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.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