public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
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: Fri, 15 Feb 2008 15:47:43 +0200	[thread overview]
Message-ID: <47B597FF.7030304@qumranet.com> (raw)
In-Reply-To: <47B53B7D.8050209@csgraf.de>

Alexander Graf wrote:
> Hi,
>
> this issue has already been talked about previously. Gfxboot on VMX is
> broken, because it reads SS after switching from real to protected mode,
> where SS contains an invalid value, which VMX does not allow.
> As far as I know, gfxboot is the only application that suffers from this
> issue.
> The current "fix" is to make gfxboot use a previously stored SS value,
> which works fine for new releases. Already shipped versions of the
> software can not be changed though, so there needs to be another way to
> make kvm work with older versions of gfxboot.
>
> As everything except gfxboot works, we can simply change gfxboot in
> runtime to use a different value. Unfortunately the mov instruction,
> used to read the SS register is only 2 bytes long, so there is no way to
> binary patch the mov to something that would contain an address. So the
> only way I could think of was an invalid instruction. The UD exception
> is intercepted in KVM and is already emulated for VMCALLs. This can be
> extended to an opcode, that is officially unused (0f 0c) and have the
> emulator do a mov realmode_ss, %eax.
>
> This patch implements exactly this idea and fixes openSUSE < 11.0 and
> Ubuntu CD booting on VMX for me. Comments are, as always, welcome.
>   

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.

The same approach works for big real mode.

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.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
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/

  reply	other threads:[~2008-02-15 13:47 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 [this message]
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
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=47B597FF.7030304@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