diff options
| author | Lu Baolu <[email protected]> | 2023-10-26 04:42:15 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2023-10-26 14:16:34 +0000 |
| commit | b41e38e225398191aaa0f1115d6234f57ffd0741 (patch) | |
| tree | b412993e8e2d760cd95da68852290182c7f49a8d /drivers/iommu/intel/nested.c | |
| parent | iommu/vt-d: Set the nested domain to a device (diff) | |
| download | kernel-b41e38e225398191aaa0f1115d6234f57ffd0741.tar.gz kernel-b41e38e225398191aaa0f1115d6234f57ffd0741.zip | |
iommu/vt-d: Add nested domain allocation
This adds the support for IOMMU_HWPT_DATA_VTD_S1 type. And 'nested_parent'
is added to mark the nested parent domain to sanitize the input parent domain.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Lu Baolu <[email protected]>
Signed-off-by: Yi Liu <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/iommu/intel/nested.c')
| -rw-r--r-- | drivers/iommu/intel/nested.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iommu/intel/nested.c b/drivers/iommu/intel/nested.c index b560ab76e126..b5a5563ab32c 100644 --- a/drivers/iommu/intel/nested.c +++ b/drivers/iommu/intel/nested.c @@ -89,7 +89,8 @@ struct iommu_domain *intel_nested_domain_alloc(struct iommu_domain *parent, /* Must be nested domain */ if (user_data->type != IOMMU_HWPT_DATA_VTD_S1) return ERR_PTR(-EOPNOTSUPP); - if (parent->ops != intel_iommu_ops.default_domain_ops) + if (parent->ops != intel_iommu_ops.default_domain_ops || + !s2_domain->nested_parent) return ERR_PTR(-EINVAL); ret = iommu_copy_struct_from_user(&vtd, user_data, |
