summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2022-12-07 23:44:43 +0300
committerJason Gunthorpe <jgg@nvidia.com>2022-12-09 22:24:30 +0300
commitd6c55c0a20e5059abdde81713ddf6324a946eb3c (patch)
tree4776645a117fe8140102f412a04b20f451a40bd6 /lib
parenta26fa392068d1dcdf781397b7a7dd908dd68f030 (diff)
downloadlinux-d6c55c0a20e5059abdde81713ddf6324a946eb3c.tar.xz
iommufd: Change the order of MSI setup
Eric points out this is wrong for the rare case of someone using allow_unsafe_interrupts on ARM. We always have to setup the MSI window in the domain if the iommu driver asks for it. Move the iommu_get_msi_cookie() setup to the top of the function and always do it, regardless of the security mode. Add checks to iommufd_device_setup_msi() to ensure the driver is not doing something incomprehensible. No current driver will set both a HW and SW MSI window, or have more than one SW MSI window. Fixes: e8d57210035b ("iommufd: Add kAPI toward external drivers for physical devices") Link: https://lore.kernel.org/r/3-v1-0362a1a1c034+98-iommufd_fixes1_jgg@nvidia.com Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reported-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions