From: Avi Kivity <avi@qumranet.com>
To: Alexander Graf <alex@csgraf.de>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Re: [PATCH] enable gfxboot on VMX
Date: Sun, 17 Feb 2008 10:15:51 +0200 [thread overview]
Message-ID: <47B7ED37.9000301@qumranet.com> (raw)
In-Reply-To: <38713C47-8F04-404A-A3CF-51BDCE1E9999@csgraf.de>
Alexander Graf wrote:
>
> Emulating all of the real mode shouldn't be too much of a problem on
> the performance side. I wouldn't be surprised if the vmenter/exits
> take about as much time as the emulation overhead.
>
For the bootstrap process emulation is good enough, since the process is
short enough. Good real mode performance may be necessary for
applications like ghost which are still used for deployment.
In addition, if a real mode app uses x87/mmx/sse, then you are forced to
add emulation for these instructions if you don't use v8086. Of course,
if that app also uses big real mode, you are forced to do so anyway,
>>> While this should fix more problems, the one thing I am concerned
>>> about is that I have not encountered any other code that does have
>>> this problem.
>>
>> I think some Ubuntus use big real mode, which can use the same fix.
>
> Do you have any file / pointer to where I could get one? I did try the
> feisty server iso which worked just fine.
No, sorry. This is just from memory.
>> I don't think there's much work to get protected mode emulation
>> working. There aren't that many instructions before we get to a
>> vt-friendly state (a couple dozen?) and some of them are already
>> implemented.
>
> The hardest one being ljmp. You need to do the whole pm transition in
> the emulator then. I believe there is a reason this hasn't been done yet?
>
No reason other than it's extremely icky. Looks like Xen has implemented
it though.
>> An alternative is to work around it in userspace. If we recognise the
>> exit reason, we can read the instructions around rip and attempt to
>> fix things up.
>
> So just get the CR0 write and UD exception as event to the userspace?
> I'd really love that approach. The "invalid opcode" hack, as I
> implemented it, is actually quite extensible. You could simply put the
> rip and an operation that is supposed to occur in a list and emulate
> whatever comes when the UD occurs. This might be the easiest way to
> fix things.
I meant trapping the vmentry failure (this is propagated to userspace
anyway), recognizing gfxboot, fixing up the state, and continuing.
>
> We could also have something more extensible, say a "generic binary
> patching" framework, so we know that if memory page 0x1234000 contains
> specific content, just patch it and apply a "what happens in case of
> invalid opcodes" script. This could all be in userspace and should
> enable us to circumvent most problems in a generic way.
>
I can't say I'm thrilled about it when a real fix is possible.
>
> Don't get me wrong on this - I really want to see something "right". I
> just don't see anyone working on it, as there are a lot of places KVM
> improves right now, which are a lot more important than real mode
> fixes. Usually real mode is completely unused as soon as you're done
> with bootstrapping, so why care about it that much?
As I mentioned earlier, deployment apps like ghost.
>
> I'm also perfectly fine with this not being merged. I built this hack
> for me, because I was rather unhappy with the situation as is and
> wanted to see gfxboot working, as I couldn't just "plug in" a current
> iso and install from that. If anyone benefits from it, I'm fine with
> it. If not, that's ok with me too. I just couldn't stand the situation
> that no fix was available at all (disabling gfxboot was no fix for me).
Well, I too would really like to see a fix for gfxboot merged, but I
want to avoid patching whenever possible.
--
Any sufficiently difficult bug is indistinguishable from a feature.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2008-02-17 8:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-15 7:13 [PATCH] enable gfxboot on VMX Alexander Graf
2008-02-15 13:47 ` Avi Kivity
2008-02-15 13:58 ` Alexander Graf
2008-02-16 9:06 ` Avi Kivity
2008-02-16 13:34 ` Alexander Graf
2008-02-17 8:15 ` Avi Kivity [this message]
2008-02-18 9:17 ` Guillaume Thouvenin
2008-02-18 9:34 ` Alexander Graf
2008-02-18 9:39 ` Alexander Graf
2008-02-29 14:34 ` catch vmentry failure (was enable gfxboot on VMX) Guillaume Thouvenin
2008-03-02 17:15 ` Avi Kivity
2008-02-19 3:37 ` [PATCH] enable gfxboot on VMX Anthony Liguori
2008-02-19 8:26 ` Avi Kivity
2008-02-15 14:56 ` Anthony Liguori
2008-02-15 15:13 ` Alexander Graf
2008-02-15 15:46 ` Steffen Winterfeldt
2008-02-18 11:46 ` Andi Kleen
2008-02-18 12:04 ` Alexander Graf
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=47B7ED37.9000301@qumranet.com \
--to=avi@qumranet.com \
--cc=alex@csgraf.de \
--cc=kvm-devel@lists.sourceforge.net \
/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