Re: Plan for /dev/ioasid RFC v2

2021-06-16 Thread Liu Yi L
Hi Alex, On Wed, 16 Jun 2021 13:39:37 -0600, Alex Williamson wrote: > On Wed, 16 Jun 2021 06:43:23 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson > > > Sent: Wednesday, June 16, 2021 12:12 AM > > > > > > On Tue, 15 Jun 2021 02:31:39 + > > > "Tian, Kevin" wrote: > > > >

RE: [RFC] /dev/ioasid uAPI proposal

2021-06-07 Thread Liu, Yi L
> From: Shenming Lu > Sent: Friday, June 4, 2021 10:03 AM > > On 2021/6/4 2:19, Jacob Pan wrote: > > Hi Shenming, > > > > On Wed, 2 Jun 2021 12:50:26 +0800, Shenming Lu > > > wrote: > > > >> On 2021/6/2 1:33, Jason Gunthorpe wrote: > >>> On Tue, Jun 01, 2021 at 08:30:35PM +0800, Lu Baolu wrote:

Re: [RFC] /dev/ioasid uAPI proposal

2021-05-31 Thread Liu Yi L
On Tue, 1 Jun 2021 10:36:36 +0800, Jason Wang wrote: > 在 2021/5/31 下午4:41, Liu Yi L 写道: > >> I guess VFIO_ATTACH_IOASID will fail if the underlayer doesn't support > >> hardware nesting. Or is there way to detect the capability before? > > I think it could fail i

Re: [RFC] /dev/ioasid uAPI proposal

2021-05-31 Thread Liu Yi L
On Fri, 28 May 2021 20:36:49 -0300, Jason Gunthorpe wrote: > On Thu, May 27, 2021 at 07:58:12AM +, Tian, Kevin wrote: > > > 2.1. /dev/ioasid uAPI > > + > > > > /* > > * Check whether an uAPI extension is supported. > > * > > * This is for FD-level capabilities, such

Re: [RFC] /dev/ioasid uAPI proposal

2021-05-31 Thread Liu Yi L
On Fri, 28 May 2021 10:24:56 +0800, Jason Wang wrote: > 在 2021/5/27 下午3:58, Tian, Kevin 写道: > > /dev/ioasid provides an unified interface for managing I/O page tables for > > devices assigned to userspace. Device passthrough frameworks (VFIO, vDPA, > > etc.) are expected to use this interface

Re: [PATCH 3/6] vfio: remove the unused mdev iommu hook

2021-05-14 Thread Liu Yi L
Morning Jason, On Fri, 14 May 2021 10:39:39 -0300, Jason Gunthorpe wrote: > On Fri, May 14, 2021 at 01:17:23PM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Thursday, May 13, 2021 8:01 PM > > > > > > On Thu, May 13, 2021 at 03:28:52AM +, Tian, Kevin wrote: > > > > >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-05-11 Thread Liu Yi L
On Tue, 11 May 2021 09:10:03 +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Monday, May 10, 2021 8:37 PM > > > [...] > > > gPASID!=hPASID has a problem when assigning a physical device which > > > supports both shared work queue (ENQCMD with PASID in MSR) > > > and dedicated

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-05-08 Thread Liu Yi L
Hi Jason, On Wed, 5 May 2021 19:21:20 -0300, Jason Gunthorpe wrote: > On Wed, May 05, 2021 at 01:04:46PM -0700, Jacob Pan wrote: > > Hi Jason, > > > > On Wed, 5 May 2021 15:00:23 -0300, Jason Gunthorpe wrote: > > > > > On Wed, May 05, 2021 at 10:22:59AM -0700, Jacob Pan wrote: > > > > >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-22 Thread Liu Yi L
On Wed, 21 Apr 2021 13:33:12 -0600, Alex Williamson wrote: > On Wed, 21 Apr 2021 14:52:03 -0300 > Jason Gunthorpe wrote: > > > On Wed, Apr 21, 2021 at 10:54:51AM -0600, Alex Williamson wrote: > > > > > That's essentially replacing vfio-core, where I think we're more > > > > I am only

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-21 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, April 16, 2021 11:46 PM [...] > > This is not a tactic or excuse for not working on the new /dev/ioasid > > interface. In fact, I believe we can benefit from the lessons learned > > while completing the existing. This will give confidence to the

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-02 Thread Liu, Yi L
Hi Jason, > From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 7:54 PM > > On Thu, Apr 01, 2021 at 07:04:01AM +0000, Liu, Yi L wrote: > > > After reading your reply in https://lore.kernel.org/linux- > iommu/20210331123801.gd1463...@nvidia.com/#t > > So you

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 9:43 PM > > On Thu, Apr 01, 2021 at 01:38:46PM +0000, Liu, Yi L wrote: > > > From: Jean-Philippe Brucker > > > Sent: Thursday, April 1, 2021 8:05 PM > > [...] > > > > > > Also

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 9:16 PM > > On Thu, Apr 01, 2021 at 01:10:48PM +0000, Liu, Yi L wrote: > > > From: Jason Gunthorpe > > > Sent: Thursday, April 1, 2021 7:47 PM > > [...] > > > I'm worried Intel views the only

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jean-Philippe Brucker > Sent: Thursday, April 1, 2021 8:05 PM [...] > > Also wondering about: > > * Querying IOMMU nesting capabilities before binding page tables (which > page table formats are supported?). We were planning to have a VFIO cap, > but I'm guessing we need to go back

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 7:47 PM [...] > I'm worried Intel views the only use of PASID in a guest is with > ENQCMD, but that is not consistent with the industry. We need to see > normal nested PASID support with assigned PCI VFs. I'm not quire flow here. Intel also

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
Hi Jason, > From: Liu, Yi L > Sent: Thursday, April 1, 2021 12:39 PM > > > From: Jason Gunthorpe > > Sent: Wednesday, March 31, 2021 8:41 PM > > > > On Wed, Mar 31, 2021 at 07:38:36AM +, Liu, Yi L wrote: > > > > > The reason is /de

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, March 31, 2021 8:41 PM > > On Wed, Mar 31, 2021 at 07:38:36AM +0000, Liu, Yi L wrote: > > > The reason is /dev/ioasid FD is per-VM since the ioasid allocated to > > the VM should be able to be shared by all assigned device

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:43 PM [..] > No, the mdev device driver must enforce this directly. It is the one > that programms the physical shared HW, it is the one that needs a list > of PASID's it is allowed to program *for each mdev* > > ioasid_set doesn't seem

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:28 PM > > On Tue, Mar 30, 2021 at 04:14:58AM +, Tian, Kevin wrote: > > > One correction. The mdev should still construct the list of allowed PASID's > as > > you said (by listening to IOASID_BIND/UNBIND event), in addition to the >

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
Hi Jason, > From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:29 PM > > On Tue, Mar 30, 2021 at 01:37:05AM +, Tian, Kevin wrote: [...] > > Hi, Jason, > > > > Actually above is a major open while we are refactoring vSVA uAPI toward > > this direction. We have two concerns about merging

RE: [Patch v8 04/10] vfio/type1: Support binding guest page tables to PASID

2021-03-03 Thread Liu, Yi L
ar 02, 2021 at 09:13:19AM -0800, Jacob Pan wrote: > > > > Hi Jason, > > > > > > > > On Tue, 2 Mar 2021 08:56:28 -0400, Jason Gunthorpe > > > > wrote: > > > > > On Wed, Mar 03, 2021 at 04:35:39AM +0800, Liu Yi L wrote: > > > >

RE: [Patch v8 03/10] vfio/type1: Report iommu nesting info to userspace

2021-03-03 Thread Liu, Yi L
Hi Jason, > From: Jason Gunthorpe > Sent: Tuesday, March 2, 2021 8:52 PM > > On Wed, Mar 03, 2021 at 04:35:38AM +0800, Liu Yi L wrote: > > diff --git a/drivers/vfio/vfio_iommu_type1.c > b/drivers/vfio/vfio_iommu_type1.c > > index 4bb162c1d649..3a5c84d4f19b 10

RE: [PATCH v7 02/16] iommu/smmu: Report empty domain nesting info

2021-03-03 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Friday, February 12, 2021 5:58 PM > > Hi Vivek, Yi, > > On 2/12/21 8:14 AM, Vivek Gautam wrote: > > Hi Yi, > > > > > > On Sat, Jan 23, 2021 at 2:29 PM Liu, Yi L wrote: > >> > >> Hi Eric, > >

RE: [PATCH V4 00/18] IOASID extensions for guest SVA

2021-03-02 Thread Liu, Yi L
> From: Jacob Pan > Sent: Sunday, February 28, 2021 6:01 AM > > I/O Address Space ID (IOASID) core code was introduced in v5.5 as a generic > kernel allocator service for both PCIe Process Address Space ID (PASID) and > ARM SMMU's Substream ID. IOASIDs are used to associate DMA requests > with >

[Patch v8 10/10] iommu/vt-d: Support reporting nesting capability info

2021-03-02 Thread Liu Yi L
This patch reports nesting info when iommu_domain_get_attr() is called with DOMAIN_ATTR_NESTING and one domain with nesting set. Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off

[Patch v8 09/10] vfio: Document dual stage control

2021-03-02 Thread Liu Yi L
: Lu Baolu Signed-off-by: Eric Auger Signed-off-by: Liu Yi L Reviewed-by: Stefan Hajnoczi --- v7 -> v8: *) remove SYSWIDE_PASID description, point to /dev/ioasid when mentioning PASID allocation from host. v6 -> v7: *) tweak per Eric's comments. v5 -> v6: *) tweak per Eric's comm

[Patch v8 08/10] vfio/pci: Expose PCIe PASID capability to userspace

2021-03-02 Thread Liu Yi L
: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Reviewed-by: Eric Auger --- v7 -> v8: *) refine the commit message and the subject. v5 -> v6: *) add review-by from Eric Auger. v1 -> v2: *) added in v2, but it was sent in a separate patchseries before ---

[Patch v8 07/10] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2021-03-02 Thread Liu Yi L
. The main requirement is to use the auxiliary domain associated with mdev. Cc: Kevin Tian CC: Jacob Pan CC: Jun Tian Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Reviewed-by: Eric Auger --- v5 -> v6: *) add review-by f

[Patch v8 06/10] iommu: Pass domain to sva_unbind_gpasid()

2021-03-02 Thread Liu Yi L
@domain per the above reason. Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Yi Sun Signed-off-by: Liu Yi L --- v7 -> v8: *) tweaked the commit message. v6 -> v7: *) correct the link for the d

[Patch v8 05/10] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2021-03-02 Thread Liu Yi L
Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Eric Auger Signed-off-by: Jacob Pan --- v1 -> v2: *) rename from "vfio/type1: Flush stage-1 IOMMU cache for nesting type" *) rename vfio_cache_inv_fn() to vfio_dev_cache_

[Patch v8 04/10] vfio/type1: Support binding guest page tables to PASID

2021-03-02 Thread Liu Yi L
: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan --- v7 -> v8: *) adapt to /dev/ioasid *) address comments from Alex on v7. *) adapt to latest iommu_sva_unbind_gpasid() implementation. *) remove the

[Patch v8 03/10] vfio/type1: Report iommu nesting info to userspace

2021-03-02 Thread Liu Yi L
Signed-off-by: Liu Yi L --- v7 -> v8: *) tweak per Alex's comments against v7. *) check "iommu->nesting_info->format == 0" in attach_group() v6 -> v7: *) using vfio_info_add_capability() for adding nesting cap per suggestion from Eric. v5 -> v6: *) address comments a

[Patch v8 02/10] iommu/smmu: Report empty domain nesting info

2021-03-02 Thread Liu Yi L
Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan Reviewed-by: Eric Auger --- v5 -> v6: *) add review-by from Eric Auger. v4 -> v5: *) address comments from Eric Auger. --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 29 +++-- drivers/iommu/arm/arm-smmu/arm-smmu.c

[Patch v8 01/10] iommu: Report domain nesting info

2021-03-02 Thread Liu Yi L
-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan --- v7 -> v8: *) add padding in struct iommu_nesting_info_vtd *) describe future extension rules for struct iommu_nesting_info in iommu.rst. *) remove SYSWIDE_PASID v6 -> v7: *) rephrase the

[Patch v8 00/10] vfio: expose virtual Shared Virtual Addressing to VMs

2021-03-02 Thread Liu Yi L
..@intel.com/ - RFC v1 -> v2: Dropped vfio: VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE. RFC v1: https://lore.kernel.org/kvm/1562324772-3084-1-git-send-email-yi.l@intel.com/ --- Eric Auger (1): vfio: Document dual stage control Liu Yi L (8): iommu: Report domain nestin

RE: [PATCH v7 02/16] iommu/smmu: Report empty domain nesting info

2021-01-23 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Tuesday, January 19, 2021 6:03 PM > > Hi Yi, Vivek, > [...] > > I see. I think there needs a change in the code there. Should also expect > > a nesting_info returned instead of an int anymore. @Eric, how about your > > opinion? > > > > domain =

RE: [PATCH v7 02/16] iommu/smmu: Report empty domain nesting info

2021-01-12 Thread Liu, Yi L
Hi Vivek, > From: Vivek Gautam > Sent: Tuesday, January 12, 2021 7:06 PM > > Hi Yi, > > > On Tue, Jan 12, 2021 at 2:51 PM Liu, Yi L wrote: > > > > Hi Vivek, > > > > > From: Vivek Gautam > > > Sent: Tuesday, January 12, 2021 2:50 PM

RE: [PATCH v7 02/16] iommu/smmu: Report empty domain nesting info

2021-01-12 Thread Liu, Yi L
Hi Vivek, > From: Vivek Gautam > Sent: Tuesday, January 12, 2021 2:50 PM > > Hi Yi, > > > On Thu, Sep 10, 2020 at 4:13 PM Liu Yi L wrote: > > > > This patch is added as instead of returning a boolean for > DOMAIN_ATTR_NESTING, > > iommu_domain_get_

[PATCH v4 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2021-01-06 Thread Liu Yi L
-> has_iotlb_device needs to be updated when attaching to subdevices. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Signed-off-by: Liu Yi L Acked-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 53 +++-- 1 fil

[PATCH v4 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2021-01-06 Thread Liu Yi L
ses. For example, flushing device_iotlb for a domain which has sub-devices attached by auxiliary manner. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Co-developed-by: Xin Zeng Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L Acked-by: Lu Baolu --- driver

[PATCH v4 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2021-01-06 Thread Liu Yi L
/vt-d: Shared virtual address in scalable mode") Cc: Lu Baolu Cc: Jacob Pan Cc: Raj Ashok Cc: David Woodhouse Reported-by: Guo Kaijie Reported-by: Xin Zeng Signed-off-by: Guo Kaijie Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L Tested-by: Guo Kaijie Cc: sta...@vger.kernel.org # v

[PATCH v4 0/3] iommu/vt-d: Misc fixes on scalable mode

2021-01-06 Thread Liu Yi L
ename "iommu/vt-d: A fix to iommu_flush_dev_iotlb() for aux-domain" to be "iommu/vt-d: Fix ineffective devTLB invalidation for subdevices" - Refined the commit messages v1: https://lore.kernel.org/linux-iommu/2020122352.183523-1-yi.l@intel.com/ Regards, Yi Liu Li

RE: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2021-01-06 Thread Liu, Yi L
Hi Will, > From: Will Deacon > Sent: Wednesday, January 6, 2021 1:24 AM > > On Tue, Jan 05, 2021 at 05:50:22AM +0000, Liu, Yi L wrote: > > > > +static void __iommu_flush_dev_iotlb(struct device_domain_info > *info, > > > > +

RE: [PATCH v3 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2021-01-04 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu > Sent: Tuesday, December 29, 2020 4:38 PM > > Hi Yi, > > On 2020/12/29 11:25, Liu Yi L wrote: > > In the existing code, loop all devices attached to a domain does not > > include sub-devices attached via iommu_aux_attach_device(). >

RE: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2021-01-04 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu > Sent: Tuesday, December 29, 2020 4:42 PM > > Hi Yi, > > On 2020/12/29 11:25, Liu Yi L wrote: > > iommu_flush_dev_iotlb() is called to invalidate caches on device. It only > > loops the devices which are full-attached

[PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-28 Thread Liu Yi L
-> has_iotlb_device needs to be updated when attaching to subdevices. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 53 ++--- 1 file changed, 37 insertions(+), 16 delet

[PATCH v3 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2020-12-28 Thread Liu Yi L
ses. For example, flushing device_iotlb for a domain which has sub-devices attached by auxiliary manner. Co-developed-by: Xin Zeng Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 95 +++-- include/linux/intel-iommu.h | 16 +--

[PATCH v3 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-28 Thread Liu Yi L
/vt-d: Shared virtual address in scalable mode") Cc: Lu Baolu Cc: Jacob Pan Cc: Raj Ashok Cc: David Woodhouse Reported-by: Guo Kaijie Reported-by: Xin Zeng Signed-off-by: Guo Kaijie Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L --- drivers/iommu/intel/svm.c | 9 + include/l

[PATCH v3 0/3] iommu/vt-d: Misc fixes on scalable mode

2020-12-28 Thread Liu Yi L
quot; - Rename "iommu/vt-d: A fix to iommu_flush_dev_iotlb() for aux-domain" to be "iommu/vt-d: Fix ineffective devTLB invalidation for subdevices" - Refined the commit messages v1: https://lore.kernel.org/linux-iommu/2020122352.183523-1-yi.l@intel.com/ Liu Yi L (3):

RE: [PATCH v2 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-25 Thread Liu, Yi L
Hi Baolu, Well received, all comments accepted. thanks. Regards, Yi Liu > From: Lu Baolu > Sent: Wednesday, December 23, 2020 6:10 PM > > Hi Yi, > > On 2020/12/23 14:27, Liu Yi L wrote: > > iommu_flush_dev_iotlb() is called to invalidate caches on device. It only >

[PATCH v2 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-22 Thread Liu Yi L
-> has_iotlb_device needs to be updated when attaching to subdevices. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 63 +++-- 1 file changed, 47 insertions(+), 16 delet

[PATCH v2 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2020-12-22 Thread Liu Yi L
ses. For example, flushing device_iotlb for a domain which has sub-devices attached by auxiliary manner. Co-developed-by: Xin Zeng Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 95 +++-- include/linux/intel-iommu.h | 16 +--

[PATCH v2 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-22 Thread Liu Yi L
/vt-d: Shared virtual address in scalable mode") Cc: Lu Baolu Cc: Jacob Pan Cc: Raj Ashok Cc: David Woodhouse Reported-by: Guo Kaijie Reported-by: Xin Zeng Signed-off-by: Guo Kaijie Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L Tested-by: Guo Kaijie --- drivers/iommu/intel/s

[PATCH v2 0/3] iommu/vt-d: Misc fixes on scalable mode

2020-12-22 Thread Liu Yi L
This patchset aims to fix a bug regards to native SVM usage, and also several bugs around subdevice (attached to device via auxiliary manner) tracking and ineffective device_tlb flush. Liu Yi L (3): iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev iommu/vt-d

RE: [PATCH 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info.

2020-12-22 Thread Liu, Yi L
Hi Jacob, > From: Jacob Pan > Sent: Wednesday, December 23, 2020 4:21 AM > > Hi Yi, > > On Sun, 20 Dec 2020 08:03:51 +0800, Liu Yi L wrote: > > > In existing code, if wanting to loop all devices attached to a domain, > > current code can only loop the devices

RE: [PATCH 0/4] iommu/vtd-: Misc fixes on scalable mode

2020-12-22 Thread Liu, Yi L
> From: Jacob Pan > Sent: Wednesday, December 23, 2020 2:17 AM > > Hi Yi, > > nit: The cover letter is 0/4, patches are 1/3 - 3/3. You also need to copy > LKML. > > On Sun, 20 Dec 2020 08:03:49 +0800, Liu Yi L wrote: > > > Hi, > > > > This

[PATCH 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-18 Thread Liu Yi L
/vt-d: Add basic SVM PASID support") Cc: Lu Baolu Cc: Jacob Pan Cc: Raj Ashok Cc: David Woodhouse Reported-by: Guo Kaijie Reported-by: Xin Zeng Signed-off-by: Guo Kaijie Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L --- drivers/iommu/intel/svm.c | 9 + include/linux/intel-i

[PATCH 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info.

2020-12-18 Thread Liu Yi L
Co-developed-by: Liu Yi L Signed-off-by: Liu Yi L Co-developed-by: Lu Baolu Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 92 - include/linux/intel-iommu.h | 11 - 2 files changed, 90 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/in

[PATCH 0/4] iommu/vtd-: Misc fixes on scalable mode

2020-12-18 Thread Liu Yi L
Hi, This patchset aims to fix a bug regards to SVM usage on native, and also several bugs around subdevice (attached to device via auxiliary manner) tracking and ineffective device_tlb flush. Regards, Yi Liu Liu Yi L (3): iommu/vt-d: Move intel_iommu info from struct intel_svm to struct

[PATCH 3/3] iommu/vt-d: A fix to iommu_flush_dev_iotlb() for aux-domain

2020-12-18 Thread Liu Yi L
->has_iotlb_device for both device/subdevice attach/detach and ATS enabling/disabling. Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 90 + 1 file changed, 72 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/in

RE: [PATCH v2 1/1] vfio/type1: Add vfio_group_domain()

2020-11-25 Thread Liu, Yi L
On Thurs, Nov 26, 2020, at 9:27 AM, Lu Baolu wrote: > Add the API for getting the domain from a vfio group. This could be used > by the physical device drivers which rely on the vfio/mdev framework for > mediated device user level access. The typical use case like below: > > unsigned int

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-21 Thread Liu, Yi L
Hi Jason, > From: Jason Wang > Sent: Thursday, October 22, 2020 10:56 AM > [...] > If you(Intel) don't have plan to do vDPA, you should not prevent other vendors > from implementing PASID capable hardware through non-VFIO subsystem/uAPI > on top of your SIOV architecture. Isn't it? yes, that's

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-20 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, October 20, 2020 10:02 PM [...] > > > Whoever provides the vIOMMU emulation and relays the page fault to the > guest > > > has to translate the RID - > > > > that's the point. But the device info (especially the sub-device info) is > > within the passthru

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-20 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, October 20, 2020 10:05 PM > To: Liu, Yi L > > On Tue, Oct 20, 2020 at 02:00:31PM +, Liu, Yi L wrote: > > > From: Jason Gunthorpe > > > Sent: Tuesday, October 20, 2020 9:55 PM > > > > > > On Tue

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-20 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, October 20, 2020 9:55 PM > > On Tue, Oct 20, 2020 at 09:40:14AM +0000, Liu, Yi L wrote: > > > > See previous discussion with Kevin. If I understand correctly, you expect > > > a > shared > > > L2 table if

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-20 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Monday, October 19, 2020 10:25 PM > > On Mon, Oct 19, 2020 at 08:39:03AM +0000, Liu, Yi L wrote: > > Hi Jason, > > > > Good to see your response. > > Ah, I was away got it. :-) > > > > > Sec

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-20 Thread Liu, Yi L
> From: Jason Wang > Sent: Tuesday, October 20, 2020 5:20 PM > > Hi Yi: > > On 2020/10/20 ??4:19, Liu, Yi L wrote: > >> Yes, but since PASID is a global identifier now, I think kernel > >> should track the a device list per PASID? > > We have such track

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-20 Thread Liu, Yi L
Hey Jason, > From: Jason Wang > Sent: Tuesday, October 20, 2020 2:18 PM > > On 2020/10/15 ??6:14, Liu, Yi L wrote: > >> From: Jason Wang > >> Sent: Thursday, October 15, 2020 4:41 PM > >> > >> > >> On 2020/10/15 ??3:58, Tian, Kevin wrote

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-19 Thread Liu, Yi L
Hi Jason, Good to see your response. > From: Jason Gunthorpe > Sent: Friday, October 16, 2020 11:37 PM > > On Wed, Oct 14, 2020 at 03:16:22AM +, Tian, Kevin wrote: > > Hi, Alex and Jason (G), > > > > How about your opinion for this new proposal? For now looks both > > Jason (W) and Jean

RE: (proposal) RE: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-10-15 Thread Liu, Yi L
> From: Jason Wang > Sent: Thursday, October 15, 2020 4:41 PM > > > On 2020/10/15 ??3:58, Tian, Kevin wrote: > >> From: Jason Wang > >> Sent: Thursday, October 15, 2020 2:52 PM > >> > >> > >> On 2020/10/14 ??11:08, Tian, Kevin wrote: > From: Jason Wang > Sent: Tuesday, October 13,

RE: [PATCH v7 04/16] vfio: Add PASID allocation/free support

2020-09-14 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Saturday, September 12, 2020 4:55 AM > > On Thu, 10 Sep 2020 03:45:21 -0700 > Liu Yi L wrote: > > > Shared Virtual Addressing (a.k.a Shared Virtual Memory) allows sharing > > multiple process virtual address spaces

RE: [PATCH v7 03/16] vfio/type1: Report iommu nesting info to userspace

2020-09-12 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Saturday, September 12, 2020 4:17 AM > > On Thu, 10 Sep 2020 03:45:20 -0700 > Liu Yi L wrote: > > > This patch exports iommu nesting capability info to user space through > > VFIO. Userspace is expected to check this

RE: [PATCH v7 13/16] vfio/pci: Expose PCIe PASID capability to guest

2020-09-12 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Saturday, September 12, 2020 6:13 AM > > On Thu, 10 Sep 2020 03:45:30 -0700 > Liu Yi L wrote: > > > This patch exposes PCIe PASID capability to guest for assigned devices. > > Existing vfio_pci driver hides it from g

RE: [PATCH v7 07/16] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-09-12 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Saturday, September 12, 2020 5:38 AM > > On Thu, 10 Sep 2020 03:45:24 -0700 > Liu Yi L wrote: > > > This patch allows userspace to request PASID allocation/free, e.g. when > > serving the request from the guest. >

RE: [PATCH v7 10/16] vfio/type1: Support binding guest page tables to PASID

2020-09-12 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Saturday, September 12, 2020 6:04 AM > > On Thu, 10 Sep 2020 03:45:27 -0700 > Liu Yi L wrote: > > > Nesting translation allows two-levels/stages page tables, with 1st > > level for guest translations (e.g. GVA->GPA), 2n

[PATCH v7 10/16] vfio/type1: Support binding guest page tables to PASID

2020-09-10 Thread Liu Yi L
before the binding request. Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan --- v6 -> v7: *) introduced @user in struct domain_capsule to

[PATCH v7 14/16] vfio: Document dual stage control

2020-09-10 Thread Liu Yi L
: Lu Baolu Signed-off-by: Eric Auger Signed-off-by: Liu Yi L Reviewed-by: Stefan Hajnoczi --- v6 -> v7: *) tweak per Eric's comments. v5 -> v6: *) tweak per Eric's comments. v3 -> v4: *) add review-by from Stefan Hajnoczi v2 -> v3: *) address comments from Stefan Hajnoczi v1 -

[PATCH v7 06/16] iommu/vt-d: Remove get_task_mm() in bind_gpasid()

2020-09-10 Thread Liu Yi L
Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/iommu/intel/svm.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index 519eabb..d3cf52b 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel

[PATCH v7 08/16] iommu: Pass domain to sva_unbind_gpasid()

2020-09-10 Thread Liu Yi L
Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Yi Sun Signed-off-by: Liu Yi L --- v6 -> v7: *) correct the link for the details of modifying pasid prototype to bve "u32". *) hold off r-b from Eric Auger as there is modific

[PATCH v7 11/16] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2020-09-10 Thread Liu Yi L
Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Eric Auger Signed-off-by: Jacob Pan --- v1 -> v2: *) rename from "vfio/type1: Flush stage-1 IOMMU cache for nesting type" *) rename vfio_cache_inv_fn() to vfio_dev_cache_

[PATCH v7 05/16] iommu/vt-d: Support setting ioasid set to domain

2020-09-10 Thread Liu Yi L
son Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan --- v6 -> v7: *) add a helper function __domain_config_ioasid_set() per Eric's comment. *) rename @ioasid_sid field of struct dmar_domain to be @pasid_set. *) Eric ga

[PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-09-10 Thread Liu Yi L
1562324772-3084-1-git-send-email-yi.l@intel.com/ --- Eric Auger (1): vfio: Document dual stage control Liu Yi L (14): iommu: Report domain nesting info iommu/smmu: Report empty domain nesting info vfio/type1: Report iommu nesting info to userspace vfio: Add PASID allocation/free support i

[PATCH v7 15/16] iommu/vt-d: Only support nesting when nesting caps are consistent across iommu units

2020-09-10 Thread Liu Yi L
This patch makes change to only supports the case where all the physical iommu units have the same CAP/ECAP MASKS for nested translation. Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed

[PATCH v7 01/16] iommu: Report domain nesting info

2020-09-10 Thread Liu Yi L
-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan --- v6 -> v7: *) rephrase the commit message, replace the @data[] field in struct iommu_nesting_info with union per comments from Eric Auger. v5 -> v6: *) rephrase the feature notes per comment

[PATCH v7 04/16] vfio: Add PASID allocation/free support

2020-09-10 Thread Liu Yi L
PASIDs. Currently the quota is a global parameter applied to all VFIO devices. In the future per-device quota might be supported too. Cc: Kevin Tian CC: Jacob Pan Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Suggested-by: Alex Williamson Signed-off-by: Liu Yi L

[PATCH v7 02/16] iommu/smmu: Report empty domain nesting info

2020-09-10 Thread Liu Yi L
Auger Cc: Jean-Philippe Brucker Suggested-by: Jean-Philippe Brucker Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan Reviewed-by: Eric Auger --- v5 -> v6: *) add review-by from Eric Auger. v4 -> v5: *) address comments from Eric Auger. --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.

[PATCH v7 12/16] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-09-10 Thread Liu Yi L
. The main requirement is to use the auxiliary domain associated with mdev. Cc: Kevin Tian CC: Jacob Pan CC: Jun Tian Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Reviewed-by: Eric Auger --- v5 -> v6: *) add review-by f

[PATCH v7 16/16] iommu/vt-d: Support reporting nesting capability info

2020-09-10 Thread Liu Yi L
This patch reports nesting info when iommu_domain_get_attr() is called with DOMAIN_ATTR_NESTING and one domain with nesting set. Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off

[PATCH v7 13/16] vfio/pci: Expose PCIe PASID capability to guest

2020-09-10 Thread Liu Yi L
Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Reviewed-by: Eric Auger --- v5 -> v6: *) add review-by from Eric Auger. v1 -> v2: *) added in v2, but it was sent in a separate patchseries before --- drivers/vf

[PATCH v7 09/16] iommu/vt-d: Check ownership for PASIDs from user-space

2020-09-10 Thread Liu Yi L
CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Jacob Pan --- v6 -> v7: *) acquire device_domain_lock in bind/unbind_gpasid() to ensure dmar_domain is not modified during bind/unbind_gpa

[PATCH v7 07/16] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-09-10 Thread Liu Yi L
: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L Signed-off-by: Yi Sun Signed-off-by: Jacob Pan --- v6 -> v7: *) current VFIO returns allocated pasid via signed int, thus VFIO UAPI can only support 31 bits pasid. If user space gives min,max which is wider t

[PATCH v7 03/16] vfio/type1: Report iommu nesting info to userspace

2020-09-10 Thread Liu Yi L
Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L --- v6 -> v7: *) using vfio_info_add_capability() for adding nesting cap per suggestion from Eric. v5 -> v6: *) address comments against v5 from Eric Auger. *) don't report nesting cap to userspace if the nesting_info->format is inv

RE: [PATCH v6 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 9:49 AM > > On Fri, 21 Aug 2020 00:37:19 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > > From: Alex Williamson > > > Sent: Friday, August 21, 2020 4:51 AM > >

RE: [PATCH v6 12/15] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 5:49 AM > > On Mon, 27 Jul 2020 23:27:41 -0700 > Liu Yi L wrote: > > > Recent years, mediated device pass-through framework (e.g. vfio-mdev) > > is used to achieve flexible device sharing acros

RE: [PATCH v6 04/15] vfio/type1: Report iommu nesting info to userspace

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 3:52 AM > > On Mon, 27 Jul 2020 23:27:33 -0700 > Liu Yi L wrote: > > > This patch exports iommu nesting capability info to user space through > > VFIO. Userspace is expected to check this info for s

RE: [PATCH v6 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 4:51 AM > > On Mon, 27 Jul 2020 23:27:36 -0700 > Liu Yi L wrote: > > > This patch allows userspace to request PASID allocation/free, e.g. > > when serving the request from the guest. >

RE: [PATCH v6 08/15] iommu: Pass domain to sva_unbind_gpasid()

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 5:06 AM > > On Mon, 27 Jul 2020 23:27:37 -0700 > Liu Yi L wrote: > > > From: Yi Sun > > > > Current interface is good enough for SVA virtualization on an assigned > > physical PCI dev

RE: [PATCH v6 15/15] iommu/vt-d: Support reporting nesting capability info

2020-08-17 Thread Liu, Yi L
Eric, > From: Auger Eric > Sent: Monday, August 17, 2020 3:43 PM > > On 8/17/20 9:05 AM, Liu, Yi L wrote: > > Hi Eric, > > > >> Auger Eric > >> Sent: Sunday, August 16, 2020 8:01 PM > >> > >> Hi Yi, > >> > >> On 7/

RE: [PATCH v6 14/15] vfio: Document dual stage control

2020-08-17 Thread Liu, Yi L
Hi Eric, > From: Eric Auger > Sent: Monday, August 17, 2020 3:41 PM > > Hi Yi, > > On 8/17/20 9:00 AM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> Sent: Sunday, August 16, 2020 7:52 PM > >> > >> Hi Yi, &g

RE: [PATCH v6 15/15] iommu/vt-d: Support reporting nesting capability info

2020-08-17 Thread Liu, Yi L
Hi Eric, > Auger Eric > Sent: Sunday, August 16, 2020 8:01 PM > > Hi Yi, > > On 7/28/20 8:27 AM, Liu Yi L wrote: > > This patch reports nesting info, and only supports the case where all > > the physical iomms have the same CAP/ECAP MASKS. > s/iomms/iommus yep

  1   2   3   4   5   6   >