diff options
author | Vasant Hegde <vasant.hegde@amd.com> | 2024-04-18 13:34:00 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2024-04-26 13:16:08 +0300 |
commit | a5a91e54846d35c234939fb9170e035805353049 (patch) | |
tree | 95b51d0aa733b63c8d457a8259777b22642d5090 /drivers/iommu/amd/amd_iommu.h | |
parent | 80af5a45202422db957549a241e00bf4d4e0ce89 (diff) | |
download | linux-a5a91e54846d35c234939fb9170e035805353049.tar.xz |
iommu/amd: Add SVA domain support
- Allocate SVA domain and setup mmu notifier. In free path unregister
mmu notifier and free protection domain.
- Add mmu notifier callback function. It will retrieve SVA protection
domain and invalidates IO/TLB.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240418103400.6229-16-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd/amd_iommu.h')
-rw-r--r-- | drivers/iommu/amd/amd_iommu.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h index 49462d073132..0005da7af739 100644 --- a/drivers/iommu/amd/amd_iommu.h +++ b/drivers/iommu/amd/amd_iommu.h @@ -45,6 +45,11 @@ extern enum io_pgtable_fmt amd_iommu_pgtable; extern int amd_iommu_gpt_level; /* Protection domain ops */ +struct protection_domain *protection_domain_alloc(unsigned int type); +void protection_domain_free(struct protection_domain *domain); +struct iommu_domain *amd_iommu_domain_alloc_sva(struct device *dev, + struct mm_struct *mm); +void amd_iommu_domain_free(struct iommu_domain *dom); int iommu_sva_set_dev_pasid(struct iommu_domain *domain, struct device *dev, ioasid_t pasid); void amd_iommu_remove_dev_pasid(struct device *dev, ioasid_t pasid); |