diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 3755aa832ee..7fa63b1e243 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -643,7 +643,7 @@ void iommu_set_fault_handler(struct iommu_domain *domain, } EXPORT_SYMBOL_GPL(iommu_set_fault_handler); -struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) +struct iommu_domain *iommu_domain_alloc(struct bus_type *bus, int flags) { struct iommu_domain *domain; int ret; @@ -657,7 +657,7 @@ struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) domain->ops = bus->iommu_ops; - ret = domain->ops->domain_init(domain); + ret = domain->ops->domain_init(domain, flags); if (ret) goto out_free; diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 8ab4f41090a..dac17466cb7 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -210,7 +210,7 @@ static void __program_context(void __iomem *base, int ctx, phys_addr_t pgtable) SET_M(base, ctx, 1); } -static int msm_iommu_domain_init(struct iommu_domain *domain) +static int msm_iommu_domain_init(struct iommu_domain *domain, int flags) { struct msm_priv *priv = kzalloc(sizeof(*priv), GFP_KERNEL); diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 36b27cdb16c..a77c8f5791e 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -85,7 +85,7 @@ enum iommu_attr { * @pgsize_bitmap: bitmap of supported page sizes */ struct iommu_ops { - int (*domain_init)(struct iommu_domain *domain); + int (*domain_init)(struct iommu_domain *domain, int flags); void (*domain_destroy)(struct iommu_domain *domain); int (*attach_dev)(struct iommu_domain *domain, struct device *dev); void (*detach_dev)(struct iommu_domain *domain, struct device *dev); @@ -129,7 +129,7 @@ struct iommu_ops { extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); extern bool iommu_present(struct bus_type *bus); -extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); +extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus, int flags); extern struct iommu_group *iommu_group_get_by_id(int id); extern void iommu_domain_free(struct iommu_domain *domain); extern int iommu_attach_device(struct iommu_domain *domain, @@ -233,7 +233,7 @@ static inline bool iommu_present(struct bus_type *bus) return false; } -static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) +static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus, int flags) { return NULL; } diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index 72a130bc448..6ddd7b4d9c3 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c @@ -240,7 +240,7 @@ int kvm_iommu_map_guest(struct kvm *kvm) mutex_lock(&kvm->slots_lock); - kvm->arch.iommu_domain = iommu_domain_alloc(&pci_bus_type); + kvm->arch.iommu_domain = iommu_domain_alloc(&pci_bus_type, 0); if (!kvm->arch.iommu_domain) { r = -ENOMEM; goto out_unlock;