OSDN Git Service

hw/i386/acpi-build: Rely on machine->device_memory when building SRAT
authorDavid Hildenbrand <david@redhat.com>
Fri, 23 Jun 2023 12:45:50 +0000 (14:45 +0200)
committerDavid Hildenbrand <david@redhat.com>
Wed, 12 Jul 2023 07:25:37 +0000 (09:25 +0200)
commit75d5f34396c7f951f99a8c9800db29b4a98c8f67
tree0e2d0557fd5f0d7f42470964a996744d5a402b80
parent78732a765986d5270d6b3d88afeb9e4d33092360
hw/i386/acpi-build: Rely on machine->device_memory when building SRAT

We're already looking at machine->device_memory when calling
build_srat_memory(), so let's simply avoid going via
PC_MACHINE_DEVMEM_REGION_SIZE to get the size and rely on
machine->device_memory directly.

Once machine->device_memory is set, we know that the size > 0. The code now
looks much more similar the hw/arm/virt-acpi-build.c variant.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Eduardo Habkost <eduardo@habkost.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230623124553.400585-8-david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
hw/i386/acpi-build.c