Il 24/04/2013 14:01, David Gibson ha scritto: > In commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d "pci: honor > PCI_COMMAND_MASTER" the PCI_COMMAND_MASTER bit of the PCI command register > was implemented by toggling the enable bit on a memory region alias > interposed between the PCI device's dma address space and the main > system memory region. > > Introducing an extra alias region for every PCI device just to implement > that bit seems like serious overkill. Furthermore, it doesn't work when > there's a (guest side) iommu present, since that uses a different path for > constructing the PCI device's dma address space. > > This patch removes the aliased window, instead implementing > PCI_COMMAND_MASTER with tests in the PCI DMA functions. > > Signed-off-by: David Gibson <da...@gibson.dropbear.id.au>
This doesn't work. You have no guarantee that PCI devices use the PCI DMA functions. The device could just pass the DMAContext to another function, and indeed the OHCI controller does exactly that. This will be even simpler after IOMMU/DMAContext are also unified in the AddressSpace framework. Paolo