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: Sat, 16 Feb 2008 11:06:08 +0200 [thread overview]
Message-ID: <47B6A780.4090402@qumranet.com> (raw)
In-Reply-To: <5869160F-A202-4092-9A44-1D65058E188D@csgraf.de>
Alexander Graf wrote:
>>
>> While enabling gfxboot over vmx is very desirable, I'd like to avoid
>> guest-specific hacks. IMO the correct fix is to set a
>> "non_vt_friendly"
>> flag when switching from real mode to protected mode, then continue
>> emulation, re-computing the flag after every instruction. After a few
>> instruction, the condition disappears and we can enter guest mode
>> again.
>>
>
> So when would the flag disappear?
Whenever the register state becomes consistent with VT again.
vmx_set_segment() looks like the right point for turning it off.
> Basically an SS read can happen any
> time after the switch, even after 100 instructions if it has to.
That's okay. Most (all) code will reload all segments shortly after the
protected mode switch.
I am concerned about switches to real-mode not reloading fs and gs, so
we'd stay in vt-unfriendly state and emulate even though the real mode
code doesn't use fs and gs at all. I believe we can live with it; newer
Xen for example emulates 100% of real mode code.
> 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.
>> The downside is that we have to implement more instructions in the
>> emulator for this, but these instructions will be generally useful,
>> not
>> just for gfxboot.
>>
>
> I am not trying to talk you into anything - I would very much prefer a
> rather clean solution as well. Nevertheless I do not see full
> protected mode emulation code coming in the very near future and on a
> user perspective would prefer to have something that works, even if
> it's ugly.
> So while KVM is able to run most (if not all?) current major Operating
> Systems unmodified, it fails to install them (at least on the Linux
> side).
>
I'd like to keep ugliness out of the kernel side.
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.
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.
> Even though I would greatly appreciate any effort made to get things
> cleaned up, the gfxboot issue has been standing for months now without
> even a hacky workaround (except for disabling gfxboot in all) or any
> visible progress, so I believe a hack like this is at least worth
> something to distributions that want to enable their users to work
> with KVM.
On the other hand, merging the hacks discourages the right fix from
being developed. I do agree that the current situation is disgraceful.
--
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-16 9:06 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 [this message]
2008-02-16 13:34 ` Alexander Graf
2008-02-17 8:15 ` Avi Kivity
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=47B6A780.4090402@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