• D
    Add stub functions for PCI device models to do PCI DMA · ec174575
    David Gibson 提交于
    This patch adds functions to pci.[ch] to perform PCI DMA operations.
    At present, these are just stubs which perform directly cpu physical
    memory accesses.  Stubs are included which are analogous to
    cpu_physical_memory_{read,write}(), the stX_phys() and ldX_phys()
    functions and cpu_physical_memory_{map,unmap}().
    
    In addition, a wrapper around qemu_sglist_init() is provided, which
    also takes a PCIDevice *.  It's assumed that _init() is the only
    sglist function which will need wrapping, the idea being that once we
    have IOMMU support whatever IOMMU context handle the wrapper derives
    from the PCI device will be stored within the sglist structure for
    later use.
    
    Using these stubs, however, distinguishes PCI device DMA transactions from
    other accesses to physical memory, which will allow PCI IOMMU support to
    be added in one place, rather than updating every PCI driver at that time.
    
    That is, it allows us to update individual PCI drivers to support an IOMMU
    without having yet determined the details of how the IOMMU emulation will
    operate.  This will let us remove the most bitrot-sensitive part of an
    IOMMU patch in advance.
    Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
    ec174575
pci.h 16.6 KB