From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAMCi-0002Li-8t for qemu-devel@nongnu.org; Wed, 10 Dec 2008 05:22:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAMCh-0002L8-Bk for qemu-devel@nongnu.org; Wed, 10 Dec 2008 05:22:03 -0500 Received: from [199.232.76.173] (port=55405 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAMCh-0002Kz-38 for qemu-devel@nongnu.org; Wed, 10 Dec 2008 05:22:03 -0500 Received: from mx2.redhat.com ([66.187.237.31]:37481) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAMCg-0005sH-NZ for qemu-devel@nongnu.org; Wed, 10 Dec 2008 05:22:02 -0500 Date: Wed, 10 Dec 2008 12:22:36 +0200 From: Gleb Natapov Message-ID: <20081210102236.GC5555@redhat.com> References: <20081207092031.GA32185@redhat.com> <6C523DD4BB1143B9B13075A5DBE09390@FSCPC> <20081210000604.GA15974@morn.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081210000604.GA15974@morn.localdomain> Subject: [Qemu-devel] Re: [Bochs-developers] [PATCH v5 1/5] Add S3 state to DSDT.Handle resume event in the BIOS. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: bochs-developers@lists.sourceforge.net, qemu-devel@nongnu.org, Sebastian Herbszt On Tue, Dec 09, 2008 at 07:06:04PM -0500, Kevin O'Connor wrote: > On Tue, Dec 09, 2008 at 11:26:53PM +0100, Sebastian Herbszt wrote: > > Gleb Natapov wrote: > > > On Sat, Dec 06, 2008 at 09:57:38PM -0500, Kevin O'Connor wrote: > > >> Also, wouldn't this corrupt memory used by the stack (the stack gets > > >> set to 0xfffe, and s3_post has call insns in it)? > > > Oh. I thought it was set to be at the top of the first page, but it has > > > one extra 'f' :( We should change it to be 0xffe instead. > > > > Can you please explain this memory corruption? Why would "this" (?) corrupt > > memory used by the stack? > > On an s3 resume, memory the OS may be using must not be changed by the > bios. When bochs bios detects an s3 resume, it jumps to s3_post with > the stack pointer set to 0xfffe. In s3_post, there are "call" > instruction which will alter memory at 0xfffe (to store the return > address). This could break the resume, because the OS could be using > that memory for something else. > > Gleb is suggesting that we change that to 0xffe, because the OS can't > be using memory at that address and expect s3 resume to work. (The > first 4KiB is reserved for BIOS use.) > And the patch I've sent set sp to 0xffe only on S3 resume path where stack usage is minimal. -- Gleb.