From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2LI2-0000gp-A5 for qemu-devel@nongnu.org; Tue, 18 Nov 2008 02:46:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2LI1-0000gd-HB for qemu-devel@nongnu.org; Tue, 18 Nov 2008 02:46:25 -0500 Received: from [199.232.76.173] (port=47361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2LI1-0000ga-CK for qemu-devel@nongnu.org; Tue, 18 Nov 2008 02:46:25 -0500 Received: from mx20.gnu.org ([199.232.41.8]:16190) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L2LI1-0004MI-56 for qemu-devel@nongnu.org; Tue, 18 Nov 2008 02:46:25 -0500 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L2LHz-0006sG-MQ for qemu-devel@nongnu.org; Tue, 18 Nov 2008 02:46:23 -0500 Date: Tue, 18 Nov 2008 09:46:28 +0200 From: Gleb Natapov Message-ID: <20081118074628.GC11066@redhat.com> References: <20081116093345.23209.79952.stgit@dhcp-1-237.local> <20081116093355.23209.96231.stgit@dhcp-1-237.local> <6BBD568AF57A42CE81244D009F97923C@FSCPC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6BBD568AF57A42CE81244D009F97923C@FSCPC> Subject: [Qemu-devel] Re: [Bochs-developers] [PATCH v4 2/5] Preserve memory content duringSMM init. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Herbszt Cc: bochs-developers@lists.sourceforge.net, qemu-devel@nongnu.org On Tue, Nov 18, 2008 at 12:51:17AM +0100, Sebastian Herbszt wrote: > smm_init() is currently only run on VM start and overwriting > memory is not an issue there. This would matter on S3 resume, > but smm_init() is not run there. It is only run from pci_bios_init(), > but on S3 resume we bail out from rombios32.c before this call. > Your patch to handle S3 in qemu does use qemu_system_reset_request() > which does reset some emulated devices. Since piix4_pm does not > register a reset handler it is not reset. I assume the reset on S3 resume > is a hardware reset and the state of piix4_pm should be reset too, right? S3 removes power from all devices except memory, so yes, piix4_pm should be reset to its power up state. > cpu_reset() in target-i386/helper.c does set smbase to 0x30000. Since the > piix4_pm state is not lost, APMC_EN is still set and even on a normal reset > SMBASE is not relocated. If i don't mistake smm_init() should be run on S3 > resume and we would need something like > > pci_for_each_device(find_piix4pm) > if (piix4pm_pcidev) > smm_init(); > > in the resume path in rombios32.c. > Yes, you are right. I'll add it. -- Gleb.