Messages in this thread |  | | Date | Tue, 16 Apr 2019 08:30:25 -0700 | From | Jacob Pan <> | Subject | Re: [PATCH 10/18] iommu/vt-d: Add custom allocator for IOASID |
| |
On Mon, 15 Apr 2019 14:37:11 -0600 Alex Williamson <alex.williamson@redhat.com> wrote:
> On Mon, 8 Apr 2019 16:59:25 -0700 > Jacob Pan <jacob.jun.pan@linux.intel.com> wrote: > > > When VT-d driver runs in the guest, PASID allocation must be > > performed via virtual command interface. This patch register a > > custom IOASID allocator which takes precedence over the default > > IDR based allocator. The resulting IOASID allocation will always > > come from the host. This ensures that PASID namespace is system- > > wide. > > > > Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> > > Signed-off-by: Liu, Yi L <yi.l.liu@intel.com> > > Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> > > --- > > drivers/iommu/intel-iommu.c | 50 > > +++++++++++++++++++++++++++++++++++++++++++++ > > include/linux/intel-iommu.h | 1 + 2 files changed, 51 insertions(+) > > > > diff --git a/drivers/iommu/intel-iommu.c > > b/drivers/iommu/intel-iommu.c index 28cb713..a38d774 100644 > > --- a/drivers/iommu/intel-iommu.c > > +++ b/drivers/iommu/intel-iommu.c > > @@ -4820,6 +4820,42 @@ static int __init > > platform_optin_force_iommu(void) return 1; > > } > > > > +static ioasid_t intel_ioasid_alloc(ioasid_t min, ioasid_t max, > > void *data) +{ > > + struct intel_iommu *iommu = data; > > + ioasid_t ioasid; > > + > > + if (vcmd_alloc_pasid(iommu, &ioasid)) > > + return INVALID_IOASID; > > + return ioasid; > > How does this honor min/max? > Sorry I missed this in my previous reply. VT-d virtual command interface always allocate PASIDs with full 20bit range. I think a range checking is missing here. Thanks for pointing this out.
> [...] >
|  |