Re: [kvm-devel] [GFXBOOT] [PATCH] When switching to real-mode, pass SS in a GP register

2007-10-08 Thread Steffen Winterfeldt
Hi,

sorry for the delay, but I've been on vacation. :-)

On Sun, 30 Sep 2007, Anthony Liguori wrote:

> Avi Kivity wrote:
> > Anthony Liguori wrote:

> >> As Avi pointed out, VT requires that SS.RPL == CS.RPL.  We're seeing
> >> gfxboot fail under KVM because ss = 0x5761 while cs = 0x4004 during
> >> the transition from real mode to protected mode.  The attached patch
> >> passes the value of ss through ebx since KVM has to sanitize the value
> >> of ss to make VT happy.

Uh, that's weird! Thanks for pointing this out.

[patch]

> > This is subtly wrong, I think.  First, note that 'mov eax,ss' only
> > affects ax, not the high 16 bits.  The note that the original code
> > happily shifts eax which is half ss, half garbage left by 4 bits and
> > uses that to generate a 32-bit result.
> >
> > The reason it worked before was that bits 16-29 of eax are already clear
> > by virtue of having come from cr0.  But now you're using ebx which
> > hasn't had that magic clearing.
> >   
> 
> You're right.  Good catch!

Actually that is not true. 'mov eax,ss' does implicitly clear the upper
16 bits (both processor docs and hardware agree here).

> > In your comment to the kvm bug you say that the patch allows you to
> > boot, so perhaps bits 16-29 of ebx are already clear here, or my
> > analysis is mistaken.
> >   
> 
> Yeah, I just got lucky with ebx I guess :-)  Attached is an updated patch that
> fixes this problem.

Anyway, ss is already saved, so no need for an extra register. Here is
my version (tested and works on my machine):

--- bincode.asm (revision 650)
+++ bincode.asm (working copy)
@@ -15546,7 +15546,11 @@
mov ax,pm_seg.prog_d16
mov ds,ax
 
-   mov eax,ss
+   ; needed for KVM:
+   ; ss:rpl must equal cs:rpl in PM for VT. We can't rely on ss
+   ; maintaining its value after the transition.
+
+   movzx eax,word [rm_seg.ss]
and esp,0h
shl eax,4
add esp,eax

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] enable gfxboot on VMX

2008-02-15 Thread Steffen Winterfeldt
On Fri, 15 Feb 2008, Alexander Graf wrote:

> On Feb 15, 2008, at 3:56 PM, Anthony Liguori wrote:
> 
> >Have you tried SLES-9 or openSUSE variants of the same age?  The ss issue in
> >gfxboot is only something recently introduced.  Prior to that, gfxboot used
> >big real mode so your patch wouldn't be sufficient for those versions of
> >gfxboot.
> 
> SLES7 - SLES-9  and SUSE 9.1 through to openSUSE 10.1 do not need the patch.
> They work 'as is'. SLES10 starts in text mode.
> Starting with 10.2 the mov ss issue came along, but maybe Steffen can tell us
> more about the history of this issue.

The use of memory > 1MB was optional in older versions, so they might work
even if the pm switch doesn't work. sles10 has a special check so it doesn't
run in xen; maybe that gets in the way here, too. After sles10 big segments
in real mode are no longer used.


Steffen

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel