]> git.proxmox.com Git - qemu.git/commit
workaround for cmd646 bmdma register access while no dma is active
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>
Sun, 13 Dec 2009 19:03:31 +0000 (19:03 +0000)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 19 Mar 2010 21:54:17 +0000 (22:54 +0100)
commit18a21890ff2b24bc7f0cdc3807e2fb65e014522b
tree22fe33a5f9775eff5dada8626ba899d1b1d2bee8
parent6629fa647330f6d28ba843cda2c0700dc7d4c952
workaround for cmd646 bmdma register access while no dma is active

This is a workaround only, and is a partial revert
of a few changes to BMDMAState which removed pci_dev
field on the way.

- cmd646 pci_from_bm() expects bm->unit value to
correspond with bm data being passed to callback
as opaque pointer. This breaks when write to dma
control register of second channel happens when no
dma operation is in progress, so bm->unit is zero
for second channel, and pci_from_bm() returns garbage
pointer. Crash happens shortly after that while
dereferencing that pointer.

v0->v1: cleaned up dead code from pci_from_bm.

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit 90228ee395b71cdd64e6bc844e3d553eb9ef643f)
hw/ide/cmd646.c
hw/ide/internal.h
hw/ide/piix.c