From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzLYt-0007et-6i for qemu-devel@nongnu.org; Mon, 01 Jun 2015 04:59:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzLYq-0000tF-0G for qemu-devel@nongnu.org; Mon, 01 Jun 2015 04:59:11 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:36449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzLYp-0000tB-Ps for qemu-devel@nongnu.org; Mon, 01 Jun 2015 04:59:07 -0400 Received: by wibdq8 with SMTP id dq8so22259954wib.1 for ; Mon, 01 Jun 2015 01:59:07 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <556C1ED1.2030706@redhat.com> Date: Mon, 01 Jun 2015 10:58:57 +0200 From: Paolo Bonzini MIME-Version: 1.0 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> In-Reply-To: <20150601100447-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: "Michael S. Tsirkin" Cc: lersek@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com 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. 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