Re: [PATCH v6 02/10] iommu/vt-d: Add custom allocator for IOASID

2019-10-24 Thread Lu Baolu
Hi, On 10/24/19 7:01 AM, Jacob Pan wrote: On Wed, 23 Oct 2019 10:21:51 +0800 Lu Baolu wrote: +#ifdef CONFIG_INTEL_IOMMU_SVM Maybe move them to intel-svm.c instead? that's where the bulk of the svm support is? I think this is a generic PASID allocator for guest IOMMU although vSVA is curre

Re: [PATCH v6 02/10] iommu/vt-d: Add custom allocator for IOASID

2019-10-23 Thread Jacob Pan
On Tue, 22 Oct 2019 21:04:00 -0700 Jacob Pan wrote: > > > + if (cap_caching_mode(iommu->cap) && > > > sm_supported(iommu)) { > > > > do you need to check against cap_caching_mode() or ecap_vcmd? > > > I guess ecap_vcmd() will suffice. Kind of redundant. Actually, we can check vcmd

Re: [PATCH v6 02/10] iommu/vt-d: Add custom allocator for IOASID

2019-10-23 Thread Jacob Pan
On Wed, 23 Oct 2019 10:21:51 +0800 Lu Baolu wrote: > >> +#ifdef CONFIG_INTEL_IOMMU_SVM > > > > Maybe move them to intel-svm.c instead? that's where the bulk > > of the svm support is? > > I think this is a generic PASID allocator for guest IOMMU although > vSVA is currently the only consume

Re: [PATCH v6 02/10] iommu/vt-d: Add custom allocator for IOASID

2019-10-22 Thread Jacob Pan
On Tue, 22 Oct 2019 17:51:29 -0700 "Raj, Ashok" wrote: > On Tue, Oct 22, 2019 at 04:53:15PM -0700, Jacob Pan wrote: > > When VT-d driver runs in the guest, PASID allocation must be > > performed via virtual command interface. This patch registers a > > custom IOASID allocator which takes preceden

Re: [PATCH v6 02/10] iommu/vt-d: Add custom allocator for IOASID

2019-10-22 Thread Lu Baolu
Hi, On 10/23/19 8:51 AM, Raj, Ashok wrote: On Tue, Oct 22, 2019 at 04:53:15PM -0700, Jacob Pan wrote: When VT-d driver runs in the guest, PASID allocation must be performed via virtual command interface. This patch registers a custom IOASID allocator which takes precedence over the default XArr

Re: [PATCH v6 02/10] iommu/vt-d: Add custom allocator for IOASID

2019-10-22 Thread Raj, Ashok
On Tue, Oct 22, 2019 at 04:53:15PM -0700, Jacob Pan wrote: > When VT-d driver runs in the guest, PASID allocation must be > performed via virtual command interface. This patch registers a > custom IOASID allocator which takes precedence over the default > XArray based allocator. The resulting IOASI

[PATCH v6 02/10] iommu/vt-d: Add custom allocator for IOASID

2019-10-22 Thread Jacob Pan
When VT-d driver runs in the guest, PASID allocation must be performed via virtual command interface. This patch registers a custom IOASID allocator which takes precedence over the default XArray based allocator. The resulting IOASID allocation will always come from the host. This ensures that PASI