From patchwork Mon Dec 9 22:12:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin O'Connor X-Patchwork-Id: 299215 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 398732C00AC for ; Tue, 10 Dec 2013 09:13:35 +1100 (EST) Received: from localhost ([::1]:46111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq952-0001Px-Ix for incoming@patchwork.ozlabs.org; Mon, 09 Dec 2013 17:13:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq94a-0001OG-PX for qemu-devel@nongnu.org; Mon, 09 Dec 2013 17:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq94T-00037J-8n for qemu-devel@nongnu.org; Mon, 09 Dec 2013 17:13:04 -0500 Received: from mail-qe0-f41.google.com ([209.85.128.41]:62540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq94T-00035T-4l for qemu-devel@nongnu.org; Mon, 09 Dec 2013 17:12:57 -0500 Received: by mail-qe0-f41.google.com with SMTP id gh4so3359508qeb.14 for ; Mon, 09 Dec 2013 14:12:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=VBgHr3XpwqKy43dmYPbHzVw+HSws0V0oAPxKHXAsLmQ=; b=ShaApVOAKuhhd/U1qM5HfigbKKWi/eNlJja29iiIFfuOGxakIs/okyxJ+Z8NV3LKPD dtBHWDFeCZNBN+XCpXv7xAOdhKUwuGPPPNHxUwvphpaC78eLnvDmSrCT6VBnfdpVfIo1 Mw+X1ZWrrnuYeF/OAu69tpHYWH2ubCs3Pb1WqN2h4semyzsbd1jgCLUs7RC24+/F9gxO 4B3s9PleTRBtRbIWdN4OPOdxPjXa3TQ+nyXZ7/vuyZCdJKguCamCw5Sf5QSMrD3jRpht FOs9LirpcsforG8bcbwbDegcRErR6rUBQI+IilR3YfbC8K5e4RG+SlipjXbqUBim6qBZ PzGw== X-Gm-Message-State: ALoCoQmjn1ZFBLtaQ6w9ybe7fjNEshh2F7t+kdimCZsgmoJuF15Qm+XpBh1840Tdhc7IFPMoA6Ee X-Received: by 10.49.35.52 with SMTP id e20mr187647432qej.63.1386627176359; Mon, 09 Dec 2013 14:12:56 -0800 (PST) Received: from localhost (207-172-170-53.c3-0.avec-ubr1.nyr-avec.ny.cable.rcn.com. [207.172.170.53]) by mx.google.com with ESMTPSA id f19sm38001750qaq.12.2013.12.09.14.12.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2013 14:12:55 -0800 (PST) Date: Mon, 9 Dec 2013 17:12:51 -0500 From: Kevin O'Connor To: Gerd Hoffmann Message-ID: <20131209221251.GA5135@morn.localdomain> References: <52A5B531.9020507@redhat.com> <1386595259.8684.47.camel@nilsson.home.kraxel.org> <20131209155725.GA12684@morn.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20131209155725.GA12684@morn.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.128.41 Cc: Gal Hammer , seabios , qemu-devel@nongnu.org, Julian Pidancet Subject: Re: [Qemu-devel] [SeaBIOS] [BUG] Windows 7 fails to start with new vgabios binaries X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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