Re: [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor

2017-02-20 Thread Liu, Yi L
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Monday, February 20, 2017 5:04 PM > To: Liu, Yi L <yi.l@intel.com>; Michael S. Tsirkin <m...@redhat.com>; > qemu- > de...@nongnu.org > Cc: Lan, Tianyu <tianyu@int

Re: [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor

2017-02-16 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, February 17, 2017 11:26 AM > To: Liu, Yi L <yi.l@intel.com> > Cc: Michael S. Tsirkin <m...@redhat.com>; qemu-devel@nongnu.org; Peter > Maydell <peter.mayd...@lina

Re: [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor

2017-02-16 Thread Liu, Yi L
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Thursday, February 16, 2017 1:44 PM > To: Liu, Yi L <yi.l@intel.com>; Michael S. Tsirkin <m...@redhat.com>; > qemu- > de...@nongnu.org > Cc: Peter Maydell <peter.mayd...@l

Re: [Qemu-devel] [PATCH v7 00/17] VT-d: vfio enablement and misc enhances

2017-02-20 Thread Liu, Yi L
> -Original Message- > From: Qemu-devel [mailto:qemu-devel-bounces+yi.l.liu=intel@nongnu.org] > On Behalf Of Peter Xu > Sent: Monday, February 20, 2017 3:48 PM > To: Alex Williamson > Cc: Lan, Tianyu ; Tian, Kevin

Re: [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor

2017-02-20 Thread Liu, Yi L
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Friday, February 17, 2017 2:43 PM > To: Liu, Yi L <yi.l@intel.com>; Michael S. Tsirkin <m...@redhat.com>; > qemu- > de...@nongnu.org > Cc: Peter Maydell <peter.mayd...@l

Re: [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor

2017-02-20 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, February 17, 2017 3:00 PM > To: Liu, Yi L <yi.l@intel.com> > Cc: Michael S. Tsirkin <m...@redhat.com>; qemu-devel@nongnu.org; Peter > Maydell <peter.mayd...@lina

Re: [Qemu-devel] [PATCH RFC v3 14/14] intel_iommu: enable vfio devices

2017-01-18 Thread Liu, Yi L
> -Original Message- > From: Qemu-devel [mailto:qemu-devel-bounces+yi.l.liu=intel@nongnu.org] > On Behalf Of Tian, Kevin > Sent: Wednesday, January 18, 2017 5:39 PM > To: Peter Xu ; Jason Wang > Cc: Lan, Tianyu ; Raj, Ashok

[Qemu-devel] [RFC Design Doc v2] Enable Shared Virtual Memory feature in pass-through scenarios

2016-11-18 Thread Liu, Yi L
What's changed from v1: a) Solution changed: Switch to extend the existing QEMU vIOMMU emulator to support virtual SVM for pass-through devices. Take use of VFIO to do data propagation. b) A SVM Virtualization Architecture diagram is added. Content

[Qemu-devel] Potential Bug in vIOMMU which may result in memory wasting

2016-10-11 Thread Liu, Yi L
Hi, Apologize for failing to make this email in short. Log is too long. If the following statements failed to make me understood, you are welcomed to ping me. 1. Problem description: Recently, I find a strange thing with vIOMMU in QEMU. It looks like g_hash_table_lookup() is not 100% give same

[Qemu-devel] Potential Bug in vIOMMU which may result in memory wasting

2016-10-11 Thread Liu, Yi L
Hi, Resend it here since there is code style issue with debug patch in previous email. 1. Problem description: Recently, I find a strange thing with vIOMMU in QEMU. It looks like g_hash_table_lookup() is not 100% give same result when the key is the same. And this results in redundant memory

Re: [Qemu-devel] [RFC PATCH 01/13] intel_iommu: allocate new key when creating new address space

2016-12-13 Thread Liu, Yi L
On Tue, Dec 06, 2016 at 06:36:16PM +0800, Peter Xu wrote: > From: Jason Wang > > We use the pointer to stack for key for new address space, this will > break hash table searching, fixing by g_malloc() a new key instead. > > Cc: Michael S. Tsirkin > Cc:

Re: [Qemu-devel] [RFC PATCH 01/13] intel_iommu: allocate new key when creating new address space

2016-12-13 Thread Liu, Yi L
> -Original Message- > From: Qemu-devel [mailto:qemu-devel-bounces+yi.l.liu=intel@nongnu.org] On > Behalf Of Peter Xu > Sent: Wednesday, December 14, 2016 11:06 AM > To: Liu, Yi L <yi.l@linux.intel.com>; Jason Wang <jasow...@redhat.com> > Cc: Lan

Re: [Qemu-devel] [PATCH v7 3/5] IOMMU: enable intel_iommu map and unmap notifiers

2016-12-16 Thread Liu, Yi L
> From: "Aviv Ben-David" > > Adds a list of registered vtd_as's to intel iommu state to save > iteration over each PCI device in a search of the corrosponding domain. > > Signed-off-by: Aviv Ben-David > --- > hw/i386/intel_iommu.c | 94 >

[Qemu-devel] [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: [Qemu-devel] [RFC PATCH 12/13] intel_iommu: do replay when context invalidate

2016-12-28 Thread Liu, Yi L
> Before this one we only invalidate context cache when we receive context > entry invalidations. However it's possible that the invalidation also > contains a domain switch (only if cache-mode is enabled for vIOMMU). In > that case we need to notify all the registered components about the new >

Re: [Qemu-devel] [RFC PATCH 12/13] intel_iommu: do replay when context invalidate

2016-12-29 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Thursday, December 29, 2016 6:00 PM > To: Liu, Yi L <yi.l@intel.com> > Cc: Tian, Kevin <kevin.t...@intel.com>; Lan, Tianyu <tianyu@intel.com>; > 'qemu- > de...@non

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-28 Thread Liu, Yi L
> The default replay() don't work for VT-d since vt-d will have a huge > default memory region which covers address range 0-(2^64-1). This will > normally bring a dead loop when guest starts. > > The solution is simple - we don't walk over all the regions. Instead, we > jump over the regions when

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-29 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Thursday, December 29, 2016 5:56 PM > To: Liu, Yi L <yi.l@intel.com> > Cc: Tian, Kevin <kevin.t...@intel.com>; Lan, Tianyu <tianyu@intel.com>; > 'qemu- > de...@non

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-29 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, December 30, 2016 11:44 AM > To: Liu, Yi L <yi.l@intel.com> > Cc: Tian, Kevin <kevin.t...@intel.com>; Lan, Tianyu <tianyu@intel.com>; > 'qemu- > de...@non

Re: [Qemu-devel] [RFC PATCH 00/13] VT-d replay and misc cleanup

2016-12-19 Thread Liu, Yi L
On Tue, Dec 06, 2016 at 06:36:15PM +0800, Peter Xu wrote: > This RFC series is a continue work for Aviv B.D.'s vfio enablement > series with vt-d. Aviv has done a great job there, and what we still > lack there are mostly the following: > > (1) VFIO got duplicated IOTLB notifications due to

Re: [Qemu-devel] [RFC PATCH 03/13] intel_iommu: renaming gpa to iova where proper

2016-12-19 Thread Liu, Yi L
On Tue, Dec 06, 2016 at 06:36:18PM +0800, Peter Xu wrote: > There are lots of places in current intel_iommu.c codes that named > "iova" as "gpa". It is really confusing to use a name "gpa" in these > places (which is very easily to be understood as "Guest Physical > Address", while it's not). To

Re: [Qemu-devel] [PATCH v7 3/5] IOMMU: enable intel_iommu map and unmap notifiers

2016-12-19 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Monday, December 19, 2016 6:01 PM > To: Liu, Yi L <yi.l@intel.com> > Cc: bd.a...@gmail.com; qemu-devel@nongnu.org; Michael S. Tsirkin > <m...@redhat.com>; , Jan Kiszka <jan.kis..

Re: [Qemu-devel] [PATCH v7 3/5] IOMMU: enable intel_iommu map and unmap notifiers

2016-12-19 Thread Liu, Yi L
> -Original Message- > From: Liu, Yi L > Sent: Friday, December 16, 2016 5:12 PM > To: bd.a...@gmail.com; qemu-devel@nongnu.org > Cc: Michael S. Tsirkin <m...@redhat.com>; , Jan Kiszka > <jan.kis...@siemens.com>; , Peter Xu <pet...@redhat.com>

Re: [Qemu-devel] [RFC PATCH 00/13] VT-d replay and misc cleanup

2016-12-19 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Monday, December 19, 2016 5:23 PM > To: Liu, Yi L <yi.l@linux.intel.com> > Cc: Tian, Kevin <kevin.t...@intel.com>; Lan, Tianyu <tianyu@intel.com>; > jasow...@redhat.com; qe

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-03-27 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Monday, March 27, 2017 5:12 PM > To: Liu, Yi L <yi.l@intel.com> > Cc: alex.william...@redhat.com; Lan, Tianyu <tianyu@intel.com>; Tian, > Kevin > <kevin.t...@

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-03-27 Thread Liu, Yi L
> -Original Message- > From: Qemu-devel [mailto:qemu-devel-bounces+yi.l.liu=intel@nongnu.org] On > Behalf Of Peter Xu > Sent: Tuesday, February 7, 2017 4:28 PM > To: qemu-devel@nongnu.org > Cc: Lan, Tianyu ; Tian, Kevin ; > m...@redhat.com;

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-03-30 Thread Liu, Yi L
> -Original Message- > From: Liu, Yi L > Sent: Monday, March 27, 2017 5:22 PM > To: Peter Xu <pet...@redhat.com> > Cc: alex.william...@redhat.com; Lan, Tianyu <tianyu@intel.com>; Tian, > Kevin > <kevin.t...@intel.com>; m...@redhat.com; jan.ki

Re: [Qemu-devel] [PATCH v7 17/17] intel_iommu: enable vfio devices

2017-03-19 Thread Liu, Yi L
Hi Peter, How about the merge of this series? I'm also trying to rebase my work and prepare to send out RFC patch. Regards, Yi L > -Original Message- > From: Qemu-devel [mailto:qemu-devel-bounces+yi.l.liu=intel@nongnu.org] On > Behalf Of Peter Xu > Sent: Monday, March 20, 2017 9:57

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-03-30 Thread Liu, Yi L
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Thursday, March 30, 2017 7:58 PM > To: Liu, Yi L <yi.l@intel.com>; 'Peter Xu' <pet...@redhat.com> > Cc: 'alex.william...@redhat.com' <alex.william...@redhat.com>; Lan, Tian

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-03-31 Thread Liu, Yi L
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Friday, March 31, 2017 3:17 PM > To: Liu, Yi L <yi.l@intel.com>; 'Peter Xu' <pet...@redhat.com> > Cc: Lan, Tianyu <tianyu@intel.com>; Tian, Kevin <kevin.t..

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-04-01 Thread Liu, Yi L
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Saturday, April 1, 2017 1:01 PM > To: Liu, Yi L <yi.l@intel.com>; 'Peter Xu' <pet...@redhat.com> > Cc: Lan, Tianyu <tianyu@intel.com>; Tian, Kevin <kevin.t..

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-18 Thread Liu, Yi L
> > Hi Peter, > > > > Skip address space switching is a good idea to support Passthru mode. > > However, without the address space, the vfio notifier would not be > > registered, thus vIOMMU emulator has no way to connect to host. It is > > no harm if there is only map/unmap notifier. But if we

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-17 Thread Liu, Yi L
> -Original Message- > From: Qemu-devel [mailto:qemu-devel-bounces+yi.l.liu=intel@nongnu.org] On > Behalf Of Peter Xu > Sent: Monday, April 17, 2017 7:32 PM > To: qemu-devel@nongnu.org > Cc: Lan, Tianyu ; Michael S . Tsirkin ; > Jason Wang

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Liu, Yi L
Peter, Besides the gPA->hPA mapping, pt mode enabling requires some sanity check on s->pt_supported. See comments inline. > -Original Message- > From: Qemu-devel [mailto:qemu-devel-bounces+yi.l.liu=intel@nongnu.org] On > Behalf Of Peter Xu > Sent: Monday, April 17, 2017 7:32 PM > To:

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-20 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Thursday, April 20, 2017 1:40 PM > To: Liu, Yi L <yi.l@intel.com> > Cc: Lan, Tianyu <tianyu@intel.com>; qemu-devel@nongnu.org; Michael S . > Tsirkin <m...@redhat.com&

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Thursday, April 20, 2017 11:04 AM > To: Lan, Tianyu <tianyu@intel.com> > Cc: Liu, Yi L <yi.l@intel.com>; qemu-devel@nongnu.org; Michael S . Tsirkin > <m...@redhat.com>; Jaso

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-18 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, April 18, 2017 3:27 PM > To: Liu, Yi L <yi.l@intel.com> > Cc: qemu-devel@nongnu.org; Lan, Tianyu <tianyu@intel.com>; Michael S . > Tsirkin <m...@redhat.com>; Jaso

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

2017-07-14 Thread Liu, Yi L
[mailto:alex.william...@redhat.com] > Sent: Thursday, July 6, 2017 1:28 AM > To: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> > Cc: Tian, Kevin <kevin.t...@intel.com>; Liu, Yi L <yi.l@linux.intel.com>; > Lan, > Tianyu <tianyu@intel.com&g

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 <yi.l@intel.com> > Cc: Jean-Philippe Bru

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" <yi.l@intel.com> wrote: > > > Hi Alex, > > > > Pls refer to the response inline. > > > > > -Original Message

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 a

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

2017-07-03 Thread Liu, Yi L
ch 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's welcomed. Thanks, Yi L > Hi

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

2017-04-26 Thread Liu, Yi L
ion_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 <yi.l@linux.intel.com> --- hw/vfio/common.c | 37 +++--- hw/vfio/pci.c

[Qemu-devel] [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 <yi.l@linux.intel.com> --- linux-headers/linux/vfio.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/linux-head

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

2017-04-26 Thread Liu, Yi L
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" option

[Qemu-devel] [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 <yi.l@linux.intel.com> --- 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(+)

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

2017-04-26 Thread Liu, Yi L
d 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 <yi.l@li

[Qemu-devel] [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 <yi.l@linux.intel.com> --- 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 deletion

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

2017-04-26 Thread Liu, Yi L
-by: Liu, Yi L <yi.l@linux.intel.com> --- 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, hwadd

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

2017-04-26 Thread Liu, Yi L
ary 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 <yi.l@linux.intel.com> --- hw/vfio/pci.c

[Qemu-devel] [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 <yi.l@linux.intel.com> --- linux-headers/linux/iommu.h | 30 ++ 1 file change

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

2017-04-26 Thread Liu, Yi L
s down all descriptors from the guest 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

[Qemu-devel] [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

[Qemu-devel] [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 <yi.l@linux.intel.com> --- hw/i386/intel_iommu.c | 32 h

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

2017-04-26 Thread Liu, Yi L
-off-by: Liu, Yi L <yi.l@linux.intel.com> --- 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

[Qemu-devel] [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 <yi.l@linux.intel.com> --- include/exec/memory.h | 9 + memory.c | 18 ++ 2 files changed, 27 insertions(+) diff --git a/include/exec/memory.h b/i

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

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" <yi.l@linux.intel.com> 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 invalid

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

2017-04-26 Thread Liu, Yi L
. In future PASID may also need to be replaced. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> --- hw/i386/intel_iommu.c | 126 + hw/i386/intel_iommu_internal.h | 33 +++ 2 files changed, 159 insertions(+) diff --git a/hw/i386/intel_iom

[Qemu-devel] [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 &l

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

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" <yi.l@linux.intel.com> 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 t

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

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" <yi.l@linux.intel.com> 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

[Qemu-devel] [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 <yi.l@linux.intel.com> --- hw/vfio/common.c | 3 ++- hw/virtio/vhost.c

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

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" <yi.l@linux.intel.com> 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 c

[Qemu-devel] [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 <yi.l@linux.intel.com> --- hw/i386/intel_iommu.c | 43 ++ hw/i386/intel_iommu_internal.h | 7 +++ 2 files changed, 50 insertions(+) diff --git a/h

[Qemu-devel] [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/

[Qemu-devel] [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 <yi.l@linux.intel.com> --- hw/i386/intel_iommu.c |

[Qemu-devel] [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 <yi.l@linux.intel.com> --- hw/i386/intel_iommu.c | 121 +++-- hw/i386/intel_iommu_internal.h | 11

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

2017-04-26 Thread Liu, Yi L
Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> --- drivers/iommu/iommu.c | 19 +++ include/linux/iommu.h | 31 +++ 2 files changed, 50 insertions(+) diff --git a/drivers/iommu/iommu.c

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

2017-04-26 Thread Liu, Yi L
From: "Liu, Yi L" <yi.l@linux.intel.com> 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

[Qemu-devel] [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 <yi.l@linux.intel.com> --- include/exec/memory.h | 11 +++ memory.c | 12 2 files changed, 23 insertions(+) diff --git a/include/exec/memory.h b/inc

[Qemu-devel] [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 <yi.l@linux.intel.com> --- hw/i386/intel_iommu.c | 56 ++ hw/i386/intel_iommu_internal.

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

2017-04-26 Thread Liu, Yi L
ed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> --- drivers/iommu/intel-iommu.c | 103 ++ include/linux/dma_remapping.h | 1 + 2 files changed, 104 insertions(+) diff --git a/drivers/iom

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 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 5/8] VFIO: Add new IOTCL for PASID Table bind propagation

2017-04-27 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" <yi.l@linux.intel.com> > > > > This patch adds VFIO_IOMMU_SVM_BIND_TASK for potential PASID table > > binding reque

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

2017-04-27 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 <jacob.jun@linux.intel.com> > > > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) use

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: [Qemu-devel] [RFC PATCH 8/8] iommu: introduce hw/core/iommu

2017-04-28 Thread Liu, Yi L
On Thu, Apr 27, 2017 at 05:34:20PM +0800, Peter Xu wrote: > Time to consider a common stuff for IOMMU. Let's start from an common > IOMMU object (which should be inlayed in custom IOMMU implementations) > and a notifier mechanism. > > Let VT-d IOMMU be the first user. > > An example to use this

Re: [Qemu-devel] [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 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 wro

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 <jacob.jun@linux.intel.com> > > > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) use

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" <yi.l@linux.intel.com> 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 invalidat

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" <yi.l@linux.intel.com> > > > >This patch adds IOCTL processing in vfio_iommu_type1 for > >VFIO_IOMMU_SVM_BI

Re: [Qemu-devel] [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" <yi.l@linux.intel.com> > > > > This patch adds VFIO_IOMMU_TLB_INVALIDATE to propagate IOMMU TL

Re: [Qemu-devel] [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" <yi.l@intel.com> wrote: > > > From: Jacob Pan <jacob.jun@linux.intel.com> > > > > Virtual IOMMU was proposed to

Re: [Qemu-devel] [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" <yi.l@intel.com> wrote: > > > From: "Liu, Yi L" <yi.l@linux.intel.com> > > > > This patch adds VFIO_IOMMU_TLB_IN

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 <pet...@redhat.com> wrote: > > > > > On Wed, Apr 26, 2017 at 06:06:33PM +0800, Liu, Yi L w

Re: [Qemu-devel] [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" <yi.l@intel.com> wrote: > Hi Alex, Pls refer to the open I mentioned in this email, I need your comments on it to prepare the formal patchset fo

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" <yi.l@intel.com> wrote: > > > From: "Liu, Yi L" <yi.l@linux.intel.com> > > > > This patch adds VFIO_IOMMU_S

Re: [Qemu-devel] [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" <yi.l@intel.com> wrote: > > > From: Jacob Pan <jacob.jun@linux.intel.com> > > > > This patch adds Intel VT-d specific

Re: [Qemu-devel] [RFC PATCH 6/8] memory: introduce AddressSpaceOps

2017-06-08 Thread Liu, Yi L
Hi David, I added some update on your question. See if it make any sense. > -Original Message- > From: David Gibson [mailto:da...@gibson.dropbear.id.au] > Sent: Friday, May 26, 2017 1:30 PM > To: Peter Xu > On Thu, May 25, 2017 at 03:24:30PM +0800, Peter Xu wrote:

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

Re: [Qemu-devel] [PATCH v4 08/10] intel_iommu: support passthrough (PT)

2017-05-25 Thread Liu, Yi L
On Fri, May 19, 2017 at 11:19:47AM +0800, Peter Xu wrote: Reviewed-by: Liu, Yi L <yi.l@linux.intel.com> Regards, Yi L > Hardware support for VT-d device passthrough. Although current Linux can > live with iommu=pt even without this, but this is faster than when using > softw

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

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 8/8] iommu: introduce hw/core/iommu

2017-06-07 Thread Liu, Yi L
Hi Peter, Some updates on it. > -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Thursday, April 27, 2017 5:34 PM > To: qemu-devel@nongnu.org > Cc: Lan, Tianyu <tianyu@intel.com>; Paolo Bonzini <pbonz...@redhat.com>; > Tian, Kevin &

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

2017-05-08 Thread Liu, Yi L
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 intel_iomm

Re: [Qemu-devel] [RFC PATCH 6/8] memory: introduce AddressSpaceOps

2017-05-08 Thread Liu, Yi L
On Mon, May 08, 2017 at 03:32:17PM +0800, Peter Xu wrote: > On Mon, May 08, 2017 at 04:07:44PM +1000, David Gibson wrote: > > On Mon, May 08, 2017 at 01:48:14PM +0800, Peter Xu wrote: > > > On Mon, May 01, 2017 at 02:58:22PM +1000, David Gibson wrote: > > > > On Thu, Apr 27, 2017 at 05:34:18PM

Re: [Qemu-devel] [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 <pet...@redhat.com> 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 capabi

Re: [Qemu-devel] [RESEND PATCH 2/6] memory: introduce AddressSpaceOps and IOMMUObject

2017-11-13 Thread Liu, Yi L
On Mon, Nov 13, 2017 at 04:56:01PM +1100, David Gibson wrote: > On Fri, Nov 03, 2017 at 08:01:52PM +0800, Liu, Yi L wrote: > > From: Peter Xu <pet...@redhat.com> > > > > AddressSpaceOps is similar to MemoryRegionOps, it's just for address > > sp

  1   2   3   4   5   6   7   >