[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v1 09/22] vfio/common: check PASID alloc/free availability
From: |
Liu, Yi L |
Subject: |
RE: [PATCH v1 09/22] vfio/common: check PASID alloc/free availability |
Date: |
Tue, 24 Mar 2020 11:18:58 +0000 |
> From: Peter Xu <address@hidden>
> Sent: Tuesday, March 24, 2020 6:07 AM
> To: Liu, Yi L <address@hidden>
> Subject: Re: [PATCH v1 09/22] vfio/common: check PASID alloc/free availability
>
> On Sun, Mar 22, 2020 at 05:36:06AM -0700, Liu Yi L wrote:
>
> [...]
>
> > @@ -1256,11 +1334,19 @@ static int vfio_init_container(VFIOContainer
> *container, int group_fd,
> > }
> >
> > if (iommu_type == VFIO_TYPE1_NESTING_IOMMU) {
> > - /*
> > - * TODO: config flags per host IOMMU nesting capability
> > - * e.g. check if VFIO_TYPE1_NESTING_IOMMU supports PASID
> > - * alloc/free
> > - */
> > + struct vfio_iommu_type1_info_cap_nesting nesting = {
> > + .nesting_capabilities = 0x0,
> > + .stage1_formats = 0, };
> > +
> > + ret = vfio_get_nesting_iommu_cap(container, &nesting);
> > + if (ret) {
> > + error_setg_errno(errp, -ret,
> > + "Failed to get nesting iommu cap");
> > + return ret;
> > + }
> > +
> > + flags |= (nesting.nesting_capabilities & VFIO_IOMMU_PASID_REQS) ?
> > + HOST_IOMMU_PASID_REQUEST : 0;
>
> I replied in the previous patch but I forgot to use reply-all...
>
> Anyway I'll comment again here - I think it'll be slightly better we
> use the previous patch to only offer the vfio specific hooks, and this
> patch to do all the rest including host_iommu_ctx_init() below, which
> will avoid creating the host_iommu_ctx_init().
Got it. Let me do it in next version.
Regards,
Yi Liu
- RE: [PATCH v1 07/22] intel_iommu: add set/unset_iommu_context callback, (continued)
[PATCH v1 11/22] intel_iommu: process PASID cache invalidation, Liu Yi L, 2020/03/22
[PATCH v1 02/22] header file update VFIO/IOMMU vSVA APIs, Liu Yi L, 2020/03/22
[PATCH v1 09/22] vfio/common: check PASID alloc/free availability, Liu Yi L, 2020/03/22
[PATCH v1 16/22] intel_iommu: replay pasid binds after context cache invalidation, Liu Yi L, 2020/03/22
[PATCH v1 10/22] intel_iommu: add virtual command capability support, Liu Yi L, 2020/03/22
[PATCH v1 15/22] intel_iommu: replay guest pasid bindings to host, Liu Yi L, 2020/03/22
[PATCH v1 12/22] intel_iommu: add PASID cache management infrastructure, Liu Yi L, 2020/03/22