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

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

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

2020-07-12 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 --- v4

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

2020-07-12 Thread Liu Yi L
inding 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 --- v3 -> v4: *) address comments from Alex on v3 v2 ->

[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 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 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 13/15] vfio/pci: Expose PCIe PASID capability to guest

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

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-10 Thread Liu, Yi L
> From: Alex Williamson > Sent: Friday, July 10, 2020 8:55 PM > > On Fri, 10 Jul 2020 05:39:57 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > > From: Alex Williamson > > > Sent: Thursday, July 9, 2020 10:28 PM > > &g

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-09 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Thursday, July 9, 2020 10:28 PM > > On Thu, 9 Jul 2020 07:16:31 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > After more thinking, looks like adding a r-b tree is still not enough to > > solve th

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-09 Thread Liu, Yi L
- 999, and search in r-b tree. So I'm wondering can we fall back to prior proposal which only free one PASID for a free request. how about your opinion? https://lore.kernel.org/linux-iommu/20200416084031.7266a...@w520.home/ Regards, Yi Liu > From: Liu, Yi L > Sent: Thursday, July 9, 20

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-08 Thread Liu, Yi L
Hi Kevin, > From: Tian, Kevin > Sent: Thursday, July 9, 2020 10:18 AM > > > From: Liu, Yi L > > Sent: Thursday, July 9, 2020 10:08 AM > > > > Hi Kevin, > > > > > From: Tian, Kevin > > > Sent: Thursday, July 9, 2020 9:57 AM > > &g

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-08 Thread Liu, Yi L
Hi Kevin, > From: Tian, Kevin > Sent: Thursday, July 9, 2020 9:57 AM > > > From: Liu, Yi L > > Sent: Thursday, July 9, 2020 8:32 AM > > > > Hi Alex, > > > > > Alex Williamson > > > Sent: Thursday, July 9, 2020 3:55 AM > > >

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-08 Thread Liu, Yi L
Hi Alex, > Alex Williamson > Sent: Thursday, July 9, 2020 3:55 AM > > On Wed, 8 Jul 2020 08:16:16 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > > From: Liu, Yi L < yi.l@intel.com> > > > Sent: Friday, July 3, 2020

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

2020-07-08 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Thursday, July 9, 2020 3:30 AM > > On Wed, 8 Jul 2020 08:08:40 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > Eric asked if we will to have data strcut other than struct

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-08 Thread Liu, Yi L
Hi Alex, > From: Liu, Yi L < yi.l@intel.com> > Sent: Friday, July 3, 2020 2:28 PM > > Hi Alex, > > > From: Alex Williamson > > Sent: Friday, July 3, 2020 5:19 AM > > > > On Wed, 24 Jun 2020 01:55:19 -0700 > > Liu Yi L wrote: >

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

2020-07-08 Thread Liu, Yi L
ap_nesting { + struct vfio_info_cap_header header; + __u32 flags; + __u32 padding; + __u8info[]; +}; https://lore.kernel.org/linux-iommu/dm5pr11mb1435290b6cd561ec61027892c3...@dm5pr11mb1435.namprd11.prod.outlook.com/ Regards, Yi Liu > From: Liu, Yi L > Sent: Tuesday, J

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

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 11:18 PM > > Hi Yi, > > On 7/4/20 1:26 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 v4 05/15] vfio: Add PASID allocation/free support

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 10:52 PM > > Hi Yi, > > On 7/4/20 1:26 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 v4 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 10:52 PM > > Hi Yi, > > On 7/4/20 1:26 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 v4 04/15] vfio/type1: Report iommu nesting info to userspace

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 10:07 PM > > Hi Yi, > On 7/4/20 1:26 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 (e.g.

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

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric < eric.au...@redhat.com > > Sent: Monday, July 6, 2020 9:45 PM > > Hi Yi, > > On 7/6/20 3:10 PM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> Sent: Monday, July 6, 2020 6:37 PM > >> &

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

2020-07-06 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 9:22 PM > > Hi Yi, > > On 7/6/20 2:46 PM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> > >> Hi Yi, > >> > >> Please add a

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

2020-07-06 Thread Liu, Yi L
> From: Auger Eric > Sent: Monday, July 6, 2020 9:01 PM > > On 7/6/20 2:20 PM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> Sent: Monday, July 6, 2020 5:34 PM > >> > >> On 7/4/20 1:26 PM, Liu Yi L wrote: > >>

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

2020-07-06 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 6:37 PM > > Yi, > > On 7/4/20 1:26 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 (e

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

2020-07-06 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 8:56 PM > > Hi Yi, > > On 7/6/20 2:27 PM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> Sent: Monday, July 6, 2020 5:34 PM > >> > >> Hi Yi, > >

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

2020-07-06 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > > Hi Yi, > > Please add a commit message: instead of returning a boolean for > DOMAIN_ATTR_NESTING, arm_smmu_domain_get_attr() returns a > iommu_nesting_info handle. will do. thanks for the suggestion. > > On 7/4/20 1:26 PM, Liu Yi L

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

2020-07-06 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 5:34 PM > > Hi Yi, > > On 7/4/20 1:26 PM, Liu Yi L wrote: > > This patch refactors the vfio_iommu_type1_ioctl() to use switch > > instead of if-else, and each cmd got a helper function. > command I

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

2020-07-06 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 5:34 PM > > On 7/4/20 1:26 PM, Liu Yi L wrote: > > IOMMUs that support nesting translation needs report the capability info > need to report > > to userspace, e.g. the format of first level/stage paging str

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

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

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

2020-07-04 Thread Liu Yi L
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-by: Jacob Pan --- drivers/iommu/arm-smmu-v3.c | 29 +++-- drivers/iommu/arm-smmu.c| 29

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

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

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

2020-07-04 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 --- v3 -> v4: *) address comments from v3, except the below comment against the range of PASID_FREE request. needs more help on it. "> +if (re

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

2020-07-04 Thread Liu Yi L
inding 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 --- v3 -> v4: *) address comments from Alex on v3 v2 ->

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

2020-07-04 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 --- v3 -> v4: *) split the SMMU driver changes to be a separate patch *) move the @addr_width and @pasid_bits from vendor specific part to generic p

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

2020-07-04 Thread Liu Yi L
amson 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

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

2020-07-04 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 --- drivers/iommu/intel/iommu.c | 16 include/linux/intel-iommu.h | 4 include/linux/iommu.h | 1 + 3 files changed, 21 inserti

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

2020-07-04 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 v4 05/15] vfio: Add PASID allocation/free support

2020-07-04 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 --- v3

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

2020-07-04 Thread Liu Yi L
it-send-email-yi.l@intel.com/ - RFC v1 -> v2: Dropped vfio: VFIO_IOMMU_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

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

2020-07-04 Thread Liu Yi L
: Liu Yi L --- drivers/vfio/vfio_iommu_type1.c | 392 ++-- 1 file changed, 213 insertions(+), 179 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5e556ac..7accb59 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b

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

2020-07-04 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 --- v3 -> v4: *) address comments against v3. v1 -> v2: *)

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

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

RE: [PATCH v3 03/14] vfio/type1: Report iommu nesting info to userspace

2020-07-03 Thread Liu, Yi L
Hi Alex, > From: Liu, Yi L > Sent: Friday, July 3, 2020 2:06 PM [...] > > > +#define VFIO_IOMMU_TYPE1_INFO_CAP_NESTING 3 > > > + > > > +struct vfio_iommu_type1_info_cap_nesting { > > > + struct vfio_info_cap_header header; > > > + __u32 fla

RE: [PATCH v3 09/14] vfio/type1: Support binding guest page tables to PASID

2020-07-02 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, July 3, 2020 5:20 AM > > On Wed, 24 Jun 2020 01:55:22 -0700 > Liu Yi L wrote: > > > Nesting translation allows two-levels/stages page tables, with 1st > > level for guest translations (e.g. GVA->GPA), 2nd lev

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-02 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, July 3, 2020 5:19 AM > > On Wed, 24 Jun 2020 01:55:19 -0700 > 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 v3 04/14] vfio: Add PASID allocation/free support

2020-07-02 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, July 3, 2020 5:17 AM > > On Wed, 24 Jun 2020 01:55:17 -0700 > Liu Yi L wrote: > > > Shared Virtual Addressing (a.k.a Shared Virtual Memory) allows sharing > > multiple process virtual address spaces

RE: [PATCH v3 03/14] vfio/type1: Report iommu nesting info to userspace

2020-07-02 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson < alex.william...@redhat.com > > Sent: Friday, July 3, 2020 2:39 AM > > On Wed, 24 Jun 2020 01:55:16 -0700 > Liu Yi L wrote: > > > This patch exports iommu nesting capability info to user space through > > VFIO. User spac

RE: [PATCH v3 02/14] iommu: Report domain nesting info

2020-07-02 Thread Liu, Yi L
> From: Alex Williamson > Sent: Friday, July 3, 2020 1:55 AM > > On Wed, 24 Jun 2020 01:55:15 -0700 > Liu Yi L wrote: > > > IOMMUs that support nesting translation needs report the capability > > info to userspace, e.g. the format of first level/stage paging

RE: [PATCH v3 10/14] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2020-07-02 Thread Liu, Yi L
> From: Williamson < alex.william...@redhat.com > > Sent: Friday, July 3, 2020 5:20 AM > > On Wed, 24 Jun 2020 01:55:23 -0700 > Liu Yi L wrote: > > > This patch provides an interface allowing the userspace to invalidate > > IOMMU cache for first-level page

RE: [PATCH v3 01/14] vfio/type1: Refactor vfio_iommu_type1_ioctl()

2020-07-02 Thread Liu, Yi L
> From: Alex Williamson > Sent: Friday, July 3, 2020 5:21 AM > To: Liu, Yi L > > On Wed, 24 Jun 2020 01:55:14 -0700 > Liu Yi L wrote: > > > This patch refactors the vfio_iommu_type1_ioctl() to use switch > > instead of if-else, and each cmd got a helper

RE: [PATCH v3 02/14] iommu: Report domain nesting info

2020-06-29 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Tuesday, June 30, 2020 10:01 AM > > > From: Liu, Yi L > > Sent: Monday, June 29, 2020 8:23 PM > > > > Hi Stefan, > > > > > From: Stefan Hajnoczi > > > Sent: Monday, June 29, 2020 5:25 PM > > &

RE: [PATCH v3 02/14] iommu: Report domain nesting info

2020-06-29 Thread Liu, Yi L
Hi Stefan, > From: Stefan Hajnoczi > Sent: Monday, June 29, 2020 5:25 PM > > On Wed, Jun 24, 2020 at 01:55:15AM -0700, Liu Yi L wrote: > > +/* > > + * struct iommu_nesting_info - Information for nesting-capable IOMMU. > > + * user spac

RE: [PATCH v3 13/14] vfio: Document dual stage control

2020-06-29 Thread Liu, Yi L
> From: Stefan Hajnoczi > Sent: Monday, June 29, 2020 5:22 PM > > On Wed, Jun 24, 2020 at 01:55:26AM -0700, Liu Yi L wrote: > > +Details can be found in Documentation/userspace-api/iommu.rst. For > > +Intel VT-d, each stage 1 page table is bound to host by: > >

RE: [PATCH v3 02/14] iommu: Report domain nesting info

2020-06-26 Thread Liu, Yi L
Hi Robin, > From: Robin Murphy > Sent: Saturday, June 27, 2020 12:05 AM > > On 2020-06-26 08:47, Jean-Philippe Brucker wrote: > > On Wed, Jun 24, 2020 at 01:55:15AM -0700, Liu Yi L wrote: > >> IOMMUs that support nesting translation needs report the capability >

RE: [PATCH v3 02/14] iommu: Report domain nesting info

2020-06-26 Thread Liu, Yi L
> From: Jean-Philippe Brucker > Sent: Friday, June 26, 2020 3:48 PM > > On Wed, Jun 24, 2020 at 01:55:15AM -0700, Liu Yi L wrote: > > IOMMUs that support nesting translation needs report the capability > > info to userspace, e.g. the format of first level/stage paging

[PATCH v3 09/14] vfio/type1: Support binding guest page tables to PASID

2020-06-24 Thread Liu Yi L
inding 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 --- v2 -> v3: *) use __iommu_sva_unbind_gpasid() for unbind ca

[PATCH v3 12/14] vfio/pci: Expose PCIe PASID capability to guest

2020-06-24 Thread Liu Yi L
amson 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

[PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-06-24 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 --- v1 -> v2: *) move the vfio_mm related code to be a seprate module *) use a single structure for alloc/free, could support a range of PASIDs *) fetch vfio_mm

[PATCH v3 13/14] vfio: Document dual stage control

2020-06-24 Thread Liu Yi L
l Cc: Lu Baolu Signed-off-by: Eric Auger Signed-off-by: Liu Yi L --- v2 -> v3: *) address comments from Stefan Hajnoczi v1 -> v2: *) new in v2, compared with Eric's original version, pasid table bind and fault reporting is removed as this series doesn't cover them. Origi

[PATCH v3 03/14] vfio/type1: Report iommu nesting info to userspace

2020-06-24 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 --- drivers/vfio/vfio_iommu_type1.c

[PATCH v3 02/14] iommu: Report domain nesting info

2020-06-24 Thread Liu Yi L
-by: Liu Yi L Signed-off-by: Jacob Pan --- drivers/iommu/arm-smmu-v3.c | 29 -- drivers/iommu/arm-smmu.c| 29 -- include/uapi/linux/iommu.h | 59 + 3 files changed, 113 insertions(+), 4 deletions(-) diff

[PATCH v3 04/14] vfio: Add PASID allocation/free support

2020-06-24 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 --- v1

[PATCH v3 14/14] iommu/vt-d: Support reporting nesting capability info

2020-06-24 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 v3 07/14] iommu: Pass domain to sva_unbind_gpasid()

2020-06-24 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 v3 11/14] vfio/type1: Add vSVA support for IOMMU-backed mdevs

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

[PATCH v3 01/14] vfio/type1: Refactor vfio_iommu_type1_ioctl()

2020-06-24 Thread Liu Yi L
: Liu Yi L --- drivers/vfio/vfio_iommu_type1.c | 392 ++-- 1 file changed, 213 insertions(+), 179 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5e556ac..7accb59 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b

[PATCH v3 00/14] vfio: expose virtual Shared Virtual Addressing to VMs

2020-06-24 Thread Liu Yi L
562324772-3084-1-git-send-email-yi.l@intel.com/ --- Eric Auger (1): vfio: Document dual stage control Liu Yi L (12): vfio/type1: Refactor vfio_iommu_type1_ioctl() iommu: Report domain nesting info vfio/type1: Report iommu nesting info to userspace vfio: Add PASID allocation/free s

[PATCH v3 10/14] vfio/type1: Allow invalidating first-level/stage IOMMU cache

2020-06-24 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 v3 05/14] iommu/vt-d: Support setting ioasid set to domain

2020-06-24 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 --- drivers/iommu/intel/iommu.c | 16 include/linux/intel-iommu.h | 4 include/linux/iommu.h | 1 + 3 files changed, 21 inserti

[PATCH v3 08/14] iommu/vt-d: Check ownership for PASIDs from user-space

2020-06-24 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

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

2020-06-22 Thread Liu, Yi L
> From: Stefan Hajnoczi > Sent: Monday, June 22, 2020 8:51 PM > > On Wed, Jun 17, 2020 at 06:27:27AM +0000, Liu, Yi L wrote: > > > From: Stefan Hajnoczi > > > Sent: Monday, June 15, 2020 5:41 PM > > > On Thu, Jun 11, 2020 at 05:15:33AM -0700, Liu Yi

RE: [PATCH v2 1/3] docs: IOMMU user API

2020-06-20 Thread Liu, Yi L
> From: Alex Williamson > Sent: Saturday, June 20, 2020 12:38 AM > > On Fri, 19 Jun 2020 03:30:24 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > > From: Alex Williamson > > > Sent: Friday, June 19, 2020 10:55 AM > > >

RE: [PATCH v2 1/3] docs: IOMMU user API

2020-06-18 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, June 19, 2020 10:55 AM > > On Fri, 19 Jun 2020 02:15:36 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > > From: Alex Williamson > > > Sent: Friday, June 19, 2020 5:48 AM > &g

RE: [PATCH v2 1/3] docs: IOMMU user API

2020-06-18 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, June 19, 2020 5:48 AM > > On Wed, 17 Jun 2020 08:28:24 + > "Tian, Kevin" wrote: > > > > From: Liu, Yi L > > > Sent: Wednesday, June 17, 2020 2:20 PM > > > > > >

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

2020-06-18 Thread Liu, Yi L
Hi Jean, > From: Jean-Philippe Brucker < jean-phili...@linaro.org> > Sent: Wednesday, June 17, 2020 10:39 PM > > [+ Will and Robin] > > Hi Yi, > > On Thu, Jun 11, 2020 at 05:15:21AM -0700, Liu Yi L wrote: > > IOMMUs that support nesting translation nee

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

2020-06-16 Thread Liu, Yi L
> From: Stefan Hajnoczi > Sent: Monday, June 15, 2020 5:41 PM > On Thu, Jun 11, 2020 at 05:15:33AM -0700, Liu Yi L wrote: > > > From: Eric Auger > > > > The VFIO API was enhanced to support nested stage control: a bunch of > > new iotcls and usage guideline. &

RE: [PATCH v2 1/3] docs: IOMMU user API

2020-06-16 Thread Liu, Yi L
> From: Jacob Pan > Sent: Tuesday, June 16, 2020 11:22 PM > > On Thu, 11 Jun 2020 17:27:27 -0700 > Jacob Pan wrote: > > > > > > > But then I thought it even better if VFIO leaves the entire > > > copy_from_user() to the layer consuming it. > > > > > OK. Sounds good, that was what Kevin suggeste

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

2020-06-15 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Tuesday, June 16, 2020 9:56 AM > > > From: Liu, Yi L > > Sent: Monday, June 15, 2020 2:05 PM > > > > Hi Kevin, > > > > > From: Tian, Kevin > > > Sent: Monday, June 15, 2020 9:23 AM > > > &g

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

2020-06-15 Thread Liu, Yi L
> From: Stefan Hajnoczi > Sent: Monday, June 15, 2020 6:02 PM > > On Thu, Jun 11, 2020 at 05:15:19AM -0700, Liu Yi L wrote: > > Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on > > Intel platforms allows address space sharing between device DMA and &

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

2020-06-14 Thread Liu, Yi L
Hi Kevin, > From: Tian, Kevin > Sent: Monday, June 15, 2020 9:23 AM > > > From: Liu, Yi L > > Sent: Friday, June 12, 2020 5:05 PM > > > > Hi Alex, > > > > > From: Alex Williamson > > > Sent: Friday, June 12, 2020 3:30 AM > > &

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

2020-06-12 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, June 12, 2020 3:30 AM > > On Thu, 11 Jun 2020 05:15:21 -0700 > Liu Yi L wrote: > > > IOMMUs that support nesting translation needs report the capability > > info to userspace, e.g. the format of first level/stage

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

2020-06-11 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 --- drivers/iommu/intel-iommu.c | 81 +++-- include/linux/intel-iommu.h | 16

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

2020-06-11 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 | 6 -- 2 files changed, 14 insertions(+), 2

[PATCH v2 03/15] vfio/type1: Report iommu nesting info to userspace

2020-06-11 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 --- drivers/vfio/vfio_iommu_type1.c

[PATCH v2 06/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-06-11 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 --- v1 -> v2: *) move the vfio_mm related code to be a seprate module *) use a single structure for alloc/free, could support a range of PASIDs *) fetch vfio_mm

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

2020-06-11 Thread Liu Yi L
IOMMUs that support nesting translation needs report the capability info to userspace, e.g. the format of first level/stage paging structures. 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

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

2020-06-11 Thread Liu Yi L
amson 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 v2 14/15] vfio: Document dual stage control

2020-06-11 Thread Liu Yi L
l Cc: Lu Baolu Signed-off-by: Eric Auger Signed-off-by: Liu Yi L --- v1 -> v2: *) new in v2, compared with Eric's original version, pasid table bind and fault reporting is removed as this series doesn't cover them. Original version from Eric. https://lkml.org/

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

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

2020-06-11 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 --- drivers/iommu/intel-iommu.c | 16 include/linux/intel-iommu.h | 4 include/linux/iommu.h | 1 + 3 files changed, 21 inserti

[PATCH v2 04/15] vfio: Add PASID allocation/free support

2020-06-11 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 --- v1

[PATCH v2 07/15] iommu/uapi: Add iommu_gpasid_unbind_data

2020-06-11 Thread Liu Yi L
Existing iommu_gpasid_bind_data is used for binding guest page tables to a specified PASID. While for unwind it, a unbind_data structure is needed. 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

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

2020-06-11 Thread Liu Yi L
inding request. 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 --- v1 -> v2: *) rename subject from "vfio/type1: Bind guest page

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

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

[PATCH v2 08/15] iommu: Pass domain and unbind_data to sva_unbind_gpasid()

2020-06-11 Thread Liu Yi L
: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Lu Baolu Signed-off-by: Yi Sun Signed-off-by: Liu Yi L --- drivers/iommu/intel-svm.c | 14 -- drivers/iommu/iommu.c | 4 ++-- include/linux/intel-iommu.h | 3 ++- include/linux/iommu.h | 8 +--- 4 files changed, 21

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

2020-06-11 Thread Liu Yi L
: Liu Yi L --- drivers/vfio/vfio_iommu_type1.c | 183 +++- 1 file changed, 105 insertions(+), 78 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index cc1d647..402aad3 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b

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

2020-06-11 Thread Liu Yi L
RFC v2: https://lore.kernel.org/linux-iommu/1571919983-3231-1-git-send-email-yi.l@intel.com/ - RFC v1 -> v2: Dropped vfio: VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE. RFC v1: https://lore.kernel.org/linux-iommu/1562324772-3084-1-git-send-email-yi.l@intel.com/

RE: [PATCH v1 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE

2020-04-16 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Thursday, April 16, 2020 10:41 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE > > On Thu, 16 Apr 2020 10:40:03 + > "Liu, Yi L" wrote: > > > Hi Alex, > > St

<    1   2   3   4   5   6   >