target-ppc: Add mechanism for synchronizing SPRs with KVM
commitd67d40ea07577b0a952d3bea5a2f92edf0ee26a6
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 20 Feb 2013 16:41:50 +0000 (20 16:41 +0000)
committerAlexander Graf <agraf@suse.de>
Fri, 8 Mar 2013 20:04:52 +0000 (8 21:04 +0100)
tree249519be3d12545626543d003678fa1b503e088b
parentd60fa42e8bae39440f997ebfe8fe328269a57d16
target-ppc: Add mechanism for synchronizing SPRs with KVM

Currently when runing under KVM on ppc, we synchronize a certain number of
vital SPRs to KVM through the SET_SREGS call.  This leaves out quite a lot
of important SPRs which are maintained in KVM.  It would be helpful to
have their contents in qemu for debugging purposes, and when we implement
migration it will be vital, since they include important guest state that
will need to be restored on the target.

This patch sets up for synchronization of any registers supported by the
KVM ONE_REG calls.  A new variant on spr_register() allows a ONE_REG id to
be stored with the SPR information.  When we set/get information to KVM
we also synchronize any SPRs so registered.

For now we set this mechanism up to synchronize a handful of important
registers that already have ONE_REG IDs, notably the DAR and DSISR.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc/cpu.h
target-ppc/kvm.c
target-ppc/translate_init.c