iommu/amd: Refactor attaching / detaching device functions
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Mon, 5 Feb 2024 11:56:09 +0000 (11:56 +0000)
committerJoerg Roedel <jroedel@suse.de>
Fri, 9 Feb 2024 12:16:27 +0000 (13:16 +0100)
commit4ebd4c7f2501cc5876717e0f2382d5b825e59405
treea070baf585b8834c44ae290c8f4d52ad365934fa
parente8e1aac33458d80545e5ad37b2a3e4243eee278e
iommu/amd: Refactor attaching / detaching device functions

If domain is configured with V2 page table then setup default GCR3
with domain GCR3 pointer. So that all devices in the domain uses same page
table for translation. Also return page table setup status from do_attach()
function.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Co-developed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240205115615.6053-12-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu.c