qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/4] target-ppc: handle KVM timebase migration
@ 2016-04-07 15:23 Mark Cave-Ayland
  2016-04-07 15:23 ` [Qemu-devel] [RFC 1/4] target-ppc: introduce PPCMachineClass and PPCMachineState Mark Cave-Ayland
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Mark Cave-Ayland @ 2016-04-07 15:23 UTC (permalink / raw)
  To: david, aik, agraf, qemu-ppc, qemu-devel

This RFC series follows on from discussions in the "Migrating decrementer"
thread relating to handling migration of the timebase and decrementer
registers for both TCG and KVM. The aim is to provide a consistent virtual
clock when migrating PPC machines TCG-TCG (already handled) and
KVM-KVM with both paused and live VMs in a unified manner for all PPC
machine types.

The existing code to handle timebase migration on PPC has a few issues:

1) It uses cpu_get_host_ticks() which doesn't work correctly on TCG with
different host architectures

2) tb_offset is calculated from the difference in the host clock between
source and destination. Thus if the guest is paused then the resulting
offset is calculated incorrectly since the host clock still runs, regardless
of the state of the virtual clock.

3) Due to a typo in the existing implementation (MIN instead of MAX) then
guest_tb never takes migration_duration_tb into account

Patches 1-2 introduce a new PPCMachineClass and derive all the PPC machine
classes from it, not dissimilar to x86's PCMachineClass.

Patch 3 adds a VM state change hook into PCMachineClass and updates the
tb_offset from the host when the machine (re)starts as discussed in the
thread. Note that it may be possible to add the hook to specific machine
types, however using PPCMachineClass allows all PPC machines to pick up
this functionality automatically.

Patch 4 temporarily disables the existing timebase migration code to allow
testing.

Note that this has only been compile-tested on x86 as I have no KVM PPC
hardware and so it's really an RFC to determine whether this approach can
work, and to invite testing and discussion from existing KVM PPC users.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (4):
  target-ppc: introduce PPCMachineClass and PPCMachineState
  target-ppc: derive all PPC machine classes to have PPCMachineClass as
    their superclass
  target-ppc: synchronise tb_offset with KVM host on machine start
  target-ppc: hack to remove existing timebase migration code for
    testing

 hw/ppc/e500plat.c       |    7 +++-
 hw/ppc/mac_newworld.c   |   17 ++------
 hw/ppc/mac_oldworld.c   |    6 ++-
 hw/ppc/mpc8544ds.c      |    7 +++-
 hw/ppc/ppc.c            |  100 +++++++++++++++++++++++++++++------------------
 hw/ppc/ppc405_boards.c  |   28 +++----------
 hw/ppc/ppc440_bamboo.c  |    6 ++-
 hw/ppc/prep.c           |    6 ++-
 hw/ppc/spapr.c          |    2 +-
 hw/ppc/virtex_ml507.c   |    6 ++-
 include/hw/ppc/ppc.h    |   35 +++++++++++++++++
 include/qemu/typedefs.h |    2 +
 12 files changed, 135 insertions(+), 87 deletions(-)

-- 
1.7.10.4

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

end of thread, other threads:[~2016-04-15  8:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 15:23 [Qemu-devel] [RFC 0/4] target-ppc: handle KVM timebase migration Mark Cave-Ayland
2016-04-07 15:23 ` [Qemu-devel] [RFC 1/4] target-ppc: introduce PPCMachineClass and PPCMachineState Mark Cave-Ayland
2016-04-15  5:13   ` David Gibson
2016-04-07 15:23 ` [Qemu-devel] [RFC 2/4] target-ppc: derive all PPC machine classes to have PPCMachineClass as their superclass Mark Cave-Ayland
2016-04-15  5:17   ` David Gibson
2016-04-07 15:23 ` [Qemu-devel] [RFC 3/4] target-ppc: synchronise tb_offset with KVM host on machine start Mark Cave-Ayland
2016-04-15  5:23   ` David Gibson
2016-04-07 15:23 ` [Qemu-devel] [RFC 4/4] target-ppc: hack to remove existing timebase migration code for testing Mark Cave-Ayland
2016-04-15  5:27 ` [Qemu-devel] [RFC 0/4] target-ppc: handle KVM timebase migration David Gibson

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