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

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

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

[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

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

[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

<    2   3   4   5   6   7