const struct iommu_user_data *user_data)
{
struct arm_smmu_master *master = dev_iommu_priv_get(dev);
- const u32 PAGING_FLAGS = IOMMU_HWPT_ALLOC_DIRTY_TRACKING;
+ const u32 PAGING_FLAGS = IOMMU_HWPT_ALLOC_DIRTY_TRACKING |
- - IOMMU_HWPT_ALLOC_PASID;
++++ IOMMU_HWPT_ALLOC_PASID |
+++ IOMMU_HWPT_ALLOC_NEST_PARENT;
struct arm_smmu_domain *smmu_domain;
int ret;
static int domain_setup_first_level(struct intel_iommu *iommu,
struct dmar_domain *domain,
struct device *dev,
- -- u32 pasid)
+ ++ u32 pasid, struct iommu_domain *old)
{
struct dma_pte *pgd = domain->pgd;
- -- int agaw, level;
- -- int flags = 0;
-
- /*
- * Skip top levels of page tables for iommu which has
- * less agaw than default. Unnecessary for PT mode.
- */
- for (agaw = domain->agaw; agaw > iommu->agaw; agaw--) {
- pgd = phys_to_virt(dma_pte_addr(pgd));
- if (!dma_pte_present(pgd))
- return -ENOMEM;
- }
+ ++ int level, flags = 0;
-- /*
-- * Skip top levels of page tables for iommu which has
-- * less agaw than default. Unnecessary for PT mode.
-- */
-- for (agaw = domain->agaw; agaw > iommu->agaw; agaw--) {
-- pgd = phys_to_virt(dma_pte_addr(pgd));
-- if (!dma_pte_present(pgd))
-- return -ENOMEM;
-- }
--
- -- level = agaw_to_level(agaw);
+ ++ level = agaw_to_level(domain->agaw);
if (level != 4 && level != 5)
return -EINVAL;
};
}
---extern int bus_iommu_probe(const struct bus_type *bus);
+ extern bool iommu_present(const struct bus_type *bus);
extern bool device_iommu_capable(struct device *dev, enum iommu_cap cap);
extern bool iommu_group_has_isolated_msi(struct iommu_group *group);
- -extern struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus);
- -struct iommu_domain *iommu_paging_domain_alloc(struct device *dev);
+ +struct iommu_domain *iommu_paging_domain_alloc_flags(struct device *dev, unsigned int flags);
+ +static inline struct iommu_domain *iommu_paging_domain_alloc(struct device *dev)
+ +{
+ + return iommu_paging_domain_alloc_flags(dev, 0);
+ +}
extern void iommu_domain_free(struct iommu_domain *domain);
extern int iommu_attach_device(struct iommu_domain *domain,
struct device *dev);