qemu/target/ppc
Laurent Vivier 42043e4f12 spapr: clock should count only if vm is running
This is a port to ppc of the i386 commit:
    00f4d64 kvmclock: clock should count only if vm is running

We remove timebase_post_load function, and use the VM state
change handler to save and restore the guest_timebase (on stop
and continue).

We keep timebase_pre_save to reduce the clock difference on
migration like in:
    6053a86 kvmclock: reduce kvmclock difference on migration

Time base offset has originally been introduced by commit
    98a8b52 spapr: Add support for time base offset migration

So while VM is paused, the time is stopped. This allows to have
the same result with date (based on Time Base Register) and
hwclock (based on "get-time-of-day" RTAS call).

Moreover in TCG mode, the Time Base is always paused, so this
patch also adjust the behavior between TCG and KVM.

VM state field "time_of_the_day_ns" is now useless but we keep
it to be able to migrate to older version of the machine.

As vmstate_ppc_timebase structure (with timebase_pre_save() and
timebase_post_load() functions) was only used by vmstate_spapr,
we register the VM state change handler only in ppc_spapr_init().

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-01-31 10:10:14 +11:00
..
translate target-ppc: Add xvcv[hpsp, sphp] instructions 2017-01-31 10:10:14 +11:00
arch_dump.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
compat.c ppc: Add ppc_set_compat_all() 2017-01-31 10:10:14 +11:00
cpu-models.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
cpu-models.h powerpc/cpu-models: rename ISAv3.00 logical PVR definition 2017-01-31 10:10:14 +11:00
cpu-qom.h spapr: clock should count only if vm is running 2017-01-31 10:10:14 +11:00
cpu.h target/ppc: Add pcr_supported to POWER9 cpu class definition 2017-01-31 10:10:14 +11:00
dfp_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
excp_helper.c ppc: Clean up and QOMify hypercall emulation 2017-01-31 10:10:13 +11:00
fpu_helper.c target-ppc: Add xvcv[hpsp, sphp] instructions 2017-01-31 10:10:14 +11:00
gdbstub.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
helper.h target-ppc: Add xvcv[hpsp, sphp] instructions 2017-01-31 10:10:14 +11:00
helper_regs.h cputlb: drop flush_global flag from tlb_flush 2017-01-13 14:24:37 +00:00
int_helper.c ppc: Implement bcdutrunc. instruction 2017-01-31 10:10:14 +11:00
internal.h target-ppc: Add xsaddqp instructions 2017-01-31 10:10:14 +11:00
kvm-stub.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
kvm.c ppc: Rename cpu_version to compat_pvr 2017-01-31 10:10:13 +11:00
kvm_ppc.h ppc: Rename cpu_version to compat_pvr 2017-01-31 10:10:13 +11:00
machine.c migration: extend VMStateInfo 2017-01-24 17:54:47 +00:00
Makefile.objs ppc: Rewrite ppc_set_compat() 2017-01-31 10:10:13 +11:00
mem_helper.c target-ppc: implement stxvll instructions 2017-01-31 10:10:13 +11:00
mfrom_table.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mfrom_table_gen.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
misc_helper.c cputlb: drop flush_global flag from tlb_flush 2017-01-13 14:24:37 +00:00
mmu-hash32.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mmu-hash32.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mmu-hash64.c kvm: move cpu synchronization code 2017-01-19 22:07:46 +01:00
mmu-hash64.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mmu_helper.c cputlb: drop flush_global flag from tlb_flush 2017-01-13 14:24:37 +00:00
monitor.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
STATUS Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
timebase_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
trace-events Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
translate.c target-ppc: implement stop instruction 2017-01-31 10:10:13 +11:00
translate_init.c target/ppc: Add pcr_supported to POWER9 cpu class definition 2017-01-31 10:10:14 +11:00
user_only_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00