[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/10] PPC: Get rid of segfaults in DBDMA emulation
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 07/10] PPC: Get rid of segfaults in DBDMA emulation |
Date: |
Tue, 9 Feb 2010 17:37:07 +0100 |
While trying to find the right channel number for the DBDMA emulation I
stumbled across segmentation faults that were purely triggered by the guest.
The guest should never have the possiblity to segfault us, so let's check
all indirect function calls on a channel, so the code even works for channels
that have not been reserved.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/mac_dbdma.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/mac_dbdma.c b/hw/mac_dbdma.c
index 8ec3d99..8f94c35 100644
--- a/hw/mac_dbdma.c
+++ b/hw/mac_dbdma.c
@@ -402,7 +402,9 @@ static void start_output(DBDMA_channel *ch, int key,
uint32_t addr,
ch->io.dma_end = dbdma_end;
ch->io.is_dma_out = 1;
ch->processing = 1;
- ch->rw(&ch->io);
+ if (ch->rw) {
+ ch->rw(&ch->io);
+ }
}
static void start_input(DBDMA_channel *ch, int key, uint32_t addr,
@@ -425,7 +427,9 @@ static void start_input(DBDMA_channel *ch, int key,
uint32_t addr,
ch->io.dma_end = dbdma_end;
ch->io.is_dma_out = 0;
ch->processing = 1;
- ch->rw(&ch->io);
+ if (ch->rw) {
+ ch->rw(&ch->io);
+ }
}
static void load_word(DBDMA_channel *ch, int key, uint32_t addr,
@@ -688,7 +692,7 @@ dbdma_control_write(DBDMA_channel *ch)
if (status & ACTIVE)
qemu_bh_schedule(dbdma_bh);
- if (status & FLUSH)
+ if ((status & FLUSH) && ch->flush)
ch->flush(&ch->io);
}
--
1.6.0.2
- [Qemu-devel] [PATCH 00/10] PPC NewWorld fixery v4, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 06/10] PPC: Use macio IDE controller for Newworld, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 08/10] PPC: Add USB per default on U3, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 04/10] PPC: Make interrupts work, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 03/10] PPC: Include dump of lspci -nn on real G5, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 07/10] PPC: Get rid of segfaults in DBDMA emulation,
Alexander Graf <=
- [Qemu-devel] [PATCH 10/10] PPC: Add timer when running KVM, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 09/10] PPC: Fix large pages, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 01/10] PPC: Uninorth config space accessor, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 05/10] PPC: tell the guest about the time base frequency, Alexander Graf, 2010/02/09
- [Qemu-devel] [PATCH 02/10] PPC: Use Mac99_U3 type on ppc64, Alexander Graf, 2010/02/09
- [Qemu-devel] Re: [PATCH 00/10] PPC NewWorld fixery v4, Michael S. Tsirkin, 2010/02/09