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 f

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 are

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

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-11 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-11 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
re 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 08/16] iommu: Pass domain to sva_unbind_gpasid()

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

[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 14/16] vfio: Document dual stage control

2020-09-10 Thread Liu Yi L
l Cc: 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 Ha

[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 12/16] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-09-10 Thread Liu Yi L
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-by

[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 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. *) Er

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

2020-09-10 Thread Liu Yi L
fio: 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 (14): iommu: Report domain nesting info iommu/smmu: Report empty domain nesting info vfio/type

[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 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
cker Cc: Joerg 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-

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 guidel

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

2020-08-16 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-16 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 requireme

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

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

2020-08-13 Thread Liu, Yi L
his 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: Lu

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 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-07-27 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 10/15] vfio/type1: Support binding guest page tables to PASID

2020-07-27 Thread Liu Yi L
re 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 15/15] iommu/vt-d: Support reporting nesting capability info

2020-07-27 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 03/15] iommu/smmu: Report empty domain nesting info

2020-07-27 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 00/15] vfio: expose virtual Shared Virtual Addressing to VMs

2020-07-27 Thread Liu Yi L
ATTACH/DETACH_PASID_TABLE. RFC v1: https://lore.kernel.org/linux-iommu/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 i

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

2020-07-27 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 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-27 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 01/15] vfio/type1: Refactor vfio_iommu_type1_ioctl()

2020-07-27 Thread Liu Yi L
: 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 v6 14/15] vfio: Document dual stage control

2020-07-27 Thread Liu Yi L
l Cc: 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, compare

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

2020-07-27 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 11/15] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2020-07-27 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 02/15] iommu: Report domain nesting info

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

2020-07-27 Thread Liu Yi L
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 04/15] vfio/type1: Report iommu nesting info to userspace

2020-07-27 Thread Liu Yi L
cker Cc: Joerg 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

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

2020-07-27 Thread Liu Yi L
oedel 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

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

2020-07-27 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

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

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

2020-07-20 Thread Liu, Yi L
s 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 the

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, > >&g

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 first

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

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

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

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 the

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 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 04/15] vfio/type1: Report iommu nesting info to userspace

2020-07-12 Thread Liu Yi L
lated 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. *) retur

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

2020-07-12 Thread Liu Yi L
_PASID_TABLE. RFC v1: https://lore.kernel.org/linux-iommu/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

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

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

2020-07-12 Thread Liu Yi L
l Cc: Lu Baolu Reviewed-by: Stefan Hajnoczi Signed-off-by: Eric Auger Signed-off-by: Liu Yi L --- v3 -> v4: *) add review-by from Stefan Hajnoczi v2 -> v3: *) address comments from Stefan Hajnoczi v1 -> v2: *) new in v2, compared with Eric's original version, pasid tabl

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

2020-07-12 Thread Liu Yi L
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 --- v2 -> v3: *) pass in domain info only *) use ioasid_t for pasid instead of int type v1 -&

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

2020-07-12 Thread Liu Yi L
: 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 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 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

<    1   2   3   4   5   6   >