RE: [PATCH v4 2/9] iommu: Replace sva_iommu with iommu_attach_handle

2024-04-28 Thread Tian, Kevin
> From: Baolu Lu > Sent: Sunday, April 28, 2024 6:22 PM > > On 2024/4/10 7:48, Jason Gunthorpe wrote: > > On Tue, Apr 09, 2024 at 10:11:28AM +0800, Baolu Lu wrote: > >> On 4/8/24 10:19 PM, Jason Gunthorpe wrote: > >>> On Sat, Apr 06, 2024 at 02:09:34PM +0800, Baolu Lu wrote: > On 4/3/24

RE: [PATCH v4 1/9] iommu: Introduce domain attachment handle

2024-04-09 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 10, 2024 7:38 AM > > On Tue, Apr 09, 2024 at 09:53:26AM +0800, Baolu Lu wrote: > > >The current code base doesn't yet support PASID attach/detach/replace > >uAPIs. Therefore, above code is safe and reasonable. However, we will > >need

RE: [PATCH v3 1/8] iommu: Add iopf domain attach/detach/replace interface

2024-02-20 Thread Tian, Kevin
> From: Baolu Lu > Sent: Wednesday, February 21, 2024 3:21 PM > > On 2024/2/21 14:49, Tian, Kevin wrote: > >>>> +struct iopf_attach_cookie { > >>>> +struct iommu_domain *domain; > >>>> +struct device *dev; > >&g

RE: [PATCH v3 1/8] iommu: Add iopf domain attach/detach/replace interface

2024-02-20 Thread Tian, Kevin
> From: Baolu Lu > Sent: Wednesday, February 21, 2024 1:53 PM > > On 2024/2/7 16:11, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Monday, January 22, 2024 3:39 PM > >> > >> There is a slight difference between iopf domains and non-iopf do

RE: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-02-07 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, January 22, 2024 3:39 PM > > + > +int iommufd_fault_iopf_handler(struct iopf_group *group) > +{ > + struct iommufd_hw_pagetable *hwpt = group->cookie->domain- > >fault_data; > + struct iommufd_fault *fault = hwpt->fault; > + why not directly using

RE: [PATCH v3 1/8] iommu: Add iopf domain attach/detach/replace interface

2024-02-07 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, January 22, 2024 3:39 PM > > There is a slight difference between iopf domains and non-iopf domains. > In the latter, references to domains occur between attach and detach; > While in the former, due to the existence of asynchronous iopf handling > paths,

RE: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-11-07 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, November 2, 2023 8:48 PM > > On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: > > Hi folks, > > > > This series implements the functionality of delivering IO page faults to > > user space through the IOMMUFD framework for nested translation. >

RE: [PATCH V1 vfio 0/9] Introduce a vfio driver over virtio devices

2023-10-25 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Monday, October 23, 2023 11:43 PM > > On Mon, Oct 23, 2023 at 09:33:23AM -0600, Alex Williamson wrote: > > > > Alex, > > > Are you fine to leave the provisioning of the VF including the control > > > of its transitional capability in the device hands as was

RE: [PATCH v2 08/10] iommu/intel: Use GFP_KERNEL in sleepable contexts

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > These contexts are sleepable, so use the proper annotation. The > GFP_ATOMIC > was added mechanically in the prior patches. > > Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian

RE: [PATCH v2 07/10] iommu/intel: Support the gfp argument to the map_pages op

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > Flow it down to alloc_pgtable_page() via pfn_to_dma_pte() and > __domain_mapping(). > > Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian ___ Virtualization mailing list

RE: [PATCH v2 06/10] iommu/intel: Add a gfp parameter to alloc_pgtable_page()

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > This is eventually called by iommufd through intel_iommu_map_pages() and > it should not be forced to atomic. Push the GFP_ATOMIC to all callers. > > Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian

RE: [PATCH v2 05/10] iommufd: Use GFP_KERNEL_ACCOUNT for iommu_map()

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > iommufd follows the same design as KVM and uses memory cgroups to limit > the amount of kernel memory a iommufd file descriptor can pin down. The > various internal data structures already use GFP_KERNEL_ACCOUNT. > >

RE: [PATCH v2 04/10] iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous()

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > Change the sg_alloc_table_from_pages() allocation that was hardwired to > GFP_KERNEL to use the gfp parameter like the other allocations in this > function. > > Auditing says this is never called from an atomic context, so

RE: [PATCH v2 03/10] iommu: Add a gfp parameter to iommu_map_sg()

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > Follow the pattern for iommu_map() and remove iommu_map_sg_atomic(). > > This allows __iommu_dma_alloc_noncontiguous() to use a GFP_KERNEL > allocation here, based on the provided gfp flags. > > Signed-off-by: Jason

RE: [PATCH v2 02/10] iommu: Remove iommu_map_atomic()

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > There is only one call site and it can now just pass the GFP_ATOMIC to the > normal iommu_map(). > > Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian ___ Virtualization

RE: [PATCH v2 01/10] iommu: Add a gfp parameter to iommu_map()

2023-01-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, January 19, 2023 2:01 AM > > The internal mechanisms support this, but instead of exposting the gfp to > the caller it wrappers it into iommu_map() and iommu_map_atomic() > > Fix this instead of adding more variants for GFP_KERNEL_ACCOUNT. > >

RE: [PATCH 6/8] iommu/intel: Add a gfp parameter to alloc_pgtable_page()

2023-01-17 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, January 17, 2023 9:30 PM > > On Tue, Jan 17, 2023 at 03:35:08AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Saturday, January 7, 2023 12:43 AM > > > > > > @@ -2676,7 +2676,7 @@ st

RE: [PATCH 7/8] iommu/intel: Support the gfp argument to the map_pages op

2023-01-16 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Saturday, January 7, 2023 12:43 AM > > @@ -2368,7 +2372,7 @@ static int iommu_domain_identity_map(struct > dmar_domain *domain, > > return __domain_mapping(domain, first_vpfn, > first_vpfn, last_vpfn - first_vpfn + 1, > -

RE: [PATCH 6/8] iommu/intel: Add a gfp parameter to alloc_pgtable_page()

2023-01-16 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Saturday, January 7, 2023 12:43 AM > > @@ -2676,7 +2676,7 @@ static int copy_context_table(struct intel_iommu > *iommu, > if (!old_ce) > goto out; > > - new_ce =

RE: [PATCH v4 5/6] iommu: Use EINVAL for incompatible device/domain in ->attach_dev

2022-09-22 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Wednesday, September 21, 2022 4:24 PM > > Following the new rules in include/linux/iommu.h kdocs, update all drivers > ->attach_dev callback functions to return EINVAL in the failure paths that > are related to domain incompatibility. > > Also, drop adjacent error

RE: [PATCH v4 3/6] iommu: Add return value rules to attach_dev op and APIs

2022-09-22 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Wednesday, September 21, 2022 4:23 PM > > > +/** > + * iommu_attach_device - Attach a device to an IOMMU domain > + * @domain: IOMMU domain to attach > + * @dev: Device that will be attached > + * > + * Returns 0 on success and error code on failure > + * > + * Note

RE: [PATCH v3 5/6] iommu: Use EINVAL for incompatible device/domain in ->attach_dev

2022-09-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 21, 2022 2:07 AM > > On Tue, Sep 20, 2022 at 06:38:18AM +, Tian, Kevin wrote: > > > Above lacks of a conversion in intel-iommu: > > > > intel_iommu_attach_device() > > if

RE: [PATCH v3 6/6] iommu: Propagate ret for a potential soft failure EINVAL

2022-09-20 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, September 15, 2022 3:59 PM > > Following the new rules in include/linux/iommu.h kdocs, EINVAL now can be > used to indicate that domain and device are incompatible by a caller that > treats it as a soft failure and tries attaching to another domain. > >

RE: [PATCH v3 5/6] iommu: Use EINVAL for incompatible device/domain in ->attach_dev

2022-09-20 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, September 15, 2022 3:54 PM > diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c > index 1f2cd43cf9bc..51ef42b1bd4e 100644 > --- a/drivers/iommu/intel/iommu.c > +++ b/drivers/iommu/intel/iommu.c > @@ -4158,19 +4158,15 @@ static int

RE: [PATCH v3 3/6] iommu: Add return value rules to attach_dev op and APIs

2022-09-20 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, September 15, 2022 3:54 PM > > +/** > + * iommu_attach_device - Attach a device to an IOMMU domain > + * @domain: IOMMU domain to attach > + * @dev: Device that will be attached > + * > + * Returns 0 on success and error code on failure > + * > + * Note

RE: [PATCH v6 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-09-12 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Sunday, September 11, 2022 7:36 AM > > On Thu, Sep 08, 2022 at 09:08:38AM -0300, Jason Gunthorpe wrote: > > On Thu, Sep 08, 2022 at 09:30:57AM +, Tian, Kevin wrote: > > > > There are also cases where common kAPIs are called in t

RE: [PATCH v6 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-09-12 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, September 9, 2022 8:08 PM > > > > As discussed in a side thread a note might be added to exempt calling > > kAPI outside of the iommu driver. > > Sadly, not really.. The driver is responsible to santize this if it is > relevant. It is the main downside

RE: [PATCH v6 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-09-08 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Friday, September 9, 2022 11:17 AM > > On Thu, Sep 08, 2022 at 01:14:42PM -0300, Jason Gunthorpe wrote: > > > > I am wondering if this can be solved by better defining what the return > > > codes mean and adjust the call-back functions to match the definition. > > >

RE: [PATCH v6 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-09-08 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Thursday, September 8, 2022 5:31 PM > > This mixture of error codes is the basic reason why a new code was > > used, because none of the existing codes are used with any > > consistency. > > btw I saw the policy for -EBUSY is also

RE: [PATCH v6 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-09-08 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, September 8, 2022 8:43 AM > > On Wed, Sep 07, 2022 at 08:41:13PM +0100, Robin Murphy wrote: > > > Again, not what I was suggesting. In fact the nature of > iommu_attach_group() > > already rules out bogus devices getting this far, so all a driver

RE: [PATCH v3 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-06-30 Thread Tian, Kevin
> From: Robin Murphy > Sent: Thursday, June 30, 2022 4:22 PM > > On 2022-06-29 20:47, Nicolin Chen wrote: > > On Fri, Jun 24, 2022 at 03:19:43PM -0300, Jason Gunthorpe wrote: > >> On Fri, Jun 24, 2022 at 06:35:49PM +0800, Yong Wu wrote: > >> > > It's not used in VFIO context. "return 0" just

RE: [PATCH v3 5/5] vfio/iommu_type1: Simplify group attachment

2022-06-27 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Friday, June 24, 2022 4:00 AM > > Un-inline the domain specific logic from the attach/detach_group ops into > two paired functions vfio_iommu_alloc_attach_domain() and > vfio_iommu_detach_destroy_domain() that strictly deal with creating and > destroying struct

RE: [PATCH v3 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-06-24 Thread Tian, Kevin
> From: Yong Wu > Sent: Friday, June 24, 2022 1:39 PM > > On Thu, 2022-06-23 at 19:44 -0700, Nicolin Chen wrote: > > On Fri, Jun 24, 2022 at 09:35:49AM +0800, Baolu Lu wrote: > > > External email: Use caution opening links or attachments > > > > > > > > > On 2022/6/24 04:00, Nicolin Chen wrote: >

RE: [PATCH v2 3/5] vfio/iommu_type1: Remove the domain->ops comparison

2022-06-22 Thread Tian, Kevin
> From: Robin Murphy > Sent: Wednesday, June 22, 2022 3:55 PM > > On 2022-06-16 23:23, Nicolin Chen wrote: > > On Thu, Jun 16, 2022 at 06:40:14AM +, Tian, Kevin wrote: > > > >>> The domain->ops validation was added, as a precaution, for mixed- > dri

RE: [PATCH v2 5/5] vfio/iommu_type1: Simplify group attachment

2022-06-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Friday, June 17, 2022 6:41 AM > > > ... > > > - if (resv_msi) { > > > + if (resv_msi && !domain->msi_cookie) { > > > ret = iommu_get_msi_cookie(domain->domain, > > > resv_msi_base); > > > if (ret && ret != -ENODEV) > > >

RE: [PATCH v2 5/5] vfio/iommu_type1: Simplify group attachment

2022-06-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, June 16, 2022 8:03 AM > > Un-inline the domain specific logic from the attach/detach_group ops into > two paired functions vfio_iommu_alloc_attach_domain() and > vfio_iommu_detach_destroy_domain() that strictly deal with creating and > destroying struct

RE: [PATCH v2 4/5] vfio/iommu_type1: Clean up update_dirty_scope in detach_group()

2022-06-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, June 16, 2022 8:03 AM > > All devices in emulated_iommu_groups have pinned_page_dirty_scope > set, so the update_dirty_scope in the first list_for_each_entry > is always false. Clean it up, and move the "if update_dirty_scope" > part from the

RE: [PATCH v2 3/5] vfio/iommu_type1: Remove the domain->ops comparison

2022-06-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, June 16, 2022 8:03 AM > > The domain->ops validation was added, as a precaution, for mixed-driver > systems. However, at this moment only one iommu driver is possible. So > remove it. It's true on a physical platform. But I'm not sure whether a virtual

RE: [PATCH v2 2/5] vfio/iommu_type1: Prefer to reuse domains vs match enforced cache coherency

2022-06-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, June 16, 2022 8:03 AM > > From: Jason Gunthorpe > > The KVM mechanism for controlling wbinvd is based on OR of the coherency > property of all devices attached to a guest, no matter those devices are > attached to a single domain or multiple domains. > >

RE: [PATCH v2 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-06-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, June 16, 2022 8:03 AM > > Cases like VFIO wish to attach a device to an existing domain that was > not allocated specifically from the device. This raises a condition > where the IOMMU driver can fail the domain attach because the domain and > device are

RE: [PATCH 3/5] vfio/iommu_type1: Prefer to reuse domains vs match enforced cache coherency

2022-06-15 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Wednesday, June 15, 2022 4:45 AM > > Hi Kevin, > > On Wed, Jun 08, 2022 at 11:48:27PM +, Tian, Kevin wrote: > > > > > The KVM mechanism for controlling wbinvd is only triggered during > > > > > kvm_vfio_grou

RE: [PATCH 3/5] vfio/iommu_type1: Prefer to reuse domains vs match enforced cache coherency

2022-06-08 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, June 8, 2022 7:17 PM > > On Wed, Jun 08, 2022 at 08:28:03AM +, Tian, Kevin wrote: > > > From: Nicolin Chen > > > Sent: Monday, June 6, 2022 2:19 PM > > > > > > From: Jason Gunthorpe > > &g

RE: [PATCH 4/5] vfio/iommu_type1: Clean up update_dirty_scope in detach_group()

2022-06-08 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Monday, June 6, 2022 2:19 PM > > All devices in emulated_iommu_groups have pinned_page_dirty_scope > set, so the update_dirty_scope in the first list_for_each_entry > is always false. Clean it up, and move the "if update_dirty_scope" > part from the detach_group_done

RE: [PATCH 3/5] vfio/iommu_type1: Prefer to reuse domains vs match enforced cache coherency

2022-06-08 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Monday, June 6, 2022 2:19 PM > > From: Jason Gunthorpe > > The KVM mechanism for controlling wbinvd is only triggered during > kvm_vfio_group_add(), meaning it is a one-shot test done once the devices > are setup. It's not one-shot. kvm_vfio_update_coherency() is

RE: [PATCH 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

2022-06-08 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Monday, June 6, 2022 2:19 PM > > Cases like VFIO wish to attach a device to an existing domain that was > not allocated specifically from the device. This raises a condition > where the IOMMU driver can fail the domain attach because the domain and > device are

RE: [PATCH 1/5] iommu: Replace uses of IOMMU_CAP_CACHE_COHERENCY with dev_is_dma_coherent()

2022-04-07 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, April 7, 2022 1:17 AM > > On Wed, Apr 06, 2022 at 06:10:31PM +0200, Christoph Hellwig wrote: > > On Wed, Apr 06, 2022 at 01:06:23PM -0300, Jason Gunthorpe wrote: > > > On Wed, Apr 06, 2022 at 05:50:56PM +0200, Christoph Hellwig wrote: > > > > On Wed, Apr

RE: [PATCH 3/5] iommu: Introduce the domain op enforce_cache_coherency()

2022-04-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 6, 2022 12:16 AM > > This new mechanism will replace using IOMMU_CAP_CACHE_COHERENCY > and > IOMMU_CACHE to control the no-snoop blocking behavior of the IOMMU. > > Currently only Intel and AMD IOMMUs are known to support this > feature. They

RE: [PATCH 2/5] vfio: Require that devices support DMA cache coherence

2022-04-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 6, 2022 3:29 AM > > On Tue, Apr 05, 2022 at 01:10:44PM -0600, Alex Williamson wrote: > > On Tue, 5 Apr 2022 13:16:01 -0300 > > Jason Gunthorpe wrote: > > > > > dev_is_dma_coherent() is the control to determine if IOMMU_CACHE can > be > > >

RE: [PATCH 0/5] Make the iommu driver no-snoop block feature consistent

2022-04-06 Thread Tian, Kevin
o implement > enforce_cache_coherency(), it is not clear there is any benefit in doing > so. > > After this series there are only two calls left to iommu_capable() with a > bus argument which should help Robin's work here. > > This is on github: > https://github.com/jgu

RE: [PATCH 3/5] iommu: Introduce the domain op enforce_cache_coherency()

2022-04-05 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Wednesday, April 6, 2022 7:32 AM > > > From: Jason Gunthorpe > > Sent: Wednesday, April 6, 2022 6:58 AM > > > > On Tue, Apr 05, 2022 at 01:50:36PM -0600, Alex Williamson wrote: > > > > > > > > +static bool in

RE: [PATCH 3/5] iommu: Introduce the domain op enforce_cache_coherency()

2022-04-05 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 6, 2022 6:58 AM > > On Tue, Apr 05, 2022 at 01:50:36PM -0600, Alex Williamson wrote: > > > > > > +static bool intel_iommu_enforce_cache_coherency(struct > iommu_domain *domain) > > > +{ > > > + struct dmar_domain *dmar_domain =

RE: [PATCH 0/5] iommu/virtio: Add identity domains

2021-10-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Wednesday, October 13, 2021 8:11 PM > > Support identity domains, allowing to only enable IOMMU protection for a > subset of endpoints (those assigned to userspace, for example). Users > may enable identity domains at compile time >

RE: [PATCH 0/5] iommu/virtio: Add identity domains

2021-10-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Monday, October 18, 2021 11:24 PM > > On Thu, Oct 14, 2021 at 03:00:38AM +, Tian, Kevin wrote: > > > From: Jean-Philippe Brucker > > > Sent: Wednesday, October 13, 2021 8:11 PM > > > > > > Support

RE: [PATCH 0/5] iommu/virtio: Add identity domains

2021-10-21 Thread Tian, Kevin
> From: j...@8bytes.org > Sent: Monday, October 18, 2021 7:38 PM > > On Thu, Oct 14, 2021 at 03:00:38AM +, Tian, Kevin wrote: > > I saw a concept of deferred attach in iommu core. See iommu_is_ > > attach_deferred(). Currently this is vendor specific and I haven't &

RE: [PATCH 2/5] iommu/virtio: Support bypass domains

2021-10-13 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Thursday, October 14, 2021 11:25 AM > > > From: Jean-Philippe Brucker > > Sent: Wednesday, October 13, 2021 8:11 PM > > > > The VIRTIO_IOMMU_F_BYPASS_CONFIG feature adds a new flag to the > > ATTACH > > request, that creat

RE: [PATCH 2/5] iommu/virtio: Support bypass domains

2021-10-13 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Wednesday, October 13, 2021 8:11 PM > > The VIRTIO_IOMMU_F_BYPASS_CONFIG feature adds a new flag to the > ATTACH > request, that creates a bypass domain. Use it to enable identity > domains. > > When VIRTIO_IOMMU_F_BYPASS_CONFIG is not supported by the

RE: [PATCH 0/5] iommu/virtio: Add identity domains

2021-10-13 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Wednesday, October 13, 2021 8:11 PM > > Support identity domains, allowing to only enable IOMMU protection for a > subset of endpoints (those assigned to userspace, for example). Users > may enable identity domains at compile time >

RE: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-25 Thread Tian, Kevin
> From: Auger Eric > Sent: Monday, March 15, 2021 3:52 PM > To: Christoph Hellwig > Cc: k...@vger.kernel.org; Will Deacon ; linuxppc- > d...@lists.ozlabs.org; dri-de...@lists.freedesktop.org; Li Yang > ; io...@lists.linux-foundation.org; > > Hi Christoph, > > On 3/14/21 4:58 PM, Christoph

RE: [PATCH RFC v1 12/15] iommu/virtio: Add support for INVALIDATE request

2021-03-03 Thread Tian, Kevin
> From: Jacob Pan > Sent: Thursday, March 4, 2021 2:29 AM > > Hi Vivek, > > On Fri, 15 Jan 2021 17:43:39 +0530, Vivek Gautam > wrote: > > > From: Jean-Philippe Brucker > > > > Add support for tlb invalidation ops that can send invalidation > > requests to back-end virtio-iommu when stage-1

RE: [RFC 3/3] vfio: Share the KVM instance with Vdmabuf

2021-01-19 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, January 20, 2021 8:51 AM > > On Wed, 20 Jan 2021 00:14:49 + > "Kasireddy, Vivek" wrote: > > > Hi Alex, > > > > > -Original Message- > > > From: Alex Williamson > > > Sent: Tuesday, January 19, 2021 7:40 AM > > > To: Kasireddy, Vivek > > >

RE: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-04-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Saturday, February 29, 2020 1:26 AM > > Platforms without device-tree do not currently have a method for > describing the vIOMMU topology. Provide a topology description embedded > into the virtio device. > > Use PCI FIXUP to probe the config space early,

RE: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-05 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Saturday, February 29, 2020 1:26 AM > > Platforms without device-tree do not currently have a method for > describing the vIOMMU topology. Provide a topology description embedded > into the virtio device. > > Use PCI FIXUP to probe the config space early,

RE: [PATCH 0/5] vDPA support

2020-01-21 Thread Tian, Kevin
> From: Jason Wang > Sent: Thursday, January 16, 2020 8:42 PM > > Hi all: > > Based on the comments and discussion for mdev based hardware virtio > offloading support[1]. A different approach to support vDPA device is > proposed in this series. Can you point to the actual link which triggered

RE: [PATCH 3/5] vDPA: introduce vDPA bus

2020-01-21 Thread Tian, Kevin
> From: Jason Wang > Sent: Friday, January 17, 2020 11:03 AM > > > On 2020/1/16 下午11:22, Jason Gunthorpe wrote: > > On Thu, Jan 16, 2020 at 08:42:29PM +0800, Jason Wang wrote: > >> vDPA device is a device that uses a datapath which complies with the > >> virtio specifications with vendor

RE: [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-25 Thread Tian, Kevin
> From: Jason Wang > Sent: Wednesday, September 25, 2019 8:45 PM > > > On 2019/9/25 下午5:09, Tian, Kevin wrote: > >> From: Jason Wang [mailto:jasow...@redhat.com] > >> Sent: Tuesday, September 24, 2019 9:54 PM > >> > >> This patch implements basi

RE: [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-25 Thread Tian, Kevin
> From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Tuesday, September 24, 2019 9:54 PM > > This patch implements basic support for mdev driver that supports > virtio transport for kernel virtio driver. > > Signed-off-by: Jason Wang > --- > include/linux/mdev.h| 2 + >

RE: [PATCH V2 5/8] mdev: introduce device specific ops

2019-09-25 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, September 25, 2019 7:07 AM > > On Tue, 24 Sep 2019 21:53:29 +0800 > Jason Wang wrote: > > > Currently, except for the create and remove, the rest of > > mdev_parent_ops is designed for vfio-mdev driver only and may not help > > for kernel mdev driver.

RE: [PATCH V2 2/8] mdev: class id support

2019-09-25 Thread Tian, Kevin
> From: Jason Wang > Sent: Tuesday, September 24, 2019 9:53 PM > > Mdev bus only supports vfio driver right now, so it doesn't implement > match method. But in the future, we may add drivers other than vfio, > the first driver could be virtio-mdev. This means we need to add > device class id

RE: [PATCH V2 0/8] mdev based hardware virtio offloading support

2019-09-25 Thread Tian, Kevin
> From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Tuesday, September 24, 2019 9:53 PM > > Hi all: > > There are hardware that can do virtio datapath offloading while having > its own control path. This path tries to implement a mdev based > unified API to support using kernel virtio driver

RE: [RFC PATCH 2/2] mdev: introduce device specific ops

2019-09-17 Thread Tian, Kevin
> From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Tuesday, September 17, 2019 6:17 PM > > On 2019/9/17 下午4:09, Tian, Kevin wrote: > >> From: Jason Wang > >> Sent: Thursday, September 12, 2019 5:40 PM > >> > >> Currently,

RE: [RFC PATCH 0/2] Mdev: support mutiple kinds of devices

2019-09-17 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, September 18, 2019 1:31 AM > > [cc +Parav] > > On Thu, 12 Sep 2019 17:40:10 +0800 > Jason Wang wrote: > > > Hi all: > > > > During the development of virtio-mdev[1]. I find that mdev needs to be > > extended to support devices other than vfio mdev

RE: [RFC PATCH 2/2] mdev: introduce device specific ops

2019-09-17 Thread Tian, Kevin
> From: Jason Wang > Sent: Thursday, September 12, 2019 5:40 PM > > Currently, except for the crate and remove. The rest fields of > mdev_parent_ops is just designed for vfio-mdev driver and may not help > for kernel mdev driver. So follow the device id support by previous > patch, this patch

RE: [RFC PATCH 1/2] mdev: device id support

2019-09-17 Thread Tian, Kevin
> From: Jason Wang > Sent: Thursday, September 12, 2019 5:40 PM > > Mdev bus only support vfio driver right now, so it doesn't implement > match method. But in the future, we may add drivers other than vfio, > one example is virtio-mdev[1] driver. This means we need to add device > id support in

RE: [virtio-dev] Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-10 Thread Tian, Kevin
> From: Liang, Cunming > Sent: Tuesday, April 10, 2018 10:24 PM > [...] > > > > As others said, we do not need to go overeboard. A couple of small > vendor- > > specific quirks in qemu isn't a big deal. > > It's quite challenge to identify it's small or not, there's no uniform metric. > > It's

RE: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-23 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Thursday, March 22, 2018 6:06 PM > > > From: Robin Murphy [mailto:robin.mur...@arm.com] > > Sent: Wednesday, March 21, 2018 10:24 PM > > > > On 21/03/18 13:14, Jean-Philippe Brucker wrote: > >

RE: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-22 Thread Tian, Kevin
> From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Wednesday, March 21, 2018 10:24 PM > > On 21/03/18 13:14, Jean-Philippe Brucker wrote: > > On 21/03/18 06:43, Tian, Kevin wrote: > > [...] > >>> + > >>> +#include > >>>

RE: [virtio-dev] [RFC] virtio-iommu version 0.6

2018-03-22 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, March 21, 2018 9:14 PM > > Hi Kevin, > > Thanks for the comments > > On 19/03/18 10:03, Tian, Kevin wrote: > > BYPASS feature bit is not covered in "2.3.1/2.3.2/2.3.

RE: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, February 14, 2018 10:54 PM > > The virtio IOMMU is a para-virtualized device, allowing to send IOMMU > requests such as map/unmap over virtio-mmio transport without > emulating > page tables. This

RE: [virtio-dev] [RFC] virtio-iommu version 0.6

2018-03-19 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Wednesday, February 7, 2018 2:11 AM > > Please find version 0.6 of the virtio-iommu specification at the following > locations. > > Document: http://jpbrucker.net/virtio-iommu/spec/virtio-iommu.pdf >

RE: [virtio-dev] [RFC] virtio-iommu version 0.4

2017-09-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, September 6, 2017 7:49 PM > > > > 2.6.8.2.1 > > Multiple overlapping RESV_MEM properties are merged together. Device > > requirement? if same types I assume? > > Combination rules apply to device and driver.

RE: [RFC] virtio-iommu version 0.4

2017-09-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Wednesday, September 6, 2017 7:55 PM > > Hi Kevin, > > On 28/08/17 08:39, Tian, Kevin wrote: > > Here comes some comments: > > > > 1.1 Motivation > > > > You describe I/O page faults handling as future work. S

RE: [RFC] virtio-iommu version 0.4

2017-08-28 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, August 23, 2017 6:01 PM > > On 04/08/17 19:19, Jean-Philippe Brucker wrote: > > Other extensions are in preparation. I won't detail them here because > v0.4 > > already is a lot to digest, but in short,

RE: [RFC 2/3] virtio-iommu: device probing and operations

2017-08-22 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Monday, August 21, 2017 8:00 PM > > On 21/08/17 08:59, Tian, Kevin wrote: > >> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > >> Sent: Monday, April 24, 2017 11:06

RE: [RFC 2/3] virtio-iommu: device probing and operations

2017-08-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Monday, April 24, 2017 11:06 PM > 1. Attach device > > > struct virtio_iommu_req_attach { > le32address_space; > le32device; > le32flags/reserved; >

RE: [RFC] virtio-iommu version 0.4

2017-08-14 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Saturday, August 5, 2017 2:19 AM > > This is the continuation of my proposal for virtio-iommu, the para- > virtualized IOMMU. Here is a summary of the changes since last time [1]: > > * The virtio-iommu document now

RE: [RFC 2/3] virtio-iommu: device probing and operations

2017-04-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, April 19, 2017 2:46 AM > > On 18/04/17 11:26, Tian, Kevin wrote: > >> From: Jean-Philippe Brucker > >> Sent: Saturday, April 8, 2017 3:18 AM > >

RE: [RFC 1/3] virtio-iommu: firmware description of the virtual topology

2017-04-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, April 19, 2017 2:41 AM > > On 18/04/17 10:51, Tian, Kevin wrote: > >> From: Jean-Philippe Brucker > >> Sent: Saturday, April 8, 2017 3:18 AM > >> > >> Unlike oth

RE: [RFC 3/3] virtio-iommu: future work

2017-04-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Saturday, April 8, 2017 3:18 AM > > Here I propose a few ideas for extensions and optimizations. This is all > very exploratory, feel free to correct mistakes and suggest more things. [...] > > II. Page table sharing > == > > 1.

RE: [RFC 2/3] virtio-iommu: device probing and operations

2017-04-18 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Saturday, April 8, 2017 3:18 AM > [...] > II. Feature bits > > > VIRTIO_IOMMU_F_INPUT_RANGE (0) > Available range of virtual addresses is described in input_range Usually only the maximum supported address bits are important. Curious

RE: [RFC 1/3] virtio-iommu: firmware description of the virtual topology

2017-04-18 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Saturday, April 8, 2017 3:18 AM > > Unlike other virtio devices, the virtio-iommu doesn't work independently, > it is linked to other virtual or assigned devices. So before jumping into > device operations, we need to define a way for the guest to discover

RE: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-13 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Saturday, April 8, 2017 3:18 AM > > This is the initial proposal for a paravirtualized IOMMU device using > virtio transport. It contains a description of the device, a Linux driver, > and a toy implementation in kvmtool. With this prototype, you can >

RE: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-13 Thread Tian, Kevin
> From: Jason Wang > Sent: Wednesday, April 12, 2017 5:07 PM > > On 2017年04月08日 03:17, Jean-Philippe Brucker wrote: > > This is the initial proposal for a paravirtualized IOMMU device using > > virtio transport. It contains a description of the device, a Linux driver, > > and a toy implementation