From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [GFXBOOT] [PATCH] When switching to real-mode, pass SS in a GP register Date: Sat, 29 Sep 2007 23:29:32 -0500 Message-ID: <46FF262C.9000900@codemonkey.ws> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010307090907000303070403" Cc: kvm-devel , Avi Kivity To: Steffen Winterfeldt Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------010307090907000303070403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Steffen, 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. I've tested this with a remastered Ubuntu Gutsy install CD. I couldn't find the right gfxboot theme for the openSuSE install CD I have so I wasn't able to test it. I suspect that Xen should have a very similar problem as I can't think of a possible way to work around this. Regards, Anthony Liguori --------------010307090907000303070403 Content-Type: text/x-patch; name="gfxboot-3.3.38-vt.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gfxboot-3.3.38-vt.diff" Subject: [PATCH] Fix gfxboot under VT From: Anthony Liguori This patch lets gfxboot-3.3.38 work under KVM. The fix was suggested by Avi Kivity. Signed-off-by: Anthony Liguori diff -ur a/bincode.asm b/bincode.asm --- a/bincode.asm 2007-07-24 05:49:46.000000000 -0500 +++ b/bincode.asm 2007-09-29 22:14:35.000000000 -0500 @@ -15519,6 +15519,7 @@ switch_to_pm: pushf push eax + push ebx mov eax,cr0 @@ -15534,6 +15535,11 @@ mov word [cs:rm_seg.fs],fs mov word [cs:rm_seg.gs],gs + ;; ss:rpl must equal cs:rpl in PM for VT. we can't rely on ss + ;; maintaining it's value after the transition so we have to + ;; pass it in a GP register + mov ebx,ss + or al,1 o32 lgdt [cs:pm_gdt] o32 lidt [cs:pm_idt] @@ -15546,7 +15552,7 @@ mov ax,pm_seg.prog_d16 mov ds,ax - mov eax,ss + mov eax,ebx and esp,0ffffh shl eax,4 add esp,eax @@ -15557,6 +15563,7 @@ mov fs,ax mov gs,ax + pop ebx pop eax popfw o16 ret --------------010307090907000303070403 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --------------010307090907000303070403 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------010307090907000303070403--