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 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
> 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
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 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 >

RE: [RFC PATCH v1 0/4] vfio: Add IOPF support for VFIO passthrough

2021-02-09 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Thursday, February 4, 2021 2:52 PM > > > From: Shenming Lu > > Sent: Tuesday, February 2, 2021 2:42 PM > > > > On 2021/2/1 15:56, Tian, Kevin wrote: > > >> From: Alex Williamson > > >> Sent: Saturday, January 30, 2021 6:58 AM > > >> > > >> On Mon, 25 Jan 2021

[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 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):

[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

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 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 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 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 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: [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

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

2020-08-17 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, August 16, 2020 7:52 PM > > Hi Yi, > > On 7/28/20 8:27 AM, Liu Yi L wrote: > > From: Eric Auger > > > > The VFIO API was enhanced to support nested stage control: a bunch of> new > ioctls and usage gui

RE: [PATCH v6 11/15] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2020-08-17 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, August 16, 2020 7:35 PM > > Hi Yi, > > On 7/28/20 8:27 AM, Liu Yi L wrote: > > This patch provides an interface allowing the userspace to invalidate > > IOMMU cache for first-level page table. It is required when the fi

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

2020-08-17 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, August 16, 2020 7:29 PM > > Hi Yi, > > On 7/28/20 8:27 AM, Liu Yi L wrote: > > Nesting translation allows two-levels/stages page tables, with 1st level > > for guest translations (e.g. GVA->GPA), 2nd level for hos

RE: [PATCH v6 09/15] iommu/vt-d: Check ownership for PASIDs from user-space

2020-08-16 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, August 16, 2020 12:30 AM > > Hi Yi, > > On 7/28/20 8:27 AM, Liu Yi L wrote: > > When an IOMMU domain with nesting attribute is used for guest SVA, a > > system-wide PASID is allocated for binding with the device an

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

2020-08-16 Thread Liu, Yi L
Thanks, Eric. Regards, Yi Liu > From: Auger Eric > Sent: Sunday, August 16, 2020 12:30 AM > > Yi, > > On 7/28/20 8:27 AM, 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 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-08-14 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Thursday, August 13, 2020 11:07 PM > > Hi Yi, > > On 7/28/20 8:27 AM, Liu Yi L wrote: > > From IOMMU p.o.v., PASIDs allocated and managed by external components > > (e.g. VFIO) will be passed in for gpasid_bind/unbind o

RE: [PATCH v6 05/15] vfio: Add PASID allocation/free support

2020-08-14 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Thursday, August 13, 2020 11:07 PM > > Yi, > > On 7/28/20 8:27 AM, Liu Yi L wrote: > > Shared Virtual Addressing (a.k.a Shared Virtual Memory) allows sharing > > multiple process virtual address spaces with the device for si

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

2020-08-14 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Thursday, August 13, 2020 9:20 PM > > Hi Yi, > On 7/28/20 8:27 AM, Liu Yi L wrote: > > This patch exports iommu nesting capability info to user space through > > VFIO. Userspace is expected to check this info for supported uAPIs

RE: [PATCH v6 02/15] iommu: Report domain nesting info

2020-08-14 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Thursday, August 13, 2020 8:53 PM > > Yi, > On 7/28/20 8:27 AM, Liu Yi L wrote: > > IOMMUs that support nesting translation needs report the capability info > s/needs/need to > > to userspace. It gives information about re

RE: [PATCH v7 6/7] iommu/uapi: Handle data and argsz filled by users

2020-08-13 Thread Liu, Yi L
> From: Auger Eric > Sent: Thursday, August 13, 2020 5:31 PM > > Hi Yi, > > On 8/13/20 11:25 AM, Liu, Yi L wrote: > > Hi Eric, > > > > > >> From: Auger Eric > >> Sent: Thursday, August 13, 2020 5:12 PM > >> > >> Hi Jac

RE: [PATCH v7 6/7] iommu/uapi: Handle data and argsz filled by users

2020-08-13 Thread Liu, Yi L
gt; This patch adds sanity checks in the IOMMU layer. In addition to argsz, > > reserved/unused fields in padding, flags, and version are also checked. > > Details are documented in Documentation/userspace-api/iommu.rst > > > > Signed-off-by: Liu Yi L > > Signed-off-by: Ja

RE: [PATCH v3 4/4] vfio/type1: Use iommu_aux_at(de)tach_group() APIs

2020-07-30 Thread Liu, Yi L
> From: Lu Baolu > Sent: Tuesday, July 14, 2020 1:57 PM > > Replace iommu_aux_at(de)tach_device() with iommu_aux_at(de)tach_group(). > It also saves the IOMMU_DEV_FEAT_AUX-capable physcail device in the vfio_group > data structure so that it could be reused in other places. > > Signed-off-by:

RE: [PATCH v6 01/15] vfio/type1: Refactor vfio_iommu_type1_ioctl()

2020-07-28 Thread Liu, Yi L
> From: Alex Williamson > Sent: Tuesday, July 28, 2020 11:54 PM > > On Mon, 27 Jul 2020 23:27:30 -0700 > Liu Yi L wrote: > > > This patch refactors the vfio_iommu_type1_ioctl() to use switch > > instead of if-else, and each command got a helper function. > &g

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

2020-07-28 Thread Liu Yi L
Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L --- v5 -> v6: *) address comments against v5 from Eric Auger. *) don't report nesting cap to userspace if the nesting_info->format is invalid. v4 -> v5: *) address comments from Eric Auger. *) return struct iommu_nes

[PATCH v6 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-07-28 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 --- v5 -> v6: *) address comments against v5 from Eric Auger. v4 -> v5: *) address comments from Eric Auger. --- drivers/iommu/intel/iom

[PATCH v6 05/15] vfio: Add PASID allocation/free support

2020-07-28 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 --- v5

[PATCH v6 13/15] vfio/pci: Expose PCIe PASID capability to guest

2020-07-28 Thread Liu Yi L
Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Reviewed-by: Eric Auger Signed-off-by: Liu Yi L --- 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 v6 09/15] iommu/vt-d: Check ownership for PASIDs from user-space

2020-07-28 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 --- drivers/iommu/intel/iommu.c | 10 ++ drivers/iommu/intel/svm.c | 7 +-- 2 files changed, 15 insertions(+), 2

[PATCH v6 03/15] iommu/smmu: Report empty domain nesting info

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

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

2020-07-28 Thread Liu Yi L
: Lu Baolu Reviewed-by: Stefan Hajnoczi Signed-off-by: Eric Auger Signed-off-by: Liu Yi L --- v5 -> v6: *) tweak per Eric's comments. v3 -> v4: *) add review-by from Stefan Hajnoczi v2 -> v3: *) address comments from Stefan Hajnoczi v1 -> v2: *) new in v2, compared with Eri

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

2020-07-28 Thread Liu Yi L
This patch reports nesting info, and only supports the case where all the physical iomms have the same CAP/ECAP MASKS. 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-by: Jacob Pan

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

2020-07-28 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 --- v5 -> v6: *) address comments from Eric against v5. remove the alloc/free helper. v4 -> v5: *) address comments from Eric Auger. *) the comments for the PASI

[PATCH v6 02/15] iommu: Report domain nesting info

2020-07-28 Thread Liu Yi L
nesting info after setting DOMAIN_ATTR_NESTING. For VFIO, it is after selecting VFIO_TYPE1_NESTING_IOMMU. 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-by: Jacob Pan --- v5 ->

[PATCH v6 10/15] vfio/type1: Support binding guest page tables to PASID

2020-07-28 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 --- v5 -> v6: *) dropped vfio_find_nesting_group(

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

2020-07-28 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 Reviewed-by: Eric Auger Signed-off-by: Liu Yi L --- v5 -> v6: *) add review-by f

[PATCH v6 00/15] vfio: expose virtual Shared Virtual Addressing to VMs

2020-07-28 Thread Liu Yi L
u/1562324772-3084-1-git-send-email-yi.l@intel.com/ --- Eric Auger (1): vfio: Document dual stage control Liu Yi L (13): vfio/type1: Refactor vfio_iommu_type1_ioctl() iommu: Report domain nesting info iommu/smmu: Report empty domain nesting info vfio/type1: Report iommu nesting i

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

2020-07-28 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 v6 08/15] iommu: Pass domain to sva_unbind_gpasid()

2020-07-28 Thread Liu Yi L
l Cc: Lu Baolu Reviewed-by: Eric Auger Signed-off-by: Yi Sun Signed-off-by: Liu Yi L --- v5 -> v6: *) use "u32" prototype for @pasid. *) add review-by from Eric Auger. v2 -> v3: *) pass in domain info only *) use u32 for pasid instead of int type v1 -> v2: *) added in v2. --

[PATCH v6 01/15] vfio/type1: Refactor vfio_iommu_type1_ioctl()

2020-07-28 Thread Liu Yi L
-by: Christoph Hellwig Signed-off-by: Liu Yi L --- v4 -> v5: *) address comments from Eric Auger, add r-b from Eric. --- drivers/vfio/vfio_iommu_type1.c | 394 ++-- 1 file changed, 213 insertions(+), 181 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/driv

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

2020-07-25 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Saturday, July 18, 2020 9:40 PM > > Hi Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > From: Eric Auger > > > > The VFIO API was enhanced to support nested stage control: a bunch of > > new iotcls and usage g

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

2020-07-23 Thread Liu, Yi L
Hi Eric, > From: Auger Eric < eric.au...@redhat.com> > Sent: Monday, July 20, 2020 8:22 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > Recent years, mediated device pass-through framework (e.g. vfio-mdev) > > is used to achieve flexible device sharing

RE: [PATCH v5 03/15] iommu/smmu: Report empty domain nesting info

2020-07-23 Thread Liu, Yi L
Hi Jean, > From: Jean-Philippe Brucker > Sent: Friday, July 17, 2020 5:09 PM > > On Thu, Jul 16, 2020 at 10:38:17PM +0200, Auger Eric wrote: > > Hi Jean, > > > > On 7/16/20 5:39 PM, Jean-Philippe Brucker wrote: > > > On Tue, Jul 14, 2020 at 10:12:49AM +

RE: [PATCH v5 03/15] iommu/smmu: Report empty domain nesting info

2020-07-23 Thread Liu, Yi L
Hi Jean, > From: Jean-Philippe Brucker > Sent: Thursday, July 16, 2020 11:40 PM > > On Tue, Jul 14, 2020 at 10:12:49AM +0000, Liu, Yi L wrote: > > > Have you verified that this doesn't break the existing usage of > > > DOMAIN_ATTR_NESTING in drivers/vfio/vfio_i

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

2020-07-20 Thread Liu, Yi L
ooks like the subject is straightforward, so I removed commit message. > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > Cc: Kevin Tian > > CC: Jacob Pan > > Cc: Alex Williamson > > Cc: Eric Auger > > Cc: Jean-Philippe Brucker > > Cc: Joerg Roedel > > Cc

RE: [PATCH v5 13/15] vfio/pci: Expose PCIe PASID capability to guest

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 20, 2020 8:35 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > This patch exposes PCIe PASID capability to guest for assigned devices. > > Existing vfio_pci driver hides it from guest by setting

RE: [PATCH v5 09/15] iommu/vt-d: Check ownership for PASIDs from user-space

2020-07-20 Thread Liu, Yi L
Eric, > From: Auger Eric > Sent: Monday, July 20, 2020 8:38 PM > > Yi, > > On 7/20/20 12:18 PM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> Sent: Monday, July 20, 2020 12:06 AM > >> > >> Hi Yi, > &

RE: [PATCH v5 11/15] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 20, 2020 5:42 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > This patch provides an interface allowing the userspace to invalidate > > IOMMU cache for first-level page table. It is required when the fi

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

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 20, 2020 5:37 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > Nesting translation allows two-levels/stages page tables, with 1st level > > for guest translations (e.g. GVA->GPA), 2nd level for hos

RE: [PATCH v5 09/15] iommu/vt-d: Check ownership for PASIDs from user-space

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 20, 2020 12:06 AM > > Hi Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > When an IOMMU domain with nesting attribute is used for guest SVA, a > > system-wide PASID is allocated for binding with the device and the d

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

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, July 19, 2020 11:38 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > From: Yi Sun > > > > Current interface is good enough for SVA virtualization on an assigned > > physical PCI device, but whe

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

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, July 19, 2020 11:39 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > This patch allows user space to request PASID allocation/free, e.g. > > when serving the request from the guest. > > > &

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

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 20, 2020 4:33 PM > > Yi, > > On 7/20/20 9:51 AM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> Sent: Saturday, July 18, 2020 1:34 AM > >> > >> Yi, > >&

RE: [PATCH v5 05/15] vfio: Add PASID allocation/free support

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 20, 2020 4:26 PM [...] > >>> +int vfio_pasid_alloc(struct vfio_mm *vmm, int min, int max) { > >>> + ioasid_t pasid; > >>> + struct vfio_pasid *vid; > >>> + > >>> + pasid = ioasid_alloc(vmm->ioasid_sid, min, max, NULL); > >>> + if (pasid ==

RE: [PATCH v5 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, July 19, 2020 11:38 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > From IOMMU p.o.v., PASIDs allocated and managed by external components > > (e.g. VFIO) will be passed in for gpasid_bind/unbind operation.

RE: [PATCH v5 05/15] vfio: Add PASID allocation/free support

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Sunday, July 19, 2020 11:39 PM > > Yi, > > On 7/12/20 1:21 PM, Liu Yi L wrote: > > Shared Virtual Addressing (a.k.a Shared Virtual Memory) allows sharing > > multiple process virtual address spaces with the device for simplifie

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

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Saturday, July 18, 2020 1:34 AM > > Yi, > > On 7/12/20 1:20 PM, Liu Yi L wrote: > > This patch exports iommu nesting capability info to user space through > > VFIO. User space is expected to check this info for supported uAPIs (

RE: [PATCH v5 03/15] iommu/smmu: Report empty domain nesting info

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > > Yi, > > On 7/12/20 1:20 PM, Liu Yi L wrote: > > This patch is added as instead of returning a boolean for > > DOMAIN_ATTR_NESTING, > > iommu_domain_get_attr() should return an iommu_nesting_info handle. > > you may add in

RE: [PATCH v5 02/15] iommu: Report domain nesting info

2020-07-20 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Saturday, July 18, 2020 12:29 AM > > Hi Yi, > > On 7/12/20 1:20 PM, Liu Yi L wrote: > > IOMMUs that support nesting translation needs report the capability info > s/needs/need to report yep. > > to userspace, e.g. the f

RE: [PATCH v6 01/12] iommu: Change type of pasid to u32

2020-07-14 Thread Liu, Yi L
> From: Yu, Fenghua > Sent: Tuesday, July 14, 2020 9:55 PM > On Mon, Jul 13, 2020 at 07:45:49PM -0700, Liu, Yi L wrote: > > > From: Fenghua Yu > > > Sent: Tuesday, July 14, 2020 7:48 AM > > > > > > PASID is defined as a few different types in iommu in

RE: [PATCH v5 03/15] iommu/smmu: Report empty domain nesting info

2020-07-14 Thread Liu, Yi L
Hi Will, > From: Will Deacon > Sent: Monday, July 13, 2020 9:15 PM > > On Sun, Jul 12, 2020 at 04:20:58AM -0700, Liu Yi L wrote: > > This patch is added as instead of returning a boolean for > > DOMAIN_ATTR_NESTING, > > iommu_domain_get_attr() should retur

RE: [PATCH v6 03/12] docs: x86: Add documentation for SVA (Shared Virtual Addressing)

2020-07-13 Thread Liu, Yi L
> From: Fenghua Yu > Sent: Tuesday, July 14, 2020 7:48 AM > > From: Ashok Raj > > ENQCMD and Data Streaming Accelerator (DSA) and all of their associated > features > are a complicated stack with lots of interconnected pieces. > This documentation provides a big picture overview for all of

RE: [PATCH v6 01/12] iommu: Change type of pasid to u32

2020-07-13 Thread Liu, Yi L
> From: Fenghua Yu > Sent: Tuesday, July 14, 2020 7:48 AM > > PASID is defined as a few different types in iommu including "int", > "u32", and "unsigned int". To be consistent and to match with uapi > definitions, define PASID and its variations (e.g. max PASID) as "u32". > "u32" is also shorter

[PATCH v5 02/15] iommu: Report domain nesting info

2020-07-12 Thread Liu Yi L
: 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 --- v4 -> v5: *) address comments from Eric Auger. v3 -> v4: *) split the SMMU driver changes to be a separate patch *) move the @addr

[PATCH v5 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-07-12 Thread Liu Yi L
lex 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 --- v4 -> v5: *) address comments from Eric Auger. --- drivers/iommu/intel/iommu.c | 22 ++ include/linux/intel-iommu.h | 4 include

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

2020-07-12 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 --- drivers/iommu/intel/iommu.c | 10 ++ drivers/iommu/intel/svm.c | 7 +-- 2 files changed, 15 insertions(+), 2

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

2020-07-12 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 --- v4 -> v5: *) address comments from Eric Auger. *) the comments for the PASID_FREE request is addressed in patch 5/15 of this series. v3 -> v4: *) address co

[PATCH v5 03/15] iommu/smmu: Report empty domain nesting info

2020-07-12 Thread Liu Yi L
This patch is added as instead of returning a boolean for DOMAIN_ATTR_NESTING, iommu_domain_get_attr() should return an iommu_nesting_info handle. Cc: Will Deacon Cc: Robin Murphy Cc: Eric Auger Cc: Jean-Philippe Brucker Suggested-by: Jean-Philippe Brucker Signed-off-by: Liu Yi L Signed-off

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

2020-07-12 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 v5 12/15] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-07-12 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 --- v1 -> v2: *) check the iommu_device to ensure the handl

[PATCH v5 13/15] vfio/pci: Expose PCIe PASID capability to guest

2020-07-12 Thread Liu Yi L
Cc: Eric Auger Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Liu Yi L --- v1 -> v2: *) added in v2, but it was sent in a separate patchseries before --- drivers/vfio/pci/vfio_pci_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

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

2020-07-12 Thread Liu Yi L
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-by: Jacob Pan --- v2 -> v3: *) remove cap/ecap_mask in iommu_nesting_info. --- drivers/iommu/intel/iommu.c |

[PATCH v5 01/15] vfio/type1: Refactor vfio_iommu_type1_ioctl()

2020-07-12 Thread Liu Yi L
-by: Christoph Hellwig Signed-off-by: Liu Yi L --- v4 -> v5: *) address comments from Eric Auger, add r-b from Eric. --- drivers/vfio/vfio_iommu_type1.c | 394 ++-- 1 file changed, 213 insertions(+), 181 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/driv

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

2020-07-12 Thread Liu Yi L
discussion about this decision. https://lkml.org/lkml/2020/5/15/1028 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 --- v4 -> v5: *) address comments from Eric Auger. *) return str

  1   2   3   4   >