Messages in this thread | ![/](/images/icornerl.gif) | | Date | Fri, 11 Dec 2009 18:38:09 -0600 | Subject | Re: Does pci_map_single magicly work on > 32 bit address for 32bit capable device? | From | Robert Hancock <> |
| |
On Fri, Dec 11, 2009 at 6:18 PM, Maxim Levitsky <maximlevitsky@gmail.com> wrote: >> The kernel should set up an IOMMU (either hardware or software) mapping >> for that memory so that the device can access it through an address >> below 4GB. This is assuming it's a 64-bit kernel (on 32-bit, a kernel >> memory address will always be below 4GB). > > What do you mean by software IOMMU? > > On my system there is no IOMMU present, so only way to ensure 32 bit > address is to copy pages. > pci_map_single could copy the data for write case, and pci_unmap_single > for read case, but I now strongly doubt they do.
It does. See the swiotlb code. You should see some message on bootup like:
PCI-DMA: Using software bounce buffering for IO (SWIOTLB) Placing 64MB software IO TLB between ffff880020000000 - ffff880024000000 software IO TLB at phys 0x20000000 - 0x24000000
> I am not sure at all that these functions will fail if too high address > is specified.... > > Also, very recently, I found that in > Documentation/DMA-API.txt, there is a statement that says that > pci_map_single fails for >32 bit memory address.
Where do you see this?
> > I guess I just do a memcpy...
This isn't optimal because if there is a hardware IOMMU, the copy can be avoided.
| ![\](/images/icornerr.gif) |