Received: from eggs.gnu.org ([2001:4830:134:3::10]:51279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqrVH-0003AS-E5 for qemu-devel@nongnu.org; Wed, 11 Dec 2013 16:39:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqrVC-0001U4-9i for qemu-devel@nongnu.org; Wed, 11 Dec 2013 16:39:35 -0500 Received: from mail-qa0-f51.google.com ([209.85.216.51]:65478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqrVC-0001Tr-67 for qemu-devel@nongnu.org; Wed, 11 Dec 2013 16:39:30 -0500 Received: by mail-qa0-f51.google.com with SMTP id o15so1041298qap.17 for ; Wed, 11 Dec 2013 13:39:29 -0800 (PST) Date: Wed, 11 Dec 2013 16:39:27 -0500 From: Kevin O'Connor Message-ID: <20131211213927.GC28973@morn.localdomain> References: <52A5B531.9020507@redhat.com> <1386595259.8684.47.camel@nilsson.home.kraxel.org> <20131209155725.GA12684@morn.localdomain> <20131209221251.GA5135@morn.localdomain> <1177689370.4553974.1386669336686.JavaMail.root@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1177689370.4553974.1386669336686.JavaMail.root@redhat.com> Subject: Re: [Qemu-devel] [SeaBIOS] [BUG] Windows 7 fails to start with new vgabios binaries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gal Hammer Cc: seabios , Julian Pidancet , Gerd Hoffmann , qemu-devel@nongnu.org On Tue, Dec 10, 2013 at 04:55:36AM -0500, Gal Hammer wrote: > Kevin, > > The patch was verified and it solves the problem on Windows 7 official release as well. Thanks. I pushed this patch to seabios git master. -Kevin > > ----- Original Message ----- > From: "Kevin O'Connor" > To: "Gerd Hoffmann" > Cc: "Gal Hammer" , "seabios" , qemu-devel@nongnu.org, "Julian Pidancet" > Sent: Tuesday, December 10, 2013 12:12:51 AM > Subject: Re: [SeaBIOS] [BUG] Windows 7 fails to start with new vgabios binaries > > On Mon, Dec 09, 2013 at 10:57:25AM -0500, Kevin O'Connor wrote: > > On Mon, Dec 09, 2013 at 02:20:59PM +0100, Gerd Hoffmann wrote: > > > On Mo, 2013-12-09 at 14:18 +0200, Gal Hammer wrote: > > > > A Windows 7 (32-bit) VM running with QXL device fails to start with the > > > > new updated vgabios binaries (commit > > > Tracked down to the new vgabios stack switching. With > > > CONFIG_VGA_ALLOCATE_EXTRA_STACK=n everything is fine again. > > > > Ughh. WinXP doesn't have the problem, but I can also reproduce on > > Win7 beta. > > > > I'll change the default for CONFIG_VGA_ALLOCATE_EXTRA_STACK to off. > > I tracked this down further. The problem is the Windows x86 emulator > doesn't correctly handle memory accesses relative to the %esp > register. Julian reported this some time back and we worked around it > then. However, the recent "extra stack" assembler code inserted a few > of these instructions. > > I think the proper fix is to leave CONFIG_VGA_ALLOCATE_EXTRA_STACK on > and use slightly different assembler so as not to aggravate win7. > > I tested the seabios patch below and my win7 beta now boots okay. > > -Kevin > > > --- a/vgasrc/vgaentry.S > +++ b/vgasrc/vgaentry.S > @@ -97,12 +97,9 @@ entry_10_extrastack: > movl %ecx, BREGS_ecx(%eax) > movw %es, BREGS_es(%eax) > movl %esp, BREGS_size+0(%eax) > - movzwl %sp, %esp > movw %ss, BREGS_size+4(%eax) > - movl (%esp), %edx > - movl %edx, BREGS_code(%eax) > - movw 4(%esp), %dx > - movw %dx, BREGS_flags(%eax) > + popl BREGS_code(%eax) > + popw BREGS_flags(%eax) > > movw %ds, %dx // Setup %ss/%esp and call function > movw %dx, %ss