qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/17] target-ppc: Convert ppc cpu savevm to VMS


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 04/17] target-ppc: Convert ppc cpu savevm to VMStateDescription
Date: Wed, 10 Jul 2013 01:11:20 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jul 09, 2013 at 09:08:01AM -0500, Anthony Liguori wrote:
> Alexey Kardashevskiy <address@hidden> writes:
> > On 07/09/2013 04:29 AM, Anthony Liguori wrote:
> >> Alexey Kardashevskiy <address@hidden> writes:
[snip]
> >>> +#endif /* TARGET_PPC64 */
> >>> +            .vmsd = &vmstate_tlb6xx,
> >>> +            .needed = tlb6xx_needed,
> >>> +        } , {
> >>> +            .vmsd = &vmstate_tlbemb,
> >>> +            .needed = tlbemb_needed,
> >>> +        } , {
> >>> +            .vmsd = &vmstate_tlbmas,
> >>> +            .needed = tlbmas_needed,
> >>> +        } , {
> >>> +            /* FIXME: DCRs? */
> >>> +            /* FIXME: timebase? */
> >>> +            /* empty */
> >> 
> >> Are they needed or not needed?
> >
> > DCR is not needed, I'll remove it.

More precisely, DCRs are only needed on the BookE CPUs which have
them.  They can be added later without breaking compatibility, and
would be best added by someone working on the BookE stuff who can test
it properly.

> > Timebase is needed but it requires kernel support and either way it should
> > not prevent the rest of the patch to go upstream.
> 
> So migration doesn't work?
> 
> If you need timebase, what happens without it?

Migration will (in fact, does) work without anything extra for the
timebase.  What's less clear is if all the timing edge cases are
correct at present.

As a rule, the guest should see the timebase advance across the
migration according to the elapsed wall clock time.  But the guest
*must not* see the timebase go backwards, even if the source and
destination host clocks are out of sync in such a way that time
appears to go backwards across the migration.

Under TCG, the guest timebase is not tracked as it advances, but an
appropriate value is computed from the host system time when the
timebase is read.  Under KVM, the host and guest timebase are the same
register physically.  We don't yet, but we probably should, context
switch the upper bits of the timebase, to give the guest its own
logical value for it.

Getting all the combinations of cases corrects probably needs some
sort of real time <-> guest timebase delta transferred across the
migration, but working out exactly what's needed and how to encode it
is a bit fiddly.

Since the common cases work already, and it's fairly straightforward
to add whatever delta is needed in a backwards compatible way.  It
seems reasonable, therefore to get migration mostly working, even with
some known bugs in timing edge cases.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: pgpGyo0fttd4q.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]