hw/ppc: set machine->fdt in spapr machine
commitd890f2fa9f1e17a86f4e0891f175ae214a8596bf
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 26 Sep 2022 17:38:52 +0000 (26 14:38 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 17 Oct 2022 19:15:10 +0000 (17 16:15 -0300)
treea3be25681ebea178c56cba2b8332b3936bf3edf6
parentadb779965354638c43d26bf197fb06aa49d1f8cf
hw/ppc: set machine->fdt in spapr machine

The pSeries machine never bothered with the common machine->fdt
attribute. We do all the FDT related work using spapr->fdt_blob.

We're going to introduce a QMP/HMP command to dump the FDT, which will
rely on setting machine->fdt properly to work across all machine
archs/types.

Let's set machine->fdt in two places where we manipulate the FDT:
spapr_machine_reset() and CAS. There are other places where the FDT is
manipulated in the pSeries machines, most notably the hotplug/unplug
path. For now we'll acknowledge that we won't have the most accurate
representation of the FDT, depending on the current machine state, when
using this QMP/HMP fdt command. Making the internal FDT representation
always match the actual FDT representation that the guest is using is a
problem for another day.

spapr->fdt_blob is left untouched for now. To replace it with
machine->fdt, since we're migrating spapr->fdt_blob, we would need to
migrate machine->fdt as well. This is something that we would like to to
do keep our code simpler but it's also a work we'll leave for later.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220926173855.1159396-14-danielhb413@gmail.com>
hw/ppc/spapr.c
hw/ppc/spapr_hcall.c