qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] vm state save/restore question
@ 2012-06-09 10:53 Benjamin Herrenschmidt
  2012-06-09 11:34 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 20+ messages in thread
From: Benjamin Herrenschmidt @ 2012-06-09 10:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf

Hi folks !

I'm looking at sorting out the state save/restore of target-ppc (which
means understanding in general how it works in qemu :-)

So far I've somewhat figured out that there's the "old way" where we
just provide a "bulk" save/restore function pair, and the "new way"
where we have nicely tagged field lists etc...

x86 seems to use the later for the CPU state, ppc is a mess and uses the
former with interesting incompatible format change depending on how qemu
is build :-) So I think that's one area I need to fix.

However, another issue I have, I'm not sure how to fix properly:

When using the "spapr" machine model (pseries), which is in effect a
paravirtualized model, the MMU hash table isn't part of the guest
memory. It's either somewhere in qemu own memory (full emu) or in the
host kernel (kvm) and it's accessed via hcalls.

Now, that's per-se is fine, I can add a pair of save/restore hooks in
spapr to handle it (in fact using the "old" scheme here makes sense
since it's a potentially big bulk of memory unless I find a way to
represent that with the new "structured" way, but that's a detail).

I will probably need some new ioctl's with the kernel to be able to dump
the kvm one in a state useful for a saved image, but here too nothing we
don't know how to do, but that's fine too, we'll have more vcpu state we
need to properly sort out for save/restore with kvm, we'll deal with it
eventually.

The problem I have is in fact with full emu on restore. After I've
re-allocated the hash table, loaded it from disk, etc... I need to
update some data in the vcpu env.

IE. The vcpu has a pointer to the "external hash" (and it's size) which
it uses to perform translation and that needs to be restored.

cpu_load/save isn't a good place to do that of course since that code
knows nothing about the spapr stuff, besides I don't think I have any
ordering guarantee between those vs. my spapr htab save/load.

What I'd need is something in spapr that can be used to "resync" bits of
the cpu state with the external htab that gets run after everything is
loaded and before emulation restarts.

Any idea how to do that properly ? I suppose I could also try to iterate
all the vcpu's after loading the hash table & update the fields but not
only that's gross ... I also don't know how to do it :-)

Cheers,
Ben.
 

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

end of thread, other threads:[~2012-06-20  0:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09 10:53 [Qemu-devel] vm state save/restore question Benjamin Herrenschmidt
2012-06-09 11:34 ` Benjamin Herrenschmidt
2012-06-09 11:37   ` Andreas Färber
2012-06-19 14:07   ` Alexander Graf
2012-06-19 14:59     ` Juan Quintela
2012-06-19 17:16       ` Andreas Färber
2012-06-19 20:30       ` Benjamin Herrenschmidt
2012-06-19 21:00         ` Alexander Graf
2012-06-19 21:13           ` Benjamin Herrenschmidt
2012-06-19 21:48             ` Alexander Graf
2012-06-19 21:51               ` Benjamin Herrenschmidt
2012-06-19 22:27                 ` Alexander Graf
2012-06-19 22:32                   ` Benjamin Herrenschmidt
2012-06-19 22:55           ` Juan Quintela
2012-06-19 23:00             ` Benjamin Herrenschmidt
2012-06-19 23:11               ` Juan Quintela
2012-06-19 23:28                 ` Benjamin Herrenschmidt
2012-06-19 23:30                   ` Alexander Graf
2012-06-19 23:52                     ` Benjamin Herrenschmidt
2012-06-20  0:05                       ` Alexander Graf

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).