]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/amd: Enhance amd_iommu_domain_alloc_user()
authorVasant Hegde <vasant.hegde@amd.com>
Mon, 28 Oct 2024 09:38:07 +0000 (09:38 +0000)
committerJoerg Roedel <jroedel@suse.de>
Tue, 29 Oct 2024 09:08:22 +0000 (10:08 +0100)
commitce2cd175469f6cb56e8de9bf87805206c8d19764
tree22f77c41bda4638ec3b48bd5c88489cd79eb7138
parenta005ef62f9922ae023aec63d673217486656b6bc
iommu/amd: Enhance amd_iommu_domain_alloc_user()

Previous patch enhanced core layer to check device PASID capability and
pass right flags to ops->domain_alloc_user().

Enhance amd_iommu_domain_alloc_user() to allocate domain with
appropriate page table based on flags parameter.
  - If flags is empty then allocate domain with default page table type.
    This will eventually replace ops->domain_alloc().
    For UNMANAGED domain, core will call this interface with flags=0. So
    AMD driver will continue to allocate V1 page table.

  - If IOMMU_HWPT_ALLOC_PASID flags is passed then allocate domain with v2
    page table.

Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20241028093810.5901-10-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu.c