From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzN6q-0007Ae-UY for qemu-devel@nongnu.org; Mon, 01 Jun 2015 06:38:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzN6n-0001Lh-Mt for qemu-devel@nongnu.org; Mon, 01 Jun 2015 06:38:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzN6n-0001LN-Ie for qemu-devel@nongnu.org; Mon, 01 Jun 2015 06:38:17 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 3C947B82AD for ; Mon, 1 Jun 2015 10:38:17 +0000 (UTC) Date: Mon, 1 Jun 2015 12:38:14 +0200 From: "Michael S. Tsirkin" Message-ID: <20150601123426-mutt-send-email-mst@redhat.com> References: <1431352157-40283-1-git-send-email-pbonzini@redhat.com> <1431352157-40283-16-git-send-email-pbonzini@redhat.com> <20150531180959.GA5268@redhat.com> <556C0A1E.3050604@redhat.com> <20150601100447-mutt-send-email-mst@redhat.com> <556C1ED1.2030706@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <556C1ED1.2030706@redhat.com> Subject: Re: [Qemu-devel] [PATCH 15/31] target-i386: use memory API to implement SMRAM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: lersek@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com On Mon, Jun 01, 2015 at 10:58:57AM +0200, Paolo Bonzini wrote: > > > On 01/06/2015 10:10, Michael S. Tsirkin wrote: > > > UNUSED is written as zeroes, so it will think SMM is _disabled_, > > > unconditionally. Note that d->smram_region is backwards: it aliases to > > > VRAM, so it is enabled when SMRAM is closed and disabled when SMRAM is open. > > > > > > This is correct for KVM, though not for TCG. Backwards migration is not > > > supported officially upstream, and I think we can agree it is even less > > > supported for TCG. > > > > Generally backwards migration is nice to have to test cross-version > > migration properly by doing ping-pong. > > Looks like we only need to set smm_enabled correctly before save, > > and it'll work cleanly. > > No? > > Sort of. Old QEMU is not able to handle the case where some CPUs are in > SMM and some are not. It is also a layering violation to compute > smm_enabled from the CPUs. Yes, I got that. But I guess typically only one CPU is running so something like smm_enabled_any will DTRT, without layering violations, right? > Old SeaBIOS never uses SMM after POST, and executes a dozen instructions > or so inside SMRAM. New SeaBIOS does use SMM after POST (e.g. during > grub), but it _literally_ executes two instructions inside SMRAM and > then jumps to the F-segment, so even if you do not migrate smm_enabled > the chance that something break is basically zero. > > This is why I decided that it wasn't worth the complication (and the > layering violation). > > Paolo To me it seems easier to support than to explain why we don't have to, but if you are strongly against that, please add code comments explaining all this. -- MST