search for: ida_alloc_rang

Displaying 13 results from an estimated 13 matches for "ida_alloc_rang".

Did you mean: ida_alloc_range
2020 Apr 15
0
[PATCH AUTOSEL 5.6 107/129] iommu/virtio: Fix freeing of incomplete domains
...iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -613,18 +613,20 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, int ret; struct viommu_domain *vdomain = to_viommu_domain(domain); - vdomain->viommu = viommu; - vdomain->map_flags = viommu->map_flags; + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); + if (ret < 0) + return ret; + + vdomain->id = (unsigned int)ret; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_ra...
2020 Apr 15
0
[PATCH AUTOSEL 5.5 088/106] iommu/virtio: Fix freeing of incomplete domains
...iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -613,18 +613,20 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, int ret; struct viommu_domain *vdomain = to_viommu_domain(domain); - vdomain->viommu = viommu; - vdomain->map_flags = viommu->map_flags; + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); + if (ret < 0) + return ret; + + vdomain->id = (unsigned int)ret; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_ra...
2020 Apr 15
0
[PATCH AUTOSEL 5.4 69/84] iommu/virtio: Fix freeing of incomplete domains
...iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -614,18 +614,20 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, int ret; struct viommu_domain *vdomain = to_viommu_domain(domain); - vdomain->viommu = viommu; - vdomain->map_flags = viommu->map_flags; + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); + if (ret < 0) + return ret; + + vdomain->id = (unsigned int)ret; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_ra...
2020 Apr 18
0
[PATCH AUTOSEL 5.6 48/73] iommu/virtio: Fix freeing of incomplete domains
...iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -613,18 +613,20 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, int ret; struct viommu_domain *vdomain = to_viommu_domain(domain); - vdomain->viommu = viommu; - vdomain->map_flags = viommu->map_flags; + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); + if (ret < 0) + return ret; + + vdomain->id = (unsigned int)ret; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_ra...
2020 Apr 18
0
[PATCH AUTOSEL 5.5 45/75] iommu/virtio: Fix freeing of incomplete domains
...iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -613,18 +613,20 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, int ret; struct viommu_domain *vdomain = to_viommu_domain(domain); - vdomain->viommu = viommu; - vdomain->map_flags = viommu->map_flags; + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); + if (ret < 0) + return ret; + + vdomain->id = (unsigned int)ret; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_ra...
2020 Apr 18
0
[PATCH AUTOSEL 5.4 42/78] iommu/virtio: Fix freeing of incomplete domains
...iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -614,18 +614,20 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, int ret; struct viommu_domain *vdomain = to_viommu_domain(domain); - vdomain->viommu = viommu; - vdomain->map_flags = viommu->map_flags; + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); + if (ret < 0) + return ret; + + vdomain->id = (unsigned int)ret; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_ra...
2019 Jul 22
3
[PATCH] iommu/virtio: Update to most recent specification
...; viommu->domain_bits) - 1; vdomain->viommu = viommu; + vdomain->map_flags = viommu->map_flags; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_max(&viommu->domain_ids, max_domain, GFP_KERNEL); + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); if (ret >= 0) vdomain->id = (unsigned int)ret; @@ -710,7 +716,7 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int pr...
2019 Jul 22
3
[PATCH] iommu/virtio: Update to most recent specification
...; viommu->domain_bits) - 1; vdomain->viommu = viommu; + vdomain->map_flags = viommu->map_flags; domain->pgsize_bitmap = viommu->pgsize_bitmap; domain->geometry = viommu->geometry; - ret = ida_alloc_max(&viommu->domain_ids, max_domain, GFP_KERNEL); + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); if (ret >= 0) vdomain->id = (unsigned int)ret; @@ -710,7 +716,7 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int pr...
2020 Apr 01
2
[RFC PATCH v2] iommu/virtio: Use page size bitmap supported by endpoint
...(domain->pgsize_bitmap != viommu->pgsize_bitmap) && > + (domain->pgsize_bitmap != vdev->pgsize_bitmap)) > + return -EINVAL; > + > + domain->pgsize_bitmap = vdev->pgsize_bitmap; > + > domain->geometry = viommu->geometry; > > ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, > @@ -657,7 +681,7 @@ static int viommu_attach_dev(struct iommu_domain *domain, struct device *dev) > * Properly initialize the domain now that we know which viommu > * owns it. > */ > - ret = viommu_domain_finalis...
2019 Jul 22
0
[PATCH] iommu/virtio: Update to most recent specification
...vdomain->viommu = viommu; > + vdomain->map_flags = viommu->map_flags; > > domain->pgsize_bitmap = viommu->pgsize_bitmap; > domain->geometry = viommu->geometry; > > - ret = ida_alloc_max(&viommu->domain_ids, max_domain, GFP_KERNEL); > + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, > + viommu->last_domain, GFP_KERNEL); > if (ret >= 0) > vdomain->id = (unsigned int)ret; > > @@ -710,7 +716,7 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, > phys_add...
2019 Jul 22
0
[PATCH] iommu/virtio: Update to most recent specification
...vdomain->viommu = viommu; > + vdomain->map_flags = viommu->map_flags; > > domain->pgsize_bitmap = viommu->pgsize_bitmap; > domain->geometry = viommu->geometry; > > - ret = ida_alloc_max(&viommu->domain_ids, max_domain, GFP_KERNEL); > + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, > + viommu->last_domain, GFP_KERNEL); > if (ret >= 0) > vdomain->id = (unsigned int)ret; > > @@ -710,7 +716,7 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, > phys_add...
2019 May 30
0
[PATCH v8 5/7] iommu: Add virtio-iommu driver
...struct iommu_domain *domain) +{ + int ret; + struct viommu_domain *vdomain = to_viommu_domain(domain); + + vdomain->viommu = viommu; + vdomain->map_flags = viommu->map_flags; + + domain->pgsize_bitmap = viommu->pgsize_bitmap; + domain->geometry = viommu->geometry; + + ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, + viommu->last_domain, GFP_KERNEL); + if (ret >= 0) + vdomain->id = (unsigned int)ret; + + return ret > 0 ? 0 : ret; +} + +static void viommu_domain_free(struct iommu_domain *domain) +{ + struct viommu_domain *vdomain = to_v...
2019 May 30
10
[PATCH v8 0/7] Add virtio-iommu driver
Implement the virtio-iommu driver, following specification v0.12 [1]. Since last version [2] we've worked on improving the specification, which resulted in the following changes to the interface: * Remove the EXEC flag. * Add feature bit for the MMIO flag. * Change domain_bits to domain_range. Given that there were small changes to patch 5/7, I removed the review and test tags. Please find