target/ppc, spapr: Move VPA information to machine_data

CPUPPCState currently contains a number of fields containing the state of
the VPA.  The VPA is a PAPR specific concept covering several guest/host
shared memory areas used to communicate some information with the
hypervisor.

As a PAPR concept this is really machine specific information, although it
is per-cpu, so it doesn't really belong in the core CPU state structure.

There's also other information that's per-cpu, but platform/machine
specific.  So create a (void *)machine_data in PowerPCCPU which can be
used by the machine to locate per-cpu data.  Intialization, lifetime and
cleanup of machine_data is entirely up to the machine type.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
David Gibson 2018-06-13 16:22:18 +10:00
parent 51c047283c
commit 7388efafc2
6 changed files with 88 additions and 67 deletions

View file

@ -1091,12 +1091,6 @@ struct CPUPPCState {
target_ulong rmls;
#endif
#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY)
uint64_t vpa_addr;
uint64_t slb_shadow_addr, slb_shadow_size;
uint64_t dtl_addr, dtl_size;
#endif /* TARGET_PPC64 */
int error_code;
uint32_t pending_interrupts;
#if !defined(CONFIG_USER_ONLY)
@ -1205,6 +1199,7 @@ struct PowerPCCPU {
uint32_t compat_pvr;
PPCVirtualHypervisor *vhyp;
Object *intc;
void *machine_data;
int32_t node_id; /* NUMA node this CPU belongs to */
PPCHash64Options *hash64_opts;