qemu-e2k/accel
Greg Kurz f1023d21e8 spapr: Unrealize vCPUs with qdev_unrealize()
Since we introduced CPU hot-unplug in sPAPR, we don't unrealize the
vCPU objects explicitly. Instead, we let QOM handle that for us under
object_property_del_all() when the CPU core object is finalized. The
only thing we do is calling cpu_remove_sync() to tear the vCPU thread
down.

This happens to work but it is ugly because:
- we call qdev_realize() but the corresponding qdev_unrealize() is
  buried deep in the QOM code
- we call cpu_remove_sync() to undo qemu_init_vcpu() called by
  ppc_cpu_realize() in target/ppc/translate_init.c.inc
- the CPU init and teardown paths aren't really symmetrical

The latter didn't bite us so far but a future patch that greatly
simplifies the CPU core realize path needs it to avoid a crash
in QOM.

For all these reasons, have ppc_cpu_unrealize() to undo the changes
of ppc_cpu_realize() by calling cpu_remove_sync() at the right place,
and have the sPAPR CPU core code to call qdev_unrealize().

This requires to add a missing stub because translate_init.c.inc is
also compiled for user mode.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <160279671236.1808373.14732005038172874990.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-28 01:08:53 +11:00
..
kvm kvm: kvm_init_vcpu take Error pointer 2020-10-05 16:41:22 +02:00
qtest accel: move qtest CpusAccel functions to a common location 2020-10-24 07:23:19 +02:00
stubs qapi: Restrict Xen migration commands to migration.json 2020-10-21 05:00:44 +02:00
tcg spapr: Unrealize vCPUs with qdev_unrealize() 2020-10-28 01:08:53 +11:00
xen accel: Add xen CpusAccel using dummy-cpus 2020-10-24 07:23:19 +02:00
Kconfig accel/Kconfig: Add the TCG selector 2020-07-10 18:02:21 -04:00
accel.c accel: Introduce the current_accel() wrapper 2020-01-24 20:59:11 +01:00
dummy-cpus.c accel: move qtest CpusAccel functions to a common location 2020-10-24 07:23:19 +02:00
meson.build accel: Add xen CpusAccel using dummy-cpus 2020-10-24 07:23:19 +02:00