PPC: dbdma: Support unaligned DMA access

Enterprise / Virtualization / QEMU - Alexander Graf [suse.de] - 11 July 2013 11:51 UTC

The DBDMA engine really just reads bytes from a producing device (IDE in our case) and shoves these bytes into memory. It doesn't care whether any alignment takes place or not.

Our code today however assumes that block accesses always happen on sector (512 byte) boundaries. This is a fair assumption for most cases.

However, Mac OS X really likes to do unaligned, incomplete accesses that it finishes with the next DMA request.

So we need to read / write the unaligned bits independent of the actual asynchronous request, because that one can only handle 512-byte-aligned data. We also need to cache these unaligned sectors until the next DMA request, at which point the data might be successfully flushed from the pipe.

80fc95d PPC: dbdma: Support unaligned DMA access
hw/ide/macio.c | 131 +++++++++++++++++++++++++++++++++++++++++---
include/hw/ppc/mac_dbdma.h | 3 +
2 files changed, 127 insertions(+), 7 deletions(-)

Upstream: git.qemu.org


  • Share