drivers: iommu: Add flags to iommu_domain_alloc

Add the ability to pass flags into the iommu_domain_alloc
function to specify domain attributes.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
This commit is contained in:
Stepan Moskovchenko 2011-08-31 17:13:32 -07:00 committed by Stephen Boyd
parent 42447ab02f
commit 8984b0e30d
4 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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;