OSDN Git Service

hw/ppc/spapr: Use machine_memory_devices_init()
authorDavid Hildenbrand <david@redhat.com>
Fri, 23 Jun 2023 12:45:47 +0000 (14:45 +0200)
committerDavid Hildenbrand <david@redhat.com>
Wed, 12 Jul 2023 07:25:37 +0000 (09:25 +0200)
commitc0ce7b4acb61c6a8376ff9e0d5cae2d58ac3bf1b
tree3d0f753744f5645b1f477e8caaf6ae2f08dfea97
parent176d073029083dd52e28e92c5712d0535a83c34d
hw/ppc/spapr: Use machine_memory_devices_init()

Let's use our new helper and stop always allocating ms->device_memory.
There is no difference in common memory-device code anymore between
ms->device_memory being NULL or the size being 0. So we only have to
teach spapr code that ms->device_memory isn't always around.

We can now modify two maxram_size checks to rely on ms->device_memory
for detecting whether we have memory devices.

Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: "Cédric Le Goater" <clg@kaod.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Greg Kurz <groug@kaod.org>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230623124553.400585-5-david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
hw/ppc/spapr.c
hw/ppc/spapr_hcall.c