From 1c380f9460522f32c8dd2577b2a53d518ec91c6d Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 3 Oct 2012 17:42:58 +0200 Subject: pci: honor PCI_COMMAND_MASTER Currently we ignore PCI_COMMAND_MASTER completely: DMA succeeds even when the bit is clear. Honor PCI_COMMAND_MASTER by inserting a memory region into the device's bus master address space, and tying its enable status to PCI_COMMAND_MASTER. Tested using setpci -s 03 COMMAND=3 while a ping was running on a NIC in slot 3. The kernel (Linux) detected the stall and recovered after the command setpci -s 03 COMMAND=7 was issued. Signed-off-by: Avi Kivity --- hw/pci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/pci.h') diff --git a/hw/pci.h b/hw/pci.h index f9207ca..1f902f5 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -212,6 +212,7 @@ struct PCIDevice { char name[64]; PCIIORegion io_regions[PCI_NUM_REGIONS]; AddressSpace bus_master_as; + MemoryRegion bus_master_enable_region; DMAContext *dma; /* do not access the following fields */ -- cgit v1.1