RE: [RFC PATCH 00/30] Add PCIe SVM support to ARM SMMUv3

2017-03-06 Thread Liu, Yi L
> -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Jean-Philippe Brucker > Sent: Tuesday, February 28, 2017 3:54 AM > Cc: Shanker Donthineni ; k...@vger.kernel.org; > Catalin Marinas ; Sinan Kaya > ; Will

RE: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-21 Thread Liu, Yi L
Hi Jean, I'm working on virtual SVM, and have some comments on the VFIO channel definition. > -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Jean-Philippe Brucker > Sent: Tuesday, February 28, 2017 3:55

RE: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-23 Thread Liu, Yi L
Hi Jean, Thx for the excellent ideas. Pls refer to comments inline. [...] > > Hi Jean, > > > > I'm working on virtual SVM, and have some comments on the VFIO channel > > definition. > > Thanks a lot for the comments, this is quite interesting to me. I just have > some > concerns about portabil

RE: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-24 Thread Liu, Yi L
> -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Jean-Philippe Brucker > Sent: Thursday, March 23, 2017 9:38 PM > To: Liu, Yi L ; Alex Williamson > > Cc: Shanker Donthineni ; k...@vger.kernel.org; > Cata

RE: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-28 Thread Liu, Yi L
> -Original Message- > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Monday, March 27, 2017 6:14 PM > To: Liu, Yi L ; Alex Williamson > > Cc: Shanker Donthineni ; k...@vger.kernel.org; > Catalin Marinas ; Sinan Kaya > ; Will Deac

[RFC PATCH 00/20] Qemu: Extend intel_iommu emulator to support Shared Virtual Memory

2017-04-26 Thread Liu, Yi L
n the proposed invalidate request VIRTIO_IOMMU_T_INVALIDATE. So it may be preferred to have opaque part when doing the iommu tlb invalidate propagation in SVM virtualization. http://www.spinics.net/lists/kvm/msg147993.html Best Wishes, Yi L Liu, Yi L (20): intel_iommu: add "ecs" o

[RFC PATCH 05/20] VFIO: add new IOCTL for svm bind tasks

2017-04-26 Thread Liu, Yi L
ace driver, VFIO_SVM_BIND_PGTABLE is added to support page table bind from guest. https://patchwork.kernel.org/patch/9594231/ Signed-off-by: Liu, Yi L --- linux-headers/linux/vfio.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/li

[RFC PATCH 13/20] IOMMU: add pasid_table_info for guest pasid table

2017-04-26 Thread Liu, Yi L
This patch adds iommu.h to define some generic definition for IOMMU. Here defines "struct pasid_table_info" for guest pasid table bind. Signed-off-by: Liu, Yi L --- linux-headers/linux/iommu.h | 30 ++ 1 file changed, 30 insertions(+) create mode 10

[RFC PATCH 04/20] Memory: modify parameter in IOMMUNotifier func

2017-04-26 Thread Liu, Yi L
This patch modifies parameter of IOMMUNotifier, use "void *data" instead of "IOMMUTLBEntry*". This is to extend it to support notifiers other than MAP/UNMAP. Signed-off-by: Liu, Yi L --- hw/vfio/common.c | 3 ++- hw/virtio/vhost.c | 3 ++- include/exec/memory.h | 2

[RFC PATCH 12/20] Memory: Add func to fire pasidt_bind notifier

2017-04-26 Thread Liu, Yi L
-off-by: Liu, Yi L --- include/exec/memory.h | 11 +++ memory.c | 21 + 2 files changed, 32 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 49087ef..3b8f487 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h

[RFC PATCH 10/20] VFIO: notify vIOMMU emulator when device is assigned

2017-04-26 Thread Liu, Yi L
With vIOMMU exposed to guest, notify vIOMMU emulator to record information of this assigned device. This patch adds iommu_ops->record_device to record the host bus/slot/function for this device. In future, it can be extended to other info which is needed. Signed-off-by: Liu, Yi L --- hw/v

[RFC PATCH 15/20] intel_iommu: link whole guest pasid table to host

2017-04-26 Thread Liu, Yi L
tor should capture it, then link the whole guest PASID table to host and enable nested mode for the assigned device. Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 121 +++-- hw/i386/intel_iommu_internal.h | 11 2 files changed, 127 inserti

[RFC PATCH 08/20] Memory: add notifier flag check in memory_replay()

2017-04-26 Thread Liu, Yi L
: Liu, Yi L --- memory.c | 8 1 file changed, 8 insertions(+) diff --git a/memory.c b/memory.c index 9c253cc..0728e62 100644 --- a/memory.c +++ b/memory.c @@ -1630,6 +1630,14 @@ void memory_region_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n, hwaddr addr, granularity

[RFC PATCH 17/20] Memory: Add func to fire TLB invalidate notifier

2017-04-26 Thread Liu, Yi L
This patch adds a separate function to fire IOMMU TLB invalidate notifier. Signed-off-by: Liu, Yi L --- include/exec/memory.h | 9 + memory.c | 18 ++ 2 files changed, 27 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index

[RFC PATCH 06/20] VFIO: add new notifier for binding PASID table

2017-04-26 Thread Liu, Yi L
n_add would not be triggered. While for the newly added notifier, it requires to be registered once virtual intel_iommu is exposed to guest. Signed-off-by: Liu, Yi L --- hw/vfio/common.c | 37 +++--- hw/vfio/pci.c | 53 ++

[RFC PATCH 07/20] VFIO: check notifier flag in region_del()

2017-04-26 Thread Liu, Yi L
e bind notifier is needed. The newly added pasid table bind notifier would be unregistered in the vfio_disconnect_container(). The link below would direct you to Peter's dynamic switch patch. https://www.mail-archive.com/qemu-devel@nongnu.org/msg62.html Signed-off-by: Liu, Yi L --- hw/vf

[RFC PATCH 02/20] intel_iommu: exposed extended-context mode to guest

2017-04-26 Thread Liu, Yi L
y SVM capable device. Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 131 +++-- hw/i386/intel_iommu_internal.h | 9 +++ include/hw/i386/intel_iommu.h | 2 +- 3 files changed, 97 insertions(+), 45 deletions(-) diff --git a/hw/i386/int

[RFC PATCH 16/20] VFIO: Add notifier for propagating IOMMU TLB invalidate

2017-04-26 Thread Liu, Yi L
to introduce this new notifier to meet the SVM virtualization requirement. Further detail would be included in the patch below: "intel_iommu: propagate Extended-IOTLB invalidate to host" Signed-off-by: Liu, Yi L --- hw/vfio/pci.c | 37 +

[RFC PATCH 14/20] intel_iommu: add FOR_EACH_ASSIGN_DEVICE macro

2017-04-26 Thread Liu, Yi L
Add FOR_EACH_ASSIGN_DEVICE. It would be used to loop all assigned devices when processing guest pasid table linking and iommu cache invalidate propagation. Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 32 hw/i386/intel_iommu_internal.h | 11

[RFC PATCH 09/20] Memory: introduce iommu_ops->record_device

2017-04-26 Thread Liu, Yi L
ify vIOMMU emulator to record necessary information about the assigned device. Signed-off-by: Liu, Yi L --- include/exec/memory.h | 11 +++ memory.c | 12 2 files changed, 23 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 7bd1

[RFC PATCH 11/20] intel_iommu: provide iommu_ops->record_device

2017-04-26 Thread Liu, Yi L
This patch provides iommu_ops->record_device implementation for intel_iommu. It records the host sid in the IntelIOMMUNotifierNode for further virtualization usage. e.g. guest sid -> host sid translation during propagating 1st level cache invalidation from guest to host. Signed-off-by: Liu

[RFC PATCH 20/20] intel_iommu: propagate Ext-Device-TLB invalidate to host

2017-04-26 Thread Liu, Yi L
in pIOMMU. In future maybe PASID needs to be replaced. Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 43 ++ hw/i386/intel_iommu_internal.h | 7 +++ 2 files changed, 50 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386

[RFC PATCH 01/20] intel_iommu: add "ecs" option

2017-04-26 Thread Liu, Yi L
Report ecap.ECS=1 to guest by "-deivce intel-iommu, ecs=on" in QEMU Cmd Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 5 + hw/i386/intel_iommu_internal.h | 1 + include/hw/i386/intel_iommu.h | 1 + 3 files changed, 7 insertions(+) diff --git a/hw/i386/intel_io

[RFC PATCH 03/20] intel_iommu: add "svm" option

2017-04-26 Thread Liu, Yi L
Expose "Shared Virtual Memory" to guest by using "svm" option. Also use "svm" to expose SVM related capabilities to guest. e.g. "-device intel-iommu, svm=on" Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 10 ++ hw/i386/intel_iomm

[RFC PATCH 6/8] VFIO: do pasid table binding

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" This patch adds IOCTL processing in vfio_iommu_type1 for VFIO_IOMMU_SVM_BIND_TASK. Binds the PASID table bind by calling iommu_ops->bind_pasid_table to link the whole PASID table to pIOMMU. For VT-d, it is linking the guest PASID table to host pIOMMU. This is

[RFC PATCH 0/8] Shared Virtual Memory virtualization for VT-d

2017-04-26 Thread Liu, Yi L
do invalidate function Liu, Yi L (5): iommu: Introduce iommu do invalidate API function VFIO: Add new IOTCL for PASID Table bind propagation VFIO: do pasid table binding VFIO: Add new IOCTL for IOMMU TLB invalidate propagation VFIO: do IOMMU TLB invalidation from guest drivers/iommu/

[RFC PATCH 3/8] iommu: Introduce iommu do invalidate API function

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" When a SVM capable device is assigned to a guest, the first level page tables are owned by the guest and the guest PASID table pointer is linked to the device context entry of the physical IOMMU. Host IOMMU driver has no knowledge of caching structure updates unless

[RFC PATCH 5/8] VFIO: Add new IOTCL for PASID Table bind propagation

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" This patch adds VFIO_IOMMU_SVM_BIND_TASK for potential PASID table binding requests. On VT-d, this IOCTL cmd would be used to link the guest PASID page table to host. While for other vendors, it may also be used to support other kind of SVM bind request. Previously,

[RFC PATCH 2/8] iommu/vt-d: add bind_pasid_table function

2017-04-26 Thread Liu, Yi L
, Yi L --- drivers/iommu/intel-iommu.c | 103 ++ include/linux/dma_remapping.h | 1 + 2 files changed, 104 insertions(+) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 646756c..6d5b939 100644 --- a/drivers/iommu/intel

[RFC PATCH 4/8] iommu/vt-d: Add iommu do invalidate function

2017-04-26 Thread Liu, Yi L
to the physical IOMMU. The assumption is that guest to host device ID mapping should be resolved prior to calling IOMMU driver. Based on the device handle, host IOMMU driver can replace certain fields before submit to the invalidation queue. Signed-off-by: Liu, Yi L Signed-off-by: Jacob Pan

[RFC PATCH 19/20] intel_iommu: propagate PASID-Cache invalidate to host

2017-04-26 Thread Liu, Yi L
submitting to pIOMMU. e.g. guest domain ID must be replaced with the real domain ID in host. In future PASID may need to be replaced. Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 56 ++ hw/i386/intel_iommu_internal.h | 10 2 files changed

[RFC PATCH 8/8] VFIO: do IOMMU TLB invalidation from guest

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" This patch adds support for VFIO_IOMMU_TLB_INVALIDATE cmd in vfio_iommu_type1. For SVM virtualization on VT-d, for VFIO_IOMMU_TLB_INVALIDATE, it calls iommu_ops->do_invalidate() to submit the guest iommu cache invalidation to pIOMMU. Signed-off-by: Liu, Yi L

[RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" This patch adds VFIO_IOMMU_TLB_INVALIDATE to propagate IOMMU TLB invalidate request from guest to host. In the case of SVM virtualization on VT-d, host IOMMU driver has no knowledge of caching structure updates unless the guest invalidation activities are passed d

[RFC PATCH 18/20] intel_iommu: propagate Extended-IOTLB invalidate to host

2017-04-26 Thread Liu, Yi L
future PASID may also need to be replaced. Signed-off-by: Liu, Yi L --- hw/i386/intel_iommu.c | 126 + hw/i386/intel_iommu_internal.h | 33 +++ 2 files changed, 159 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index

[RFC PATCH 1/8] iommu: Introduce bind_pasid_table API function

2017-04-26 Thread Liu, Yi L
inding pasid table of assigned devices. This patch also adds model definition in iommu.h. It would be used to check if the bind request is from a compatible entity. e.g. a bind request from an intel_iommu emulator may not be supported by an ARM SMMU driver. Signed-off-by: Jacob Pan Signed-off-by: Liu

Re: [Qemu-devel] [RFC PATCH 12/20] Memory: Add func to fire pasidt_bind notifier

2017-04-26 Thread Liu, Yi L
On Wed, Apr 26, 2017 at 03:50:16PM +0200, Paolo Bonzini wrote: > > > On 26/04/2017 12:06, Liu, Yi L wrote: > > +void memory_region_notify_iommu_svm_bind(MemoryRegion *mr, > > + void *data) > > +{ > > +

Re: [Qemu-devel] [RFC PATCH 5/8] VFIO: Add new IOTCL for PASID Table bind propagation

2017-04-26 Thread Liu, Yi L
On Wed, Apr 26, 2017 at 05:56:50PM +0100, Jean-Philippe Brucker wrote: > On 26/04/17 11:12, Liu, Yi L wrote: > > From: "Liu, Yi L" > > > > This patch adds VFIO_IOMMU_SVM_BIND_TASK for potential PASID table > > binding requests. > > > > On VT-

Re: [RFC PATCH 1/8] iommu: Introduce bind_pasid_table API function

2017-04-26 Thread Liu, Yi L
On Wed, Apr 26, 2017 at 05:56:45PM +0100, Jean-Philippe Brucker wrote: > Hi Yi, Jacob, > > On 26/04/17 11:11, Liu, Yi L wrote: > > From: Jacob Pan > > > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) use > > case in the guest: > >

Re: [Qemu-devel] [RFC PATCH 12/20] Memory: Add func to fire pasidt_bind notifier

2017-04-27 Thread Liu, Yi L
On Thu, Apr 27, 2017 at 02:14:27PM +0800, Peter Xu wrote: > On Thu, Apr 27, 2017 at 10:37:19AM +0800, Liu, Yi L wrote: > > On Wed, Apr 26, 2017 at 03:50:16PM +0200, Paolo Bonzini wrote: > > > > > > > > > On 26/04/2017 12:06, Liu, Yi L wrote: > > >

Re: [Qemu-devel] [RFC PATCH 1/8] iommu: Introduce bind_pasid_table API function

2017-04-28 Thread Liu, Yi L
On Thu, Apr 27, 2017 at 11:12:45AM +0100, Jean-Philippe Brucker wrote: > On 27/04/17 07:36, Liu, Yi L wrote: > > On Wed, Apr 26, 2017 at 05:56:45PM +0100, Jean-Philippe Brucker wrote: > >> Hi Yi, Jacob, > >> > >> On 26/04/17 11:11, Liu, Yi L wrote: > >>

Re: [Qemu-devel] [RFC PATCH 1/8] iommu: Introduce bind_pasid_table API function

2017-04-28 Thread Liu, Yi L
On Wed, Apr 26, 2017 at 05:56:45PM +0100, Jean-Philippe Brucker wrote: > Hi Yi, Jacob, > > On 26/04/17 11:11, Liu, Yi L wrote: > > From: Jacob Pan > > > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) use > > case in the guest: > >

Re: [Qemu-devel] [RFC PATCH 02/20] intel_iommu: exposed extended-context mode to guest

2017-04-28 Thread Liu, Yi L
On Thu, Apr 27, 2017 at 06:32:21PM +0800, Peter Xu wrote: > On Wed, Apr 26, 2017 at 06:06:32PM +0800, Liu, Yi L wrote: > > VT-d implementations reporting PASID or PRS fields as "Set", must also > > report ecap.ECS as "Set". Extended-Context is required for SVM. &

Re: [RFC PATCH 02/20] intel_iommu: exposed extended-context mode to guest

2017-04-28 Thread Liu, Yi L
On Fri, Apr 28, 2017 at 02:00:15PM +0800, Lan Tianyu wrote: > On 2017年04月27日 18:32, Peter Xu wrote: > > On Wed, Apr 26, 2017 at 06:06:32PM +0800, Liu, Yi L wrote: > >> VT-d implementations reporting PASID or PRS fields as "Set", must also > >> report ecap.ECS a

Re: [Qemu-devel] [RFC PATCH 0/8] Shared Virtual Memory virtualization for VT-d

2017-05-08 Thread Liu, Yi L
ntain the TLB. Be free to let me know if you want more detail. Thanks, Yi L > > Thanks! > > On 04/26/2017 06:11 PM, Liu, Yi L wrote: > >Hi, > > > >This patchset introduces SVM virtualization for intel_iommu in > >IOMMU/VFIO. The total SVM virtualization for

RE: [RFC PATCH 03/20] intel_iommu: add "svm" option

2017-05-08 Thread Liu, Yi L
On Thu, 27 Apr 2017 18:53:17 +0800 Peter Xu wrote: > On Wed, Apr 26, 2017 at 06:06:33PM +0800, Liu, Yi L wrote: > > Expose "Shared Virtual Memory" to guest by using "svm" option. > > Also use "svm" to expose SVM related capabilities to guest. > >

Re: [Qemu-devel] [RFC PATCH 03/20] intel_iommu: add "svm" option

2017-05-09 Thread Liu, Yi L
On Mon, May 08, 2017 at 07:20:34PM +0800, Peter Xu wrote: > On Mon, May 08, 2017 at 10:38:09AM +0000, Liu, Yi L wrote: > > On Thu, 27 Apr 2017 18:53:17 +0800 > > Peter Xu wrote: > > > > > On Wed, Apr 26, 2017 at 06:06:33PM +0800, Liu, Yi L wrote: > > > &g

Re: [Qemu-devel] [RFC PATCH 5/8] VFIO: Add new IOTCL for PASID Table bind propagation

2017-05-12 Thread Liu, Yi L
On Wed, Apr 26, 2017 at 06:12:02PM +0800, Liu, Yi L wrote: > From: "Liu, Yi L" Hi Alex, In this patchset, I'm trying to add two new IOCTL cmd for Shared Virtual Memory virtualization. One for binding guest PASID Table and one for iommu tlb invalidation from guest. ARM has simi

Re: [Qemu-devel] [RFC PATCH 6/8] VFIO: do pasid table binding

2017-05-12 Thread Liu, Yi L
On Tue, May 09, 2017 at 03:55:20PM +0800, Xiao Guangrong wrote: > > > On 04/26/2017 06:12 PM, Liu, Yi L wrote: > >From: "Liu, Yi L" > > > >This patch adds IOCTL processing in vfio_iommu_type1 for > >VFIO_IOMMU_SVM_BIND_TASK. Binds the PASID table bin

Re: [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-05-15 Thread Liu, Yi L
On Fri, May 12, 2017 at 01:11:02PM +0100, Jean-Philippe Brucker wrote: > Hi Yi, > > On 26/04/17 11:12, Liu, Yi L wrote: > > From: "Liu, Yi L" > > > > This patch adds VFIO_IOMMU_TLB_INVALIDATE to propagate IOMMU TLB > > invalidate request from

Re: [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-05-15 Thread Liu, Yi L
On Fri, May 12, 2017 at 03:58:43PM -0600, Alex Williamson wrote: > On Wed, 26 Apr 2017 18:12:04 +0800 > "Liu, Yi L" wrote: > > > From: "Liu, Yi L" > > > > This patch adds VFIO_IOMMU_TLB_INVALIDATE to propagate IOMMU TLB > > invalidate re

Re: [RFC PATCH 1/8] iommu: Introduce bind_pasid_table API function

2017-05-15 Thread Liu, Yi L
On Fri, May 12, 2017 at 03:59:14PM -0600, Alex Williamson wrote: > On Wed, 26 Apr 2017 18:11:58 +0800 > "Liu, Yi L" wrote: > > > From: Jacob Pan > > > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) use > > case in the guest:

Re: [RFC PATCH 3/8] iommu: Introduce iommu do invalidate API function

2017-05-18 Thread Liu, Yi L
On Fri, May 12, 2017 at 03:59:24PM -0600, Alex Williamson wrote: > On Wed, 26 Apr 2017 18:12:00 +0800 > "Liu, Yi L" wrote: > Hi Alex, Pls refer to the open I mentioned in this email, I need your comments on it to prepare the formal patchset for SVM virtualization. Thx. &

Re: [RFC PATCH 4/8] iommu/vt-d: Add iommu do invalidate function

2017-05-18 Thread Liu, Yi L
On Fri, May 12, 2017 at 03:59:18PM -0600, Alex Williamson wrote: > On Wed, 26 Apr 2017 18:12:01 +0800 > "Liu, Yi L" wrote: > > > From: Jacob Pan > > > > This patch adds Intel VT-d specific function to implement > > iommu_do_invalidate API. >

Re: [Qemu-devel] [RFC PATCH 5/8] VFIO: Add new IOTCL for PASID Table bind propagation

2017-05-18 Thread Liu, Yi L
On Fri, May 12, 2017 at 03:58:51PM -0600, Alex Williamson wrote: > On Wed, 26 Apr 2017 18:12:02 +0800 > "Liu, Yi L" wrote: > > > From: "Liu, Yi L" > > > > This patch adds VFIO_IOMMU_SVM_BIND_TASK for potential PASID table > > binding reques

Re: [Qemu-devel] [RFC PATCH 09/20] Memory: introduce iommu_ops->record_device

2017-05-18 Thread Liu, Yi L
Hi Alex, What's your opinion with Tianyu's question? Is it accepatable to use VFIO API in intel_iommu emulator? Thanks, Yi L On Fri, Apr 28, 2017 at 02:46:16PM +0800, Lan Tianyu wrote: > On 2017年04月26日 18:06, Liu, Yi L wrote: > > With vIOMMU exposed to guest, vIOMMU e

Re: [Qemu-devel] [RFC PATCH 09/20] Memory: introduce iommu_ops->record_device

2017-05-19 Thread Liu, Yi L
On Fri, May 19, 2017 at 09:07:49AM +, Tian, Kevin wrote: > > From: Liu, Yi L [mailto:yi.l@linux.intel.com] > > Sent: Friday, May 19, 2017 1:24 PM > > > > Hi Alex, > > > > What's your opinion with Tianyu's question? Is it accepatable > &g

Re: [Qemu-devel] [RFC PATCH 1/8] iommu: Introduce bind_pasid_table API function

2017-05-23 Thread Liu, Yi L
On Fri, Apr 28, 2017 at 01:51:42PM +0100, Jean-Philippe Brucker wrote: > On 28/04/17 10:04, Liu, Yi L wrote: Hi Jean, Sorry for the delay response. Still have some follow-up comments on per-device or per-group. Pls refer to comments inline. > > On Wed, Apr 26, 2017 at 05:56:45PM +0

Re: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-03 Thread Liu, Yi L
ant VFIO engae too much on the data parsing. If we move the scope,flags,pasid,vaddr,size fields to vfio_iommu_tlb_invalidate, then both kernel space vfio and user space vfio needs to do much parsing. So I may prefer the way above. If you've got any other idea, pls feel free to post it. It'

Re: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-04 Thread Liu, Yi L
Hi Jean, On Mon, Jul 03, 2017 at 12:52:52PM +0100, Jean-Philippe Brucker wrote: > Hi Yi, > > On 02/07/17 11:06, Liu, Yi L wrote: > > On Fri, May 12, 2017 at 01:11:02PM +0100, Jean-Philippe Brucker wrote: > > > > Hi Jean, > > > > As we've got

RE: Support SVM without PASID

2017-07-09 Thread Liu, Yi L
> -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of valmiki > Sent: Sunday, July 9, 2017 11:16 AM > To: Alex Williamson > Cc: Lan, Tianyu ; Tian, Kevin ; > k...@vger.kernel.org; linux-...@vger.kernel.org;

RE: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-14 Thread Liu, Yi L
t; From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, July 6, 2017 1:28 AM > To: Jean-Philippe Brucker > Cc: Tian, Kevin ; Liu, Yi L ; > Lan, > Tianyu ; Liu, Yi L ; Raj, Ashok > ; k...@vger.kernel.org; jasow...@redhat.com; Will Deacon > ; pet...@redhat.co

RE: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-17 Thread Liu, Yi L
Hi Alex, Pls refer to the response inline. > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Alex Williamson > Sent: Saturday, July 15, 2017 2:16 AM > To: Liu, Yi L > Cc: Jean-Philippe Brucker ; Tian, Kevin &

Re: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-19 Thread Liu, Yi L
On Mon, Jul 17, 2017 at 04:45:15PM -0600, Alex Williamson wrote: > On Mon, 17 Jul 2017 10:58:41 + > "Liu, Yi L" wrote: > > > Hi Alex, > > > > Pls refer to the response inline. > > > > > -Original Message- > > > From: kv

RE: [PATCH 1/1] iommu/vtd: Fix NULL pointer dereference in prq_event_thread()

2018-11-04 Thread Liu, Yi L
Hi Baolu, > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Lu Baolu > Sent: Monday, November 5, 2018 10:19 AM > To: Joerg Roedel ; David Woodhouse > Cc: Raj, Ashok ; linux-ker...@vger.kernel.org; > iommu@lists.linux-foundation.org

RE: [PATCH 1/1] iommu/vtd: Fix NULL pointer dereference in prq_event_thread()

2018-11-04 Thread Liu, Yi L
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Monday, November 5, 2018 1:45 PM > To: Liu, Yi L ; Joerg Roedel ; David > Woodhouse > Cc: baolu...@linux.intel.com; Raj, Ashok ; linux- > ker...@vger.kernel.org; iommu@lists.linux-foundation.org > Subject: Re: [PATC

RE: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-11-06 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Monday, November 5, 2018 1:32 PM [...] > --- > drivers/iommu/dmar.c| 83 +++-- > drivers/iommu/intel-svm.c | 76 -- > drivers/iommu/intel_irq_remapping.

RE: [PATCH v4 05/12] iommu/vt-d: Reserve a domain id for FL and PT modes

2018-11-06 Thread Liu, Yi L
id for first-level and pass-through > translations. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Cc: Sanjay Kumar > Signed-off-by: Lu Baolu > --- > drivers/iommu/intel-iommu.c | 10 ++ > drivers/iommu/intel-pasid.h | 6 ++ > 2 files

RE: [PATCH v4 06/12] iommu/vt-d: Add second level page table interface

2018-11-06 Thread Liu, Yi L
through. A little bit refining to the description:) "This patch adds interfaces for setup or tear down second level translation in PASID granularity. Translation type includes second level only type and pass-through type." > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian &g

RE: [PATCH v4 08/12] iommu/vt-d: Pass pasid table to context mapping

2018-11-06 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Monday, November 5, 2018 1:32 PM > Subject: [PATCH v4 08/12] iommu/vt-d: Pass pasid table to context mapping > > So that the pasid related info, such as the pasid table and the > maximum of pasid could be used during setting up

RE: [PATCH v4 10/12] iommu/vt-d: Add first level page table interface

2018-11-06 Thread Liu, Yi L
e PASID entries for first. :) > level page table translation. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Signed-off-by: Sanjay Kumar > Signed-off-by: Lu Baolu > Reviewed-by: Ashok Raj > --- > drivers/iommu/intel-pasid.c | 81 ++

RE: [PATCH v4 03/12] iommu/vt-d: Move page table helpers into header

2018-11-06 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Monday, November 5, 2018 1:32 PM > Subject: [PATCH v4 03/12] iommu/vt-d: Move page table helpers into header > > So that they could also be used in other source files. Just a refine. :) "This patch moves page table helpers to h

RE: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-11-07 Thread Liu, Yi L
Hi, > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Thursday, November 8, 2018 10:17 AM > Subject: Re: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor > support > > Hi Yi, > > On 11/7/18 2:07 PM, Liu, Yi L wrote: > > Hi Baolu, > &g

RE: [PATCH v4 06/12] iommu/vt-d: Add second level page table interface

2018-11-07 Thread Liu, Yi L
Hi, > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Thursday, November 8, 2018 10:28 AM > Subject: Re: [PATCH v4 06/12] iommu/vt-d: Add second level page table > interface > > Hi, > > On 11/7/18 3:13 PM, Liu, Yi L wrote: > > Hi Baolu, > &g

RE: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-11-07 Thread Liu, Yi L
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Thursday, November 8, 2018 1:25 PM > Subject: Re: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor > support > > Hi, > > On 11/8/18 11:49 AM, Liu, Yi L wrote: > > Hi, > &g

RE: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-11-07 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Thursday, November 8, 2018 1:45 PM > > >>>> + memcpy(desc, qi->desc + (wait_index << shift), > > >>> > > >>> Would "memcpy(desc, (unsigned long long) (qi->desc + (wait_index >

RE: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-11-07 Thread Liu, Yi L
Hi, > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Thursday, November 8, 2018 2:14 PM > > Hi, > > On 11/8/18 1:45 PM, Liu, Yi L wrote: > >> From: Lu Baolu [mailto:baolu...@linux.intel.com] > >> Sent: Thursday, November 8, 2018 1:25 PM > >

RE: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-11-08 Thread Liu, Yi L
Hi, > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Friday, November 9, 2018 9:40 AM > Subject: Re: [PATCH v4 04/12] iommu/vt-d: Add 256-bit invalidation descriptor > support > > Hi, > > On 11/8/18 3:20 PM, Liu, Yi L wrote: > > Hi, > &g

RE: [RFC] iommu/vt-d: Group and domain relationship

2018-11-08 Thread Liu, Yi L
Hi James, Regards to the relationship of iommu group and domain, the blog written by Alex may help you. The blog explained very well on how iommu group is determined and why. http://vfio.blogspot.com/2014/08/iommu-groups-inside-and-out.html > From: iommu-boun...@lists.linux-foundation.org [mailt

RE: [PATCH v2 1/1] iommu/vtd: Cleanup dma_remapping.h header

2018-11-11 Thread Liu, Yi L
Suggested-by: Christoph Hellwig > Signed-off-by: Lu Baolu > Reviewed-by: Christoph Hellwig > --- Reviewed-by: Liu, Yi L Just out of curious, did you considered to modify the original file name to be an intel specific file name? What makes you believe merging

RE: [PATCH v5 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-12-03 Thread Liu, Yi L
Hi Joerg, > From: Joerg Roedel [mailto:j...@8bytes.org] > Sent: Monday, December 3, 2018 5:49 AM > To: Lu Baolu > Subject: Re: [PATCH v5 04/12] iommu/vt-d: Add 256-bit invalidation descriptor > support > > On Wed, Nov 28, 2018 at 11:54:41AM +0800, Lu Baolu wrote: > > - > > - desc_page = alloc_

RE: [PATCH v5 02/12] iommu/vt-d: Manage scalalble mode PASID tables

2018-12-03 Thread Liu, Yi L
Hi Joerg, > From: Joerg Roedel [mailto:j...@8bytes.org] > Sent: Monday, December 3, 2018 5:44 AM > To: Lu Baolu > Subject: Re: [PATCH v5 02/12] iommu/vt-d: Manage scalalble mode PASID tables > > Hi Baolu, > > On Wed, Nov 28, 2018 at 11:54:39AM +0800, Lu Baolu wrote: > > @@ -2482,12 +2482,13 @@

RE: [RFC PATCH 1/5] iommu: Add APIs for IOMMU PASID management

2018-12-15 Thread Liu, Yi L
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Sunday, November 11, 2018 10:45 PM > Subject: [RFC PATCH 1/5] iommu: Add APIs for IOMMU PASID management > > This adds APIs for IOMMU drivers and device drivers to manage the PASIDs used > for > DMA transfer and translation. It bases on I

RE: [PATCH v6 0/9] vfio/mdev: IOMMU aware mediated device

2019-02-19 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Friday, February 15, 2019 4:15 AM > To: Lu Baolu > Subject: Re: [PATCH v6 0/9] vfio/mdev: IOMMU aware mediated device > > On Wed, 13 Feb 2019 12:02:52 +0800 > Lu Baolu wrote: > > > Hi, > > > > The Mediate Device is a framework

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

2020-02-17 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) > > > +static int vfio_iommu_type1_pasid_free(struct vfio_iommu *iommu, > > > +

RE: [PATCH V9 06/10] iommu/vt-d: Add svm/sva invalidate function

2020-02-20 Thread Liu, Yi L
e invalidation queue. > > Signed-off-by: Jacob Pan > Signed-off-by: Ashok Raj > Signed-off-by: Liu, Yi L May be update my email to Liu Yi L :-) @linux.intel.com account no more work for me. :-( > --- > drivers/iommu/intel-iommu.c | 173 > +++

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

2020-03-22 Thread Liu, Yi L
From: Liu Yi L For VFIO IOMMUs with the 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 propagated t

[PATCH v1 4/8] vfio: Check nesting iommu uAPI version

2020-03-22 Thread Liu, Yi L
From: Liu Yi L In Linux Kernel, the IOMMU nesting translation (a.k.a dual stage address 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

[PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to userspace

2020-03-22 Thread Liu, Yi L
From: Liu Yi L VFIO exposes IOMMU nesting translation (a.k.a dual stage translation) capability to userspace. Thus applications like QEMU could support vIOMMU with hardware's nesting translation capability for pass-through devices. Before setting up nesting translation for pass-through de

[PATCH v1 8/8] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-03-22 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

[PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-22 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

[PATCH v1 6/8] vfio/type1: Bind guest page tables to host

2020-03-22 Thread Liu, Yi L
From: Liu Yi L VFIO_TYPE1_NESTING_IOMMU is an IOMMU type which is backed by hardware IOMMUs that have nesting DMA translation (a.k.a dual stage address translation). For such hardware IOMMUs, there are two stages/levels of address translation, and software may let userspace/VM to own the first

[PATCH v1 0/8] vfio: expose virtual Shared Virtual Addressing to VMs

2020-03-22 Thread Liu, Yi L
From: Liu Yi L Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on Intel platforms allows address space sharing between device DMA and applications. SVA can reduce programming complexity and enhance security. This VFIO series is intended to expose SVA usage to VMs. i.e

[PATCH v1 2/8] vfio/type1: Add vfio_iommu_type1 parameter for quota tuning

2020-03-22 Thread Liu, Yi L
From: Liu Yi L This patch adds a module option to make the PASID quota tunable by administrator. TODO: needs to think more on how to make the tuning to be per-process. Previous discussions: https://patchwork.kernel.org/patch/11209429/ Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc

[PATCH v1 3/8] vfio/type1: Report PASID alloc/free support to userspace

2020-03-22 Thread Liu, Yi L
From: Liu Yi L This patch reports PASID alloc/free availability to userspace (e.g. QEMU) thus userspace could do a pre-check before utilizing this feature. Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Signed-off-by: Liu Yi L --- drivers/vfio

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

2020-03-22 Thread Liu, Yi L
From: Liu Yi L Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on Intel platforms allows address space sharing between device DMA and applications. SVA can reduce programming complexity and enhance security. To enable SVA, device needs to have PASID capability, which is a

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

2020-03-22 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

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

2020-03-22 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

RE: [PATCH v1 0/8] vfio: expose virtual Shared Virtual Addressing to VMs

2020-03-26 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Sunday, March 22, 2020 8:32 PM > To: alex.william...@redhat.com; eric.au...@redhat.com > Subject: [PATCH v1 0/8] vfio: expose virtual Shared Virtual Addressing to VMs > > From: Liu Yi L > > Shared Virtual Addressing (SVA), a.k.a, Shared Virtual

RE: [PATCH v1 2/8] vfio/type1: Add vfio_iommu_type1 parameter for quota tuning

2020-03-30 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Monday, March 30, 2020 4:41 PM > To: Liu, Yi L ; alex.william...@redhat.com; > Subject: RE: [PATCH v1 2/8] vfio/type1: Add vfio_iommu_type1 parameter for > quota > tuning > > > From: Liu, Yi L > > Sent: Sunday, March 22, 20

RE: [PATCH v1 2/8] vfio/type1: Add vfio_iommu_type1 parameter for quota tuning

2020-03-30 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Monday, March 30, 2020 5:20 PM > To: Liu, Yi L ; alex.william...@redhat.com; > Subject: RE: [PATCH v1 2/8] vfio/type1: Add vfio_iommu_type1 parameter for > quota > tuning > > > From: Liu, Yi L > > Sent: Monday, March 30, 2020 4:

  1   2   3   4   5   6   >