spapr: fix the value of SDR1 in kvmppc_put_books_sregs()
commit1ec26c757d5996468afcc0dced4fad04139574b3
authorGreg Kurz <groug@kaod.org>
Mon, 25 Sep 2017 11:00:02 +0000 (25 13:00 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 27 Sep 2017 03:05:41 +0000 (27 13:05 +1000)
tree2718d87821896125e083323d9cbc4019726b1c4e
parent15fcedb26fce9cde3f3a2cec533101b6fe43f6e5
spapr: fix the value of SDR1 in kvmppc_put_books_sregs()

When running with KVM PR, if a new HPT is allocated we need to inform
KVM about the HPT address and size. This is currently done by hacking
the value of SDR1 and pushing it to KVM in several places.

Also, migration breaks the guest since it is very unlikely the HPT has
the same address in source and destination, but we push the incoming
value of SDR1 to KVM anyway.

This patch introduces a new virtual hypervisor hook so that the spapr
code can provide the correct value of SDR1 to be pushed to KVM each
time kvmppc_put_books_sregs() is called.

It allows to get rid of all the hacking in the spapr/kvmppc code and
it fixes migration of nested KVM PR.

Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c
hw/ppc/spapr_cpu_core.c
hw/ppc/spapr_hcall.c
target/ppc/cpu.h
target/ppc/kvm.c
target/ppc/kvm_ppc.h