From c3019efc713c0afd6f0c51602b378f1094ef6e89 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Sun, 16 Dec 2018 22:52:10 +0100 Subject: hw/sparc64: Create VGA device only if it has really been requested The sun4u/sun4v machine currently always creates a VGA device, even if the user started QEMU with "-nodefaults" or "-vga none". That's likely not what the users expect in this case, so add a check whether the VGA adapter has really been requested. Signed-off-by: Thomas Huth Signed-off-by: Mark Cave-Ayland --- hw/sparc64/sun4u.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'hw/sparc64') diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index f76b19e4e9..37ecc14c6d 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -596,7 +596,15 @@ static void sun4uv_init(MemoryRegion *address_space_mem, qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 4, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_SER_IRQ)); - pci_dev = pci_create_simple(pci_busA, PCI_DEVFN(2, 0), "VGA"); + switch (vga_interface_type) { + case VGA_STD: + pci_create_simple(pci_busA, PCI_DEVFN(2, 0), "VGA"); + break; + case VGA_NONE: + break; + default: + abort(); /* Should not happen - types are checked in vl.c already */ + } memset(&macaddr, 0, sizeof(MACAddr)); onboard_nic = false; -- cgit v1.2.3 From ad280559c68360c9f1cd7be063857853759e6a73 Mon Sep 17 00:00:00 2001 From: Prasad J Pandit Date: Fri, 4 Jan 2019 15:19:10 +0530 Subject: sun4u: add power_mem_read routine Define skeleton 'power_mem_read' routine. Avoid NULL dereference. Reported-by: Fakhri Zulkifli Signed-off-by: Prasad J Pandit Signed-off-by: Mark Cave-Ayland --- hw/sparc64/sun4u.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw/sparc64') diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 37ecc14c6d..518d695de3 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -214,6 +214,11 @@ typedef struct PowerDevice { } PowerDevice; /* Power */ +static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0; +} + static void power_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { @@ -224,6 +229,7 @@ static void power_mem_write(void *opaque, hwaddr addr, } static const MemoryRegionOps power_mem_ops = { + .read = power_mem_read, .write = power_mem_write, .endianness = DEVICE_NATIVE_ENDIAN, .valid = { -- cgit v1.2.3