summaryrefslogtreecommitdiffstats
path: root/hw/ppc/spapr_rtas_ddw.c
diff options
context:
space:
mode:
authorDavid Hildenbrand2018-04-23 18:51:17 +0200
committerEduardo Habkost2018-05-07 15:00:02 +0200
commitb0c14ec4efe912ae6f14a4802574f7b6b6db0648 (patch)
tree87e01fb55fb216721e888739603d07eee337a716 /hw/ppc/spapr_rtas_ddw.c
parentpc-dimm: factor out MemoryDevice interface (diff)
downloadqemu-b0c14ec4efe912ae6f14a4802574f7b6b6db0648.tar.gz
qemu-b0c14ec4efe912ae6f14a4802574f7b6b6db0648.tar.xz
qemu-b0c14ec4efe912ae6f14a4802574f7b6b6db0648.zip
machine: make MemoryHotplugState accessible via the machine
Let's allow to query the MemoryHotplugState directly from the machine. If the pointer is NULL, the machine does not support memory devices. If the pointer is !NULL, the machine supports memory devices and the data structure contains information about the applicable physical guest address space region. This allows us to generically detect if a certain machine has support for memory devices, and to generically manage it (find free address range, plug/unplug a memory region). We will rename "MemoryHotplugState" to something more meaningful ("DeviceMemory") after we completed factoring out the pc-dimm code into MemoryDevice code. Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180423165126.15441-3-david@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> [ehabkost: rebased series, solved conflicts at spapr.c] [ehabkost: squashed fix to use g_malloc0()] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/ppc/spapr_rtas_ddw.c')
-rw-r--r--hw/ppc/spapr_rtas_ddw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/spapr_rtas_ddw.c b/hw/ppc/spapr_rtas_ddw.c
index 177dcffc9b..d3666c1921 100644
--- a/hw/ppc/spapr_rtas_ddw.c
+++ b/hw/ppc/spapr_rtas_ddw.c
@@ -122,7 +122,7 @@ static void rtas_ibm_query_pe_dma_window(PowerPCCPU *cpu,
if (machine->ram_size == machine->maxram_size) {
max_window_size = machine->ram_size;
} else {
- MemoryHotplugState *hpms = &spapr->hotplug_memory;
+ MemoryHotplugState *hpms = machine->device_memory;
max_window_size = hpms->base + memory_region_size(&hpms->mr);
}