]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu/vt-d: Refine intel_iommu_domain_alloc_user()
authorLu Baolu <baolu.lu@linux.intel.com>
Mon, 4 Nov 2024 01:40:27 +0000 (09:40 +0800)
committerJoerg Roedel <jroedel@suse.de>
Tue, 5 Nov 2024 12:32:19 +0000 (13:32 +0100)
commit621838c718a81ba3bfb8e0f941bc0133166bc534
tree6685ffd5cea025f38828ec5c28b45d605d48c8a8
parented56de8a9e90d9771c4517fb9f2daac8282269ba
iommu/vt-d: Refine intel_iommu_domain_alloc_user()

The domain_alloc_user ops should always allocate a guest-compatible page
table unless specific allocation flags are specified.

Currently, IOMMU_HWPT_ALLOC_NEST_PARENT and IOMMU_HWPT_ALLOC_DIRTY_TRACKING
require special handling, as both require hardware support for scalable
mode and second-stage translation. In such cases, the driver should select
a second-stage page table for the paging domain.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20241021085125.192333-8-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c