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