qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] QEMU/KVM migration backwards compatibility broken?
@ 2019-06-06  0:09 Liran Alon
  2019-06-06  8:42 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 13+ messages in thread
From: Liran Alon @ 2019-06-06  0:09 UTC (permalink / raw)
  To: kvm list, qemu-devel; +Cc: Paolo Bonzini, Dr. David Alan Gilbert

Hi,

Looking at QEMU source code, I am puzzled regarding how migration backwards compatibility is preserved regarding X86CPU.

As I understand it, fields that are based on KVM capabilities and guest runtime usage are defined in VMState subsections in order to not send them if not necessary.
This is done such that in case they are not needed and we migrate to an old QEMU which don’t support loading this state, migration will still succeed
(As .needed() method will return false and therefore this state won’t be sent as part of migration stream).
Furthermore, in case .needed() returns true and old QEMU don’t support loading this state, migration fails. As it should because we are aware that guest state
is not going to be restored properly on destination.

I’m puzzled about what will happen in the following scenario:
1) Source is running new QEMU with new KVM that supports save of some VMState subsection.
2) Destination is running new QEMU that supports load this state but with old kernel that doesn’t know how to load this state.

I would have expected in this case that if source .needed() returns true, then migration will fail because of lack of support in destination kernel.
However, it seems from current QEMU code that this will actually succeed in many cases.

For example, if msr_smi_count is sent as part of migration stream (See vmstate_msr_smi_count) and destination have has_msr_smi_count==false,
then destination will succeed loading migration stream but kvm_put_msrs() will actually ignore env->msr_smi_count and will successfully load guest state.
Therefore, migration will succeed even though it should have failed…

It seems to me that QEMU should have for every such VMState subsection, a .post_load() method that verifies that relevant capability is supported by kernel
and otherwise fail migration.

What do you think? Should I really create a patch to modify all these CPUX86 VMState subsections to behave like this?

Thanks,
-Liran

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-06-10  9:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-06  0:09 [Qemu-devel] QEMU/KVM migration backwards compatibility broken? Liran Alon
2019-06-06  8:42 ` Dr. David Alan Gilbert
2019-06-06  9:11   ` Liran Alon
2019-06-06  9:23     ` Dr. David Alan Gilbert
2019-06-06 10:09       ` Liran Alon
2019-06-06 10:39         ` Dr. David Alan Gilbert
2019-06-06 10:57           ` Liran Alon
2019-06-06 11:07             ` Dr. David Alan Gilbert
2019-06-06 11:29               ` Liran Alon
2019-06-06 13:31                 ` Dr. David Alan Gilbert
2019-06-06 15:16                   ` Liran Alon
2019-06-10  9:44                     ` Dr. David Alan Gilbert
2019-06-06 13:13         ` Roman Kagan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).