History | View | Annotate | Download (9.5 kB)
dma: Define dma_context_memory and use in sysbus-ohci
Define a new global dma_context_memory which is a DMAContext correspondingto the global address_space_memory AddressSpace. This can be used bysysbus peripherals like sysbus-ohci which need to do DMA....
Rename target_phys_addr_t to hwaddr
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes arereserved) and its purpose doesn't match the name (most target_phys_addr_taddresses are not target specific). Replace it with a finger-friendly,...
dma: make dma access its own address space
Instead of accessing the cpu address space, use an address spaceconfigured by the caller.
Eventually all dma functionality will be folded into AddressSpace,but we have to start from something.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
Make target_phys_addr_t 64 bits unconditionally
The hassle and compile time overhead of maintaining both 32-bit and 64-bitcapable source isn't worth the tiny performance advantage which is seen ona minority of configurations. Switch to compiling libhw only once, with...
Avoid returning void
It's silly and non-conforming to standards to return void,don't do it.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add a memory barrier to DMA functions
The emulated devices can run simultaneously with the guest, sowe need to be careful with ordering of load and stores done bythem to the guest system memory, which need to be observed inthe right order by the guest operating system....
Better support for dma_addr_t variables
A while back, we introduced the dma_addr_t type, which is supposed tobe used for bus visible memory addresses. At present, this is analias for target_phys_addr_t, but this will change when we eventuallyadd support for guest visible IOMMUs....
iommu: Add universal DMA helper functions
Not that long ago, every device implementation using DMA directlyaccessed guest memory using cpu_physical_memory_*(). This meant thatadding support for a guest visible IOMMU would require changing everyone of these devices to go through IOMMU translation....
iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers
dma-helpers.c contains a number of helper functions for doingscatter/gather DMA, and various block device related DMA. Currently,these directly access guest memory using cpu_physical_memory_*(),...
iommu: Introduce IOMMU emulation infrastructure
This patch adds the basic infrastructure necessary to emulate an IOMMUvisible to the guest. The DMAContext structure is extended withinformation and a callback describing the translation, and the various...
Merge remote-tracking branch 'kwolf/for-anthony' into staging
remove useless comments in dma
This comment is useless, just removes it and makes the codes clear.
Signed-off-by: Wanpeng Li <liwp@linux.vnet.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Use DMADirection type for dma_bdrv_io
Currently dma_bdrv_io() takes a 'to_dev' boolean parameter todetermine the direction of DMA it is emulating. We already have aDMADirection enum designed specifically to encode DMA directions.This patch uses it for dma_bdrv_io() as well. This involves removing...
dma-helpers: add dma_buf_read and dma_buf_write
These helpers do a full transfer from an in-memory buffer to targetmemory, with support for scatter/gather lists. It will be used tostore the reply of an emulated command into a QEMUSGList provided bythe adapter....
dma-helpers: add accounting wrappers
The length of the transfer is already in the sglist, the wrapper simplyfetches it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dma-helpers: make QEMUSGList target independent
scsi-disk will manage scatter/gather list, but it does not createsingle entries so it remains target-independent. Make QEMUSGListavailable to it.
Define DMA address and direction types
As a preliminary to adding more extensive DMA and IOMMU infrastructuresupport into qemu, this patch defines a dma_addr_t for storing DMA busaddresses and a DMADirection enum which describes whether a DMA isfrom an external device to main memory or from main memory to an...
Use dma_addr_t type for scatter/gather code
This patch uses the newly created dma_addr_t type throughout thescatter/gather handling code in dma-helpers.c whenever we need torepresent a dma bus address. This makes a better distinction as towhat is a bus address and what is a cpu physical address. Since we...
dma-helpers: allow including from target-independent code
Target-independent code cannot construct sglists, but it can takethem from the outside as a black box. Allow this.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
dma-helpers: rename is_write to to_dev
move QEMUSGList typedef
Move the QEMUSGList typedef to qemu-common so it can easily be used.The actual struct definition stays in dma.h.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
make dma_bdrv_io available to drivers
Make dma_bdrv_io available for drivers, and pass an explicit I/O functioninstead of hardcoding bdrv_aio_readv/bdrv_aio_writev. This is requiredto implement non-READ/WRITE dma commands in the ide driver, e.g. theupcoming TRIM support....
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
fully split aio_pool from BlockDriver
Now that we have a separate aio pool structure we can remove thoseaio pool details from BlockDriver.
Every driver supporting AIO now needs to declare a static AIOPoolwith the aiocb size and the cancellation method. This cleans up the...
Hardware convenience library
The only target dependency for most hardware is sizeof(target_phys_addr_t).Build these files into a convenience library, and use that instead ofbuilding for every target.
Remove and poison various target specific macros to avoid bogus target...
Implement cancellation method for dma async I/O (Avi Kivity)
Move the dma helpers to a private aio pool, and implement a cancellationmethod for them. Should prevent issues when cancelling I/O while dma isin progress.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Introduce block dma helpers (Avi Kivity)
These helpers perform read/write requests on entire scatter/gather lists,relieving the device emulation code from mapping and unmapping physicalmemory, and from looping when map resources are exhausted.
Add a scatter-gather list type and accessors (Avi Kivity)
Scatter-gather lists are used extensively in dma-capable devices; asingle data structure allows more code reuse later on.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...