diff mbox series

[V11,7/8] hw/arm/virt: use the configure interface

Message ID 1543865209-50994-8-git-send-email-peng.hao2@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series add pvpanic mmio support | expand

Commit Message

Peng Hao Dec. 3, 2018, 7:26 p.m. UTC
Use the configure interface for pvpanic-mmio.

Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 hw/arm/virt-acpi-build.c | 5 ++++-
 hw/arm/virt.c            | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 4215ca6..4990a0d 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -785,7 +785,10 @@  build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
     acpi_dsdt_add_uart(scope, &memmap[VIRT_UART],
                        (irqmap[VIRT_UART] + ARM_SPI_BASE));
     acpi_dsdt_add_flash(scope, &memmap[VIRT_FLASH]);
-    acpi_dsdt_add_pvpanic(scope, &memmap[VIRT_PVPANIC]);
+
+    if (vms->pvpanic) {
+        acpi_dsdt_add_pvpanic(scope, &memmap[VIRT_PVPANIC]);
+    }
     acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]);
     acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO],
                     (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPORTS);
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index fdd3f20..a63e9e1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -198,6 +198,9 @@  static void create_pvpanic_device(const VirtMachineState *vms)
     hwaddr base = vms->memmap[VIRT_PVPANIC].base;
     hwaddr size = vms->memmap[VIRT_PVPANIC].size;
 
+    if (!vms->pvpanic) {
+        return;
+    }
     sysbus_create_simple(TYPE_PVPANIC_MMIO, base, NULL);
 
     nodename = g_strdup_printf("/pvpanic-mmio@%" PRIx64, base);