[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/20] hw/dma/i82374: Avoid double creation of the 82
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 12/20] hw/dma/i82374: Avoid double creation of the 82374 controller |
Date: |
Fri, 6 Apr 2018 19:11:13 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
QEMU fails when used with the following command line:
./ppc64-softmmu/qemu-system-ppc64 -S -machine 40p -device i82374
qemu-system-ppc64: hw/isa/isa-bus.c:110: isa_bus_dma: Assertion
`!bus->dma[0] && !bus->dma[1]' failed.
The 40p machine type already creates the device i82374. If specified in the
command line, it will try to create it again, hence generating the error. The
function isa_bus_dma() isn't supposed to be called twice for the same bus.
Check the bus doesn't already have a DMA controller registered before creating
the device.
Fixes: https://bugs.launchpad.net/qemu/+bug/1721224
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/dma/i82374.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c
index 83c87d9..892f655 100644
--- a/hw/dma/i82374.c
+++ b/hw/dma/i82374.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "hw/isa/isa.h"
#include "hw/dma/i8257.h"
@@ -118,13 +119,19 @@ static const MemoryRegionPortio i82374_portio_list[] = {
static void i82374_realize(DeviceState *dev, Error **errp)
{
I82374State *s = I82374(dev);
+ ISABus *isa_bus = isa_bus_from_device(ISA_DEVICE(dev));
+
+ if (isa_get_dma(isa_bus, 0)) {
+ error_setg(errp, "DMA already initialized on ISA bus");
+ return;
+ }
+ i8257_dma_init(isa_bus, true);
portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s,
"i82374");
portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj),
s->iobase);
- i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), true);
memset(s->commands, 0, sizeof(s->commands));
}
--
1.8.3.1
- [Qemu-devel] [PULL 01/20] sys_membarrier: fix up include directives, (continued)
- [Qemu-devel] [PULL 01/20] sys_membarrier: fix up include directives, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 04/20] memfd: fix vhost-user-test on non-memfd capable host, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 05/20] target/i386: WHPX: set CPUID_EXT_HYPERVISOR bit, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 02/20] target/i386: Fix andn instruction, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 06/20] i386/hyperv: add hv-frequencies cpu property, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 07/20] i386/hyperv: error out if features requested but unsupported, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 08/20] configure: Add missing configure options to help text, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 09/20] scsi-disk: Don't enlarge min_io_size to max_io_size, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 11/20] hw/scsi: support SCSI-2 passthrough without PI, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 12/20] hw/dma/i82374: Avoid double creation of the 82374 controller,
Paolo Bonzini <=
- [Qemu-devel] [PULL 10/20] scsi-disk: allow customizing the SCSI version, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 13/20] kvmclock: fix clock_is_reliable on migration from QEMU < 2.9, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 14/20] virtio-serial: fix heapover-flow, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 15/20] qemu-pr-helper: Daemonize before dropping privileges, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 16/20] qemu-pr-helper: Write pidfile more often, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 17/20] device-crash-test: Remove fixed isa-fdc entry, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 18/20] dump: Fix build with newer gcc, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 20/20] Add missing bit for SSE instr in VEX decoding, Paolo Bonzini, 2018/04/06
- [Qemu-devel] [PULL 19/20] maint: Add .mailmap entries for patches claiming list authorship, Paolo Bonzini, 2018/04/06
- Re: [Qemu-devel] [PULL 00/20] Miscellaneous patches for QEMU 2.12-rc, Peter Maydell, 2018/04/09