Commit 3c60e58d authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Lee Jones
Browse files

UPSTREAM: iommu/amd: Add missing domain type checks



Drivers are supposed to list the domain types they support in their
domain_alloc() ops so when we add new domain types, like BLOCKING or SVA,
they don't start breaking.

This ended up providing an empty UNMANAGED domain when the core code asked
for a BLOCKING domain, which happens to be the fallback for drivers that
don't support it, but this is completely wrong for SVA.

Check for the DMA types AMD supports and reject every other kind.

Bug: 254441685
Fixes: 13646796 ("iommu: Add IOMMU SVA domain support")
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarVasant Hegde <vasant.hegde@amd.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/0-v1-2ac37b893728+da-amd_check_types_jgg@nvidia.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
(cherry picked from commit 29f54745)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: Id103dd8992f7a094e47ab5878c969dafe5c26f25
parent 820f96cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment