[RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-01-29 Thread Liu, Yi L
From: Liu Yi L For a long time, devices have only one DMA address space from platform IOMMU's point of view. This is true for both bare metal and directed- access in virtualization environment. Reason is the source ID of DMA in PCIe are BDF (bus/dev/fnc ID), which results in only d

[RFC v3 4/8] vfio/type1: Add VFIO_NESTING_GET_IOMMU_UAPI_VERSION

2020-01-29 Thread Liu, Yi L
From: Liu Yi L In Linux Kernel, the IOMMU nesting translation (a.k.a. IOMMU dual stage translation capability) is abstracted in uapi/iommu.h, in which the uAPIs like bind_gpasid/iommu_cache_invalidate/fault_report/pgreq_resp are defined. VFIO_TYPE1_NESTING_IOMMU stands for the vfio iommu type

[RFC v3 2/8] vfio/type1: Make per-application (VM) PASID quota tunable

2020-01-29 Thread Liu, Yi L
From: Liu Yi L The PASID quota is per-application (VM) according to vfio's PASID management rule. For better flexibility, quota shall be user tunable . This patch provides a VFIO based user interface for which quota can be adjusted. However, quota cannot be adjusted downward below the numb

[RFC v3 0/8] vfio: expose virtual Shared Virtual Addressing to VMs

2020-01-29 Thread Liu, Yi L
d) Adds vSVA vfio support for IOMMU-backed mdevs. - RFC v1 -> v2: Dropped vfio: VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE. Liu Yi L (8): vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) vfio/type1: Make per-application (VM) PASID quota tunable vfio: Reclaim PASIDs when

[RFC v3 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE

2020-01-29 Thread Liu, Yi L
From: Liu Yi L For IOMMU with type VFIO_TYPE1_NESTING_IOMMU, guest "owns" the first-level/stage-1 translation structures, the host IOMMU driver has no knowledge of first-level/stage-1 structure cache updates unless the guest invalidation requests are trapped and passed down to the h

[RFC v3 8/8] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-01-29 Thread Liu, Yi L
From: Liu Yi L Recent years, mediated device pass-through framework (e.g. vfio-mdev) are used to achieve flexible device sharing across domains (e.g. VMs). Also there are hardware assisted mediated pass-through solutions from platform vendors. e.g. Intel VT-d scalable mode which supports Intel

[RFC v3 3/8] vfio: Reclaim PASIDs when application is down

2020-01-29 Thread Liu, Yi L
From: Liu Yi L When userspace application is down, kernel should reclaim the PASIDs allocated for this application to avoid PASID leak. This patch adds a PASID list in vfio_mm structure to track the allocated PASIDs. The PASID reclaim will be triggered when last vfio container is released

[RFC v1 1/2] vfio/pci: Expose PCIe PASID capability to guest

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch exposes PCIe PASID capability to guest. Existing vfio_pci driver hides it from guest by setting the capability length as 0 in pci_ext_cap_length[]. This capability is required for vSVA enabling on pass-through PCIe devices. Cc: Kevin Tian CC: Jacob Pan Cc: Alex

[RFC v1 2/2] vfio/pci: Emulate PASID/PRI capability for VFs

2020-01-29 Thread Liu, Yi L
From: Liu Yi L Per PCIe r5.0, sec 9.3.7.14, if a PF implements the PASID Capability, the PF PASID configuration is shared by its VFs. VFs must not implement their own PASID Capability. Per PCIe r5.0, sec 9.3.7.11, VFs must not implement the PRI Capability. If the PF implements PRI, it is

[RFC v1 0/2] vfio/pci: expose device's PASID capability to VMs

2020-01-29 Thread Liu, Yi L
ay need to introduce a generic communication framework between vfio-pci driver and PF drivers. Please feel free to give your suggestions on it. Liu Yi L (2): vfio/pci: Expose PCIe PASID capability to guest vfio/pci: Emulate PASID/PRI capability for VFs drivers/vfio/pci/vfio_pci_conf

RE: [PATCH V9 00/10] Nested Shared Virtual Address (SVA) VT-d support

2020-01-29 Thread Liu, Yi L
> From: Jacob Pan [mailto:jacob.jun@linux.intel.com] > Sent: Wednesday, January 29, 2020 2:02 PM > Subject: [PATCH V9 00/10] Nested Shared Virtual Address (SVA) VT-d support > > Shared virtual address (SVA), a.k.a, Shared virtual memory (SVM) on Intel > platforms > allow address space sharing

RE: [RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-01-31 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, January 30, 2020 7:56 AM > To: Liu, Yi L > Subject: Re: [RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > On Wed, 29 Jan 2020 04:11:45 -0800 > "Liu, Yi L"

RE: [RFC v3 3/8] vfio: Reclaim PASIDs when application is down

2020-01-31 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, January 30, 2020 7:57 AM > To: Liu, Yi L > Subject: Re: [RFC v3 3/8] vfio: Reclaim PASIDs when application is down > > On Wed, 29 Jan 2020 04:11:47 -0800 > "Liu, Yi L"

RE: [RFC v3 4/8] vfio/type1: Add VFIO_NESTING_GET_IOMMU_UAPI_VERSION

2020-01-31 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, January 30, 2020 7:57 AM > To: Liu, Yi L > Subject: Re: [RFC v3 4/8] vfio/type1: Add > VFIO_NESTING_GET_IOMMU_UAPI_VERSION > > On Wed, 29 Jan 2020 04:11:48 -0800 > "Liu, Yi L&q

RE: [RFC v3 4/8] vfio/type1: Add VFIO_NESTING_GET_IOMMU_UAPI_VERSION

2020-02-04 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Tuesday, February 4, 2020 2:01 AM > To: Liu, Yi L > Subject: Re: [RFC v3 4/8] vfio/type1: Add > VFIO_NESTING_GET_IOMMU_UAPI_VERSION > > On Fri, 31 Jan 2020 13:04:11 + > "Liu, Yi L" wro

RE: [RFC v3 2/8] vfio/type1: Make per-application (VM) PASID quota tunable

2020-02-04 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, January 30, 2020 7:57 AM > To: Liu, Yi L > Subject: Re: [RFC v3 2/8] vfio/type1: Make per-application (VM) PASID quota > tunable > > On Wed, 29 Jan 2020 04:11:46 -0800 > "Liu, Yi L&q

RE: [RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-02-06 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Friday, January 31, 2020 8:41 PM > To: Alex Williamson > Subject: RE: [RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > Hi Alex, > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Thursday, January

RE: [RFC v1 0/2] vfio/pci: expose device's PASID capability to VMs

2020-02-07 Thread Liu, Yi L
Hi Alex, Any comment on this series? Regards, Yi Liu > From: Liu, Yi L > Sent: Wednesday, January 29, 2020 8:19 PM > To: alex.william...@redhat.com; eric.au...@redhat.com > Subject: [RFC v1 0/2] vfio/pci: expose device's PASID capability to VMs > > Shared Virtual

RE: [RFC v3 2/8] vfio/type1: Make per-application (VM) PASID quota tunable

2020-02-08 Thread Liu, Yi L
Hi Jacob, > From: Jacob Pan [mailto:jacob.jun@linux.intel.com] > Sent: Saturday, February 8, 2020 3:44 AM > To: Liu, Yi L > Subject: Re: [RFC v3 2/8] vfio/type1: Make per-application (VM) PASID quota > tunable > > On Wed, 29 Jan 2020 04:11:46 -0800 > "Liu, Yi L

[RFC Design Doc v3] Enable Shared Virtual Memory feature in pass-through scenarios

2016-11-30 Thread Liu, Yi L
What's changed from v2: a) Detailed feature description b) refine description in "Address translation in virtual SVM" b) "Terms" is added Content === 1. Feature description 2. Why use it? 3. How to enable it 4. How to test 5. Terms Details =

RE: bind pasid table API

2017-09-20 Thread Liu, Yi L
Hi Jean, > -Original Message- > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, September 20, 2017 8:10 PM > To: Pan, Jacob jun ; iommu@lists.linux- > foundation.org > Cc: Liu, Yi L ; Raj, Ashok ; David > Woodhouse ; Joerg R

RE: [PATCH v2 03/16] iommu: introduce iommu invalidate API function

2017-10-11 Thread Liu, Yi L
was calling it iommu_passdown_invalidate() originally. > The invalidation request comes from guest or user space instead of in-kernel > unmap > kind of calls. [Liu, Yi L] I agree that iommu_invalidate() is too generic. Additionally, also better to avoid making it svm specific. The reason we

RE: [PATCH v2 03/16] iommu: introduce iommu invalidate API function

2017-10-11 Thread Liu, Yi L
> On Wed, Oct 11, 2017 at 07:54:32AM +0000, Liu, Yi L wrote: > > I agree that iommu_invalidate() is too generic. Additionally, also > > better to avoid making it svm specific. > > I also don't like to name the functions after the Intel feature, but I failed &g

RE: [PATCH v2 03/16] iommu: introduce iommu invalidate API function

2017-10-12 Thread Liu, Yi L
> -Original Message- > From: Bob Liu [mailto:liub...@huawei.com] > Sent: Thursday, October 12, 2017 5:39 PM > To: Jean-Philippe Brucker ; Joerg Roedel > ; Liu, Yi L > Cc: Lan, Tianyu ; Liu, Yi L ; > Greg > Kroah-Hartman ; Wysocki, Rafael J > ; LKML ; > io

RE: [PATCH v2 03/16] iommu: introduce iommu invalidate API function

2017-10-12 Thread Liu, Yi L
> -Original Message- > From: Bob Liu [mailto:liub...@huawei.com] > Sent: Thursday, October 12, 2017 6:08 PM > To: Liu, Yi L ; Jean-Philippe Brucker philippe.bruc...@arm.com>; Joerg Roedel > Cc: Lan, Tianyu ; Liu, Yi L ; > Greg > Kroah-Hartman ; Wysocki, Raf

RE: [PATCH v2 02/16] iommu/vt-d: add bind_pasid_table function

2017-10-12 Thread Liu, Yi L
> From: Jacob Pan [mailto:jacob.jun@linux.intel.com] > Sent: Friday, October 6, 2017 7:04 AM > To: iommu@lists.linux-foundation.org; LKML ; > Joerg > Roedel ; David Woodhouse ; Greg > Kroah-Hartman ; Wysocki, Rafael J > ; Jean-Philippe Brucker philippe.bruc...@arm.com&g

RE: [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails

2017-10-18 Thread Liu, Yi L
index > f6697e5..43280ca 100644 > --- a/drivers/iommu/intel-svm.c > +++ b/drivers/iommu/intel-svm.c > @@ -292,7 +292,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int > flags, struct svm_dev_ > int pasid_max; > int ret; > > - if (WARN_ON(!iom

RE: [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails

2017-10-19 Thread Liu, Yi L
> -Original Message- > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Friday, October 20, 2017 8:49 AM > To: Liu, Yi L ; j...@8bytes.org; dw...@infradead.org > Cc: iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org > Subject: Re: [PATCH 1/3] i

RE: [PATCH v2 08/16] iommu: introduce device fault data

2017-10-20 Thread Liu, Yi L
gt; > + IOMMU_FAULT_REASON_ACCESS, > > And this a pgd or pte access fault? > > > + IOMMU_FAULT_REASON_INVALIDATE, > > What would this be? > > > + IOMMU_FAULT_REASON_UNKNOWN, > > +}; > > I'm currently doing the same exploratory work for virti

RE: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-10-23 Thread Liu, Yi L
...@google.com; > alex.william...@redhat.com; t...@semihalf.com; liub...@huawei.com; > thunder.leiz...@huawei.com; xieyishe...@huawei.com; > gabriele.paol...@huawei.com; nwatt...@codeaurora.org; ok...@codeaurora.org; > rfr...@cavium.com; dw...@infradead.org; jacob.jun@linux.in

RE: [PATCH v2 08/16] iommu: introduce device fault data

2017-11-07 Thread Liu, Yi L
Hi Jean, Nice to have you "online". This open is really blocking the progress. Pls check inline. > -Original Message- > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Tuesday, November 7, 2017 3:02 AM > To: Liu, Yi L ; Jacob Pan

RE: [PATCH 02/37] iommu/sva: Bind process address spaces to devices

2018-02-28 Thread Liu, Yi L
Hi Jean, > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Thursday, February 15, 2018 8:41 PM > Subject: Re: [PATCH 02/37] iommu/sva: Bind process address spaces to devices > > On 13/02/18 23:34, Tian, Kevin wrote: > >> From: Jean-Philippe Brucker > >> Sent: Tuesday, F

[RFC v3 0/3] vfio_pci: wrap pci device as a mediated device

2019-04-24 Thread Liu, Yi L
chset subject: "vfio/pci: wrap pci device as a mediated device" Liu, Yi L (3): vfio_pci: split vfio_pci.c into two source files vfio/pci: protect cap/ecap_perm bits alloc/free with atomic op smaples: add vfio-mdev-pci driver drivers/vfio/pci/Makefile

[RFC v3 2/3] vfio/pci: protect cap/ecap_perm bits alloc/free with atomic op

2019-04-24 Thread Liu, Yi L
vfio_pci_init_perm_bits() will initialize the bits. While the last caller of vfio_pci_uninit_perm_bits() will free the bits. Cc: Kevin Tian Cc: Lu Baolu Suggested-by: Alex Williamson Signed-off-by: Liu, Yi L --- drivers/vfio/pci/vfio_pci_config.c | 9 + 1 file changed, 9 insertions(+) diff --git a

[RFC v3 1/3] vfio_pci: split vfio_pci.c into two source files

2019-04-24 Thread Liu, Yi L
This patch splits the non-module specific codes from original drivers/vfio/pci/vfio_pci.c into a common.c under drivers/vfio/pci. This is for potential code sharing. e.g. vfio-mdev-pci driver Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu, Yi L --- drivers/vfio/pci/Makefile |2

[RFC v3 3/3] smaples: add vfio-mdev-pci driver

2019-04-24 Thread Liu, Yi L
s/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003 g) destroy mdev > echo 1 > /sys/bus/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003/\ remove Cc: Kevin Tian Cc: Lu Baolu Cc: Masahiro Yamada Suggested-by: Alex Williamson Signed-off-by: Liu, Yi L --- drivers/vfi

RE: [PATCH v2 09/19] iommu/vt-d: Enlightened PASID allocation

2019-04-25 Thread Liu, Yi L
Hi Eric, > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: Thursday, April 25, 2019 1:28 AM > To: Jacob Pan ; > iommu@lists.linux-foundation.org; > Subject: Re: [PATCH v2 09/19] iommu/vt-d: Enlightened PASID allocation > > Hi Jacob, > > On 4/24/19 1:31 AM, Jacob Pan wrote: > > From: Lu

RE: [RFC v3 0/3] vfio_pci: wrap pci device as a mediated device

2019-05-23 Thread Liu, Yi L
Hi Alex, Sorry to disturb you. Do you want to review on this version or review a rebased version? :-) If rebase version is better, I can try to do it asap. Thanks, Yi Liu > -Original Message- > From: Liu, Yi L > Sent: Tuesday, April 23, 2019 8:15 PM > To: alex.william..

RE: [RFC v3 0/3] vfio_pci: wrap pci device as a mediated device

2019-06-09 Thread Liu, Yi L
> From Alex Williamson > Sent: Thursday, May 23, 2019 9:03 PM > To: Liu, Yi L > Cc: kwankh...@nvidia.com; Tian, Kevin ; > baolu...@linux.intel.com; Sun, Yi Y ; j...@8bytes.org; > jean- > philippe.bruc...@arm.com; pet...@redhat.com; linux-ker...@vger.kernel.org; &

RE: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2019-06-14 Thread Liu, Yi L
Hi Eric, > From: Eric Auger [mailto:eric.au...@redhat.com] > Sent: Monday, May 27, 2019 12:10 AM > Subject: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE > > From: "Liu, Yi L" > > When the guest "owns" the stage 1 translation structures, the h

[RFC v1 0/4] vfio: support Shared Virtual Addressing

2019-07-06 Thread Liu, Yi L
Uv3 2 stage VFIO integration by Eric Auger https://lists.sr.ht/~philmd/qemu/%3C20190527114203.2762-1-eric.auger%40redhat.com%3E [6] [RFC PATCH 2/6] drivers core: Add I/O ASID allocator by Jean-Philippe Brucker https://www.spinics.net/lists/iommu/msg30639.html Liu Yi L (4): vfio: VFIO_IOMMU

[RFC v1 1/4] vfio: VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE

2019-07-06 Thread Liu, Yi L
From: Liu Yi L This patch adds VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE ioctl which aims to pass/withdraw the virtual iommu guest configuration to/from the VFIO driver downto to the iommu subsystem. Cc: Kevin Tian Signed-off-by: Jacob Pan Signed-off-by: Liu Yi L Signed-off-by: Eric Auger

[RFC v1 4/4] vfio/type1: bind guest pasid (guest page tables) to host

2019-07-06 Thread Liu, Yi L
From: Liu Yi L This patch adds vfio support to bind guest translation structure to host iommu. VFIO exposes iommu programming capability to user- space. Guest is a user-space application in host under KVM solution. For SVA usage in Virtual Machine, guest owns GVA->GPA translation structure.

[RFC v1 2/4] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2019-07-06 Thread Liu, Yi L
From: Liu Yi L When the guest "owns" the stage 1 translation structures, the host IOMMU driver has no knowledge of caching structure updates unless the guest invalidation requests are trapped and passed down to the host. This patch adds the VFIO_IOMMU_CACHE_INVALIDATE ioctl wi

[RFC v1 3/4] vfio/type1: VFIO_IOMMU_PASID_REQUEST(alloc/free)

2019-07-06 Thread Liu, Yi L
From: Liu Yi L This patch adds VFIO_IOMMU_PASID_REQUEST ioctl which aims to passdown PASID allocation/free request from the virtual iommu. This is required to get PASID managed in system-wide. Cc: Kevin Tian Signed-off-by: Liu Yi L Signed-off-by: Yi Sun Signed-off-by: Jacob Pan --- drivers

RE: [RFC v1 4/4] vfio/type1: bind guest pasid (guest page tables) to host

2019-07-22 Thread Liu, Yi L
> From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: Thursday, July 18, 2019 6:17 PM > To: Liu, Yi L ; alex.william...@redhat.com > Subject: Re: [RFC v1 4/4] vfio/type1: bind guest pasid (guest page tables) to > host > > Yi, > > On 7/5/19 1:06 PM, Liu, Yi

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

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

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

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

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

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

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

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

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

<    1   2   3   4   5   6   >