• Niklas Schnelle's avatar
    s390/pci: use physical addresses in DMA tables · 568de506
    Niklas Schnelle authored
    The entries in the DMA translation tables for our IOMMU must specify
    physical addresses of either the next level table or the final page
    to be mapped for DMA. Currently however the code simply passes the
    virtual addresses of both. On the other hand we still need to walk the
    tables via their virtual addresses so we need to do a phys_to_virt()
    when setting the entries and a virt_to_phys() when getting them.
    Similarly when passing the I/O translation anchor to the hardware we
    must also specify its physical address.
    
    As the DMA and IOMMU APIs we are implementing already use the correct
    phys_addr_t type for the address to be mapped let's also thread this
    through instead of treating it as just an unsigned long.
    
    Note: this currently doesn't fix a real bug, since virtual addresses
    are indentical to physical ones.
    Reviewed-by: default avatarPierre Morel <pmorel@linux.ibm.com>
    Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    568de506
pci.c 27.7 KB