• Joerg Roedel's avatar
    iommu/amd: Fix checking of pci dma aliases · 80424d70
    Joerg Roedel authored
    commit e3156048 upstream.
    
    Commit 61289cba ('iommu/amd: Remove old alias handling code')
    removed the old alias handling code from the AMD IOMMU
    driver because this is now handled by the IOMMU core code.
    
    But this also removed the handling of PCI aliases, which is
    not handled by the core code. This caused issues with PCI
    devices that have hidden PCIe-to-PCI bridges that rewrite
    the request-id.
    
    Fix this bug by re-introducing some of the removed functions
    from commit 61289cba and add a alias field
    'struct iommu_dev_data'. This field carrys the return value
    of the get_alias() function and uses that instead of the
    amd_iommu_alias_table[] array in the code.
    
    Fixes: 61289cba ('iommu/amd: Remove old alias handling code')
    Tested-by: default avatarTomasz Golinski <tomaszg@math.uwb.edu.pl>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    80424d70
amd_iommu.c 95.7 KB