[PATCH v2 13/22] intel_iommu: add PASID cache management infrastructure

2020-03-29 Thread Liu Yi L
Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 473 + hw/i386/intel_iommu_internal.h | 18 ++ hw/i386/trace-events | 1 + include/hw/i386/intel_iommu.h | 24 +++

[PATCH v2 02/22] header file update VFIO/IOMMU vSVA APIs

2020-03-29 Thread Liu Yi L
: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Signed-off-by: Liu Yi L --- linux-headers/linux/iommu.h | 378 linux-headers/linux/vfio.h | 127 +++ 2 files changed, 505 insertions(+) create mode 100644 linux-headers

[PATCH v2 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-03-29 Thread Liu Yi L
u Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 117 + hw/i386/intel_iommu_internal.h | 7 +++ 2 files changed, 124 insertions(+) diff --git a/hw/i386/intel_iommu.c

[PATCH v2 08/22] vfio/common: provide PASID alloc/free hooks

2020-03-29 Thread Liu Yi L
This patch defines vfio_host_iommu_context_info, implements the PASID alloc/free hooks defined in HostIOMMUContextClass. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/vfio/common.c

[PATCH v2 19/22] intel_iommu: process PASID-based iotlb invalidation

2020-03-29 Thread Liu Yi L
Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 53 ++ hw/i386/intel_iommu_internal.h | 13 +++ 2 files changed, 66 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386

[PATCH v2 10/22] vfio/pci: set host iommu context to vIOMMU

2020-03-29 Thread Liu Yi L
Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/vfio/pci.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 5e75a95..c140c88 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2717,6 +2717,7 @@ static void

[PATCH v2 14/22] vfio: add bind stage-1 page table support

2020-03-29 Thread Liu Yi L
Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 47 +- hw/vfio/common.c | 55 ++- include/hw/iommu/host_iommu_context.h | 26 - 3 files

[PATCH v2 17/22] intel_iommu: do not pass down pasid bind for PASID #0

2020-03-29 Thread Liu Yi L
l.org/lkml/2019/9/23/297 Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/i386/intel_io

[PATCH v2 16/22] intel_iommu: replay pasid binds after context cache invalidation

2020-03-29 Thread Liu Yi L
: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 51 ++ hw/i386/intel_iommu_internal.h | 6 - hw/i386/trace-events | 1 + 3 files changed, 57 insertions(+), 1 deletion

[PATCH v2 04/22] hw/iommu: introduce HostIOMMUContext

2020-03-29 Thread Liu Yi L
e. In future, there will be more operations like bind_stage1_pgtbl, flush_stage1_cache and etc. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Signed-off-by: Liu Yi L --- hw/Makefile.objs | 1 + hw/iommu/M

[PATCH v2 18/22] vfio: add support for flush iommu stage-1 cache

2020-03-29 Thread Liu Yi L
Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Acked-by: Peter Xu Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 19 +++ hw/vfio/common.c | 25 + include/hw/iommu

[PATCH v2 11/22] intel_iommu: add virtual command capability support

2020-03-29 Thread Liu Yi L
-by: Liu Yi L Signed-off-by: Yi Sun --- hw/i386/intel_iommu.c | 154 - hw/i386/intel_iommu_internal.h | 37 ++ hw/i386/trace-events | 1 + include/hw/i386/intel_iommu.h | 10 ++- 4 files changed, 200 insertions(+), 2 deletions

[PATCH v2 12/22] intel_iommu: process PASID cache invalidation

2020-03-29 Thread Liu Yi L
subsequent patches. v1 -> v2: remove vtd_pasid_cache_gsi(), vtd_pasid_cache_psi() and vtd_pasid_cache_dsi() Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/i

[PATCH v2 06/22] hw/pci: introduce pci_device_set/unset_iommu_context()

2020-03-29 Thread Liu Yi L
Sun Cc: David Gibson Cc: Michael S. Tsirkin Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/pci/pci.c | 49 - include/hw/pci/pci.h | 10 ++ 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw

[PATCH v2 15/22] intel_iommu: bind/unbind guest page table to host

2020-03-29 Thread Liu Yi L
gt;HPA) under nested translation mode. This is the key part of vSVA support, and also a key to support IOVA over 1st- level page table for Intel VT-d in virtualization environment. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Signed-off-by: Li

[PATCH v2 05/22] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2020-03-29 Thread Liu Yi L
specific operations. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Reviewed-by: David Gibson Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/alpha/typhoon.c | 6 +- hw/arm/smmu-common.c | 6 +- hw/hppa

[PATCH v2 09/22] vfio/common: init HostIOMMUContext per-container

2020-03-29 Thread Liu Yi L
Yi L --- hw/vfio/common.c | 99 1 file changed, 99 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 5f3534d..44b142c 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1226,10 +1226,89 @@ static int

[PATCH v2 22/22] intel_iommu: modify x-scalable-mode to be string option

2020-03-29 Thread Liu Yi L
lable mode support - if not configured, means no scalable mode support, if not proper configured, will throw error Note: this patch is supposed to be merged when the whole vSVA patch series were merged. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richar

[PATCH v2 07/22] intel_iommu: add set/unset_iommu_context callback

2020-03-29 Thread Liu Yi L
Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 71 --- include/hw/i386/intel_iommu.h | 21 ++--- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 4b22910..fd349c6

[PATCH v2 00/22] intel_iommu: expose Shared Virtual Addressing to VMs

2020-03-29 Thread Liu Yi L
1. Modify x-scalable-mode to be string option instead of adding a new option as RFC v1 did. Refined the pasid cache management and addressed the TODOs mentioned in RFC v1. RFC v1: https://patchwork.kernel.org/cover/11033657/ Eric Auger (1): scripts/update-l

[PATCH v2 01/22] scripts/update-linux-headers: Import iommu.h

2020-03-29 Thread Liu Yi L
From: Eric Auger Update the script to import the new iommu.h uapi header. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Acked-by: Cornelia Huck Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file

[PATCH v2 03/22] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-03-29 Thread Liu Yi L
VFIO needs to check VFIO_TYPE1_NESTING_IOMMU support with Kernel before further using it. e.g. requires to check IOMMU UAPI version. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L Signed-off-by: Yi Sun

RE: [PATCH v1 19/22] intel_iommu: process PASID-based iotlb invalidation

2020-03-29 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 11:16 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 19/22] intel_iommu: process PASID-based iotlb > invalidation > > On Wed, Mar 25, 2020 at 01:36:03PM +, Liu, Yi L wrote: > > > From: Peter Xu > > >

RE: [PATCH v1 12/22] intel_iommu: add PASID cache management infrastructure

2020-03-26 Thread Liu, Yi L
> From: Peter Xu > Sent: Thursday, March 26, 2020 11:54 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 12/22] intel_iommu: add PASID cache management > infrastructure > > On Thu, Mar 26, 2020 at 01:57:10PM +, Liu, Yi L wrote: > > > From: Liu, Yi L > > >

RE: [PATCH v1 12/22] intel_iommu: add PASID cache management infrastructure

2020-03-26 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Thursday, March 26, 2020 2:15 PM > To: 'Peter Xu' > Subject: RE: [PATCH v1 12/22] intel_iommu: add PASID cache management > infrastructure > > > From: Peter Xu > > Sent: Wednesday, March 25, 2020 10:52 PM > > To: Liu, Yi L

RE: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-03-26 Thread Liu, Yi L
> From: Peter Xu > Sent: Thursday, March 26, 2020 9:23 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb > invalidation to host > > On Thu, Mar 26, 2020 at 09:02:48AM -0400, Peter Xu wrote: > > [...] > &

RE: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-03-26 Thread Liu, Yi L
> From: Peter Xu > Sent: Thursday, March 26, 2020 9:03 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb > invalidation to host > > On Thu, Mar 26, 2020 at 05:41:39AM +, Liu, Yi L wrote: > > > From: Liu, Yi L > >

RE: [RFC v6 05/24] memory: Introduce IOMMU Memory Region inject_faults API

2020-03-26 Thread Liu, Yi L
Hi Eric, I'm also considering how to inject iommu fault to vIOMMU. As our previous discussion (long time ago), MemoryRegion way doesn't work well for VTd case. So I'd like see your opinion on the proposal below: I've a patch to make vIOMMUs register PCIIOMMUOps to PCI layer. Current usage is to ge

RE: [RFC v6 08/24] pci: introduce PCIPASIDOps to PCIDevice

2020-03-26 Thread Liu, Yi L
rday, March 21, 2020 12:58 AM > To: eric.auger@gmail.com; eric.au...@redhat.com; qemu-devel@nongnu.org; > Subject: [RFC v6 08/24] pci: introduce PCIPASIDOps to PCIDevice > > From: Liu Yi L > > This patch introduces PCIPASIDOps for IOMMU related operations. > > http

RE: [RFC v6 01/24] update-linux-headers: Import iommu.h

2020-03-26 Thread Liu, Yi L
> From: Eric Auger > Sent: Saturday, March 21, 2020 12:58 AM > To: eric.auger@gmail.com; eric.au...@redhat.com; qemu-devel@nongnu.org; > Subject: [RFC v6 01/24] update-linux-headers: Import iommu.h > > Update the script to import the new iommu.h uapi header. > > Signed-off-by: Eric Auger >

RE: [PATCH v1 12/22] intel_iommu: add PASID cache management infrastructure

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 10:52 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 12/22] intel_iommu: add PASID cache management > infrastructure > > On Wed, Mar 25, 2020 at 12:20:21PM +, Liu, Yi L wrote: > > > From: Peter Xu > > >

RE: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-03-25 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Wednesday, March 25, 2020 9:22 PM > To: 'Peter Xu' > Subject: RE: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb > invalidation to host > > > From: Peter Xu > > Sent: Wednesday, March 25, 2020 2:34 AM > > T

RE: [PATCH v1 15/22] intel_iommu: replay guest pasid bindings to host

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 11:07 PM > To: Liu, Yi L > Cc: qemu-devel@nongnu.org; alex.william...@redhat.com; > eric.au...@redhat.com; pbonz...@redhat.com; m...@redhat.com; > da...@gibson.dropbear.id.au; Tian, Kevin ; Tian, Jun J > ; Sun, Yi Y ; k...@v

RE: [PATCH v1 14/22] intel_iommu: bind/unbind guest page table to host

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 10:57 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 14/22] intel_iommu: bind/unbind guest page table to > host > > On Wed, Mar 25, 2020 at 12:42:58PM +, Liu, Yi L wrote: > > > From: Peter Xu > > >

RE: [PATCH v1 17/22] intel_iommu: do not pass down pasid bind for PASID #0

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 11:12 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 17/22] intel_iommu: do not pass down pasid bind for > PASID > #0 > > On Wed, Mar 25, 2020 at 10:42:25AM +, Liu, Yi L wrote: > > > From: Peter Xu < pet.

RE: [PATCH v1 19/22] intel_iommu: process PASID-based iotlb invalidation

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 2:26 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 19/22] intel_iommu: process PASID-based iotlb > invalidation > > On Sun, Mar 22, 2020 at 05:36:16AM -0700, Liu Yi L wrote: > > This patch adds the basic PASID-based

RE: [PATCH v1 22/22] intel_iommu: modify x-scalable-mode to be string option

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 2:39 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 22/22] intel_iommu: modify x-scalable-mode to be string > option > > On Sun, Mar 22, 2020 at 05:36:19AM -0700, Liu Yi L wrote: > > Intel VT-d 3.0 introduces scalable

RE: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 2:34 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb > invalidation to host > > On Sun, Mar 22, 2020 at 05:36:17AM -0700, Liu Yi L wrote: > > This patch propagates PASID-

RE: [PATCH v1 16/22] intel_iommu: replay pasid binds after context cache invalidation

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 1:47 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 14/22] intel_iommu: bind/unbind guest page table to > host > > On Sun, Mar 22, 2020 at 05:36:11AM -0700, Liu Yi L wrote: > > This patch captures the guest PASID ta

RE: [PATCH v1 15/22] intel_iommu: replay guest pasid bindings to host

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 2:00 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 15/22] intel_iommu: replay guest pasid bindings to host > > On Sun, Mar 22, 2020 at 05:36:12AM -0700, Liu Yi L wrote: > > This patch adds guest pasid bindings replay

RE: [PATCH v1 14/22] intel_iommu: bind/unbind guest page table to host

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 1:47 AM > To: Liu, Yi L > Sent: Wednesday, March 25, 2020 1:47 AM > Subject: Re: [PATCH v1 14/22] intel_iommu: bind/unbind guest page table to > host > > On Sun, Mar 22, 2020 at 05:36:11AM -0700, Liu Yi L wrote: >

RE: [PATCH v1 14/22] intel_iommu: bind/unbind guest page table to host

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 1:47 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 14/22] intel_iommu: bind/unbind guest page table to > host > > On Sun, Mar 22, 2020 at 05:36:11AM -0700, Liu Yi L wrote: > > This patch captures the guest PASID ta

RE: [PATCH v1 12/22] intel_iommu: add PASID cache management infrastructure

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 1:32 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 12/22] intel_iommu: add PASID cache management > infrastructure > > On Sun, Mar 22, 2020 at 05:36:09AM -0700, Liu Yi L wrote: > > This patch adds a PASID cache managem

RE: [PATCH v1 17/22] intel_iommu: do not pass down pasid bind for PASID #0

2020-03-25 Thread Liu, Yi L
> From: Peter Xu < pet...@redhat.com> > Sent: Wednesday, March 25, 2020 2:13 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 17/22] intel_iommu: do not pass down pasid bind for > PASID > #0 > > On Sun, Mar 22, 2020 at 05:36:14AM -0700, Liu Yi L wrote: > > RID_PA

RE: [PATCH v1 18/22] vfio: add support for flush iommu stage-1 cache

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 2:19 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 18/22] vfio: add support for flush iommu stage-1 cache > > On Sun, Mar 22, 2020 at 05:36:15AM -0700, Liu Yi L wrote: > > This patch adds flush_stage1_cache() definition

RE: [PATCH v1 13/22] vfio: add bind stage-1 page table support

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 1:41 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 13/22] vfio: add bind stage-1 page table support > > On Sun, Mar 22, 2020 at 05:36:10AM -0700, Liu Yi L wrote: > > This patch adds bind_stage1_pgtbl() definition in &

RE: [PATCH v1 07/22] intel_iommu: add set/unset_iommu_context callback

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Tuesday, March 24, 2020 11:24 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 07/22] intel_iommu: add set/unset_iommu_context > callback > > On Tue, Mar 24, 2020 at 11:15:24AM +, Liu, Yi L wrote: > > [...] > > > > > struc

RE: [PATCH v1 08/22] vfio: init HostIOMMUContext per-container

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Tuesday, March 24, 2020 10:46 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 08/22] vfio: init HostIOMMUContext per-container > > On Tue, Mar 24, 2020 at 01:03:28PM +, Liu, Yi L wrote: > > > From: Peter Xu > > > Sent: Tuesday, Marc

RE: [PATCH v1 21/22] intel_iommu: process PASID-based Device-TLB invalidation

2020-03-25 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, March 25, 2020 2:36 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 21/22] intel_iommu: process PASID-based Device-TLB > invalidation > > On Sun, Mar 22, 2020 at 05:36:18AM -0700, Liu Yi L wrote: > > This patch adds an empty handling

RE: [PATCH v1 08/22] vfio: init HostIOMMUContext per-container

2020-03-24 Thread Liu, Yi L
> From: Peter Xu > Sent: Tuesday, March 24, 2020 5:40 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 08/22] vfio: init HostIOMMUContext per-container > > On Sun, Mar 22, 2020 at 05:36:05AM -0700, Liu Yi L wrote: > > After confirming dual stage DMA translation support wit

RE: [PATCH v1 09/22] vfio/common: check PASID alloc/free availability

2020-03-24 Thread Liu, Yi L
> From: Peter Xu > Sent: Tuesday, March 24, 2020 6:07 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 09/22] vfio/common: check PASID alloc/free availability > > On Sun, Mar 22, 2020 at 05:36:06AM -0700, Liu Yi L wrote: > > [...] > > > @@ -1256,11 +1334,19

RE: [PATCH v1 07/22] intel_iommu: add set/unset_iommu_context callback

2020-03-24 Thread Liu, Yi L
> From: Peter Xu > Sent: Tuesday, March 24, 2020 5:29 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 07/22] intel_iommu: add set/unset_iommu_context > callback > > On Sun, Mar 22, 2020 at 05:36:04AM -0700, Liu Yi L wrote: > > This patch adds set/unset_iommu_context

RE: [PATCH v1 06/22] hw/pci: introduce pci_device_set/unset_iommu_context()

2020-03-24 Thread Liu, Yi L
> From: Peter Xu > Sent: Tuesday, March 24, 2020 5:15 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 06/22] hw/pci: introduce > pci_device_set/unset_iommu_context() > > On Sun, Mar 22, 2020 at 05:36:03AM -0700, Liu Yi L wrote: > > [...] > > > +AddressS

RE: [PATCH v1 04/22] hw/iommu: introduce HostIOMMUContext

2020-03-24 Thread Liu, Yi L
> From: Peter Xu > Sent: Tuesday, March 24, 2020 4:59 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 04/22] hw/iommu: introduce HostIOMMUContext > > On Sun, Mar 22, 2020 at 05:36:01AM -0700, Liu Yi L wrote: [...] > > + > > +void host_iommu_ctx_init(void *_

[PATCH v1 04/22] hw/iommu: introduce HostIOMMUContext

2020-03-22 Thread Liu Yi L
e. In future, there will be more operations like bind_stage1_pgtbl, flush_stage1_cache and etc. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Signed-off-by: Liu Yi L --- hw/Makefile.objs | 1 + hw/iommu/M

[PATCH v1 18/22] vfio: add support for flush iommu stage-1 cache

2020-03-22 Thread Liu Yi L
Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 19 +++ hw/vfio/common.c | 24 include/hw/iommu/host_iommu_context.h

[PATCH v1 22/22] intel_iommu: modify x-scalable-mode to be string option

2020-03-22 Thread Liu Yi L
lable mode support - if not configured, means no scalable mode support, if not proper configured, will throw error Note: this patch is supposed to be merged when the whole vSVA patch series were merged. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richar

[PATCH v1 19/22] intel_iommu: process PASID-based iotlb invalidation

2020-03-22 Thread Liu Yi L
Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 57 ++ hw/i386/intel_iommu_internal.h | 13 ++ 2 files changed, 70 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386

[PATCH v1 14/22] intel_iommu: bind/unbind guest page table to host

2020-03-22 Thread Liu Yi L
gt;HPA) under nested translation mode. This is the key part of vSVA support, and also a key to support IOVA over 1st- level page table for Intel VT-d in virtualization environment. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Signed-off-by: Li

[PATCH v1 15/22] intel_iommu: replay guest pasid bindings to host

2020-03-22 Thread Liu Yi L
Cc: Paolo Bonzini Cc: Richard Henderson Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 128 - hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 127 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386

[PATCH v1 12/22] intel_iommu: add PASID cache management infrastructure

2020-03-22 Thread Liu Yi L
: Liu Yi L --- hw/i386/intel_iommu.c | 394 + hw/i386/intel_iommu_internal.h | 14 ++ hw/i386/trace-events | 1 + include/hw/i386/intel_iommu.h | 33 +++- 4 files changed, 441 insertions(+), 1 deletion(-) diff --git a/hw/i386

[PATCH v1 09/22] vfio/common: check PASID alloc/free availability

2020-03-22 Thread Liu Yi L
Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Shameer Kolothum Signed-off-by: Liu Yi L --- hw/vfio/common.c | 96 +--- 1 file changed, 91 insertions(+), 5 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c

[PATCH v1 17/22] intel_iommu: do not pass down pasid bind for PASID #0

2020-03-22 Thread Liu Yi L
l.org/lkml/2019/9/23/297 Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iom

[PATCH v1 16/22] intel_iommu: replay pasid binds after context cache invalidation

2020-03-22 Thread Liu Yi L
: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 68 ++ hw/i386/intel_iommu_internal.h | 6 +++- hw/i386/trace-events | 1 + 3 files changed, 74 insertions(+), 1 deletion

[PATCH v1 11/22] intel_iommu: process PASID cache invalidation

2020-03-22 Thread Liu Yi L
subsequent patches. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 66 ++ hw/i386/intel_iommu_internal.h

[PATCH v1 21/22] intel_iommu: process PASID-based Device-TLB invalidation

2020-03-22 Thread Liu Yi L
: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 18 ++ hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 19 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 10d314d..72cd739 100644 --- a/hw

[PATCH v1 07/22] intel_iommu: add set/unset_iommu_context callback

2020-03-22 Thread Liu Yi L
Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 70 +++ include/hw/i386/intel_iommu.h | 17 +-- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 4b22910..8d9204f

[PATCH v1 03/22] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-03-22 Thread Liu Yi L
VFIO needs to check VFIO_TYPE1_NESTING_IOMMU support with Kernel before further using it. e.g. requires to check IOMMU UAPI version. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L Signed-off-by: Yi Sun

[PATCH v1 10/22] intel_iommu: add virtual command capability support

2020-03-22 Thread Liu Yi L
-by: Liu Yi L Signed-off-by: Yi Sun --- hw/i386/intel_iommu.c | 154 - hw/i386/intel_iommu_internal.h | 37 ++ hw/i386/trace-events | 1 + include/hw/i386/intel_iommu.h | 10 ++- 4 files changed, 200 insertions(+), 2 deletions

[PATCH v1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-03-22 Thread Liu Yi L
table related mappings during DMA address translation. This patch traps the guest PASID-based iotlb flush and propagate it to host. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_i

[PATCH v1 00/22] intel_iommu: expose Shared Virtual Addressing to VMs

2020-03-22 Thread Liu Yi L
in RFC v1. Modify x-scalable-mode to be string option instead of adding a new option as RFC v1 did. Refined the pasid cache management and addressed the TODOs mentioned in RFC v1. RFC v1: https://patchwork.kernel.org/cover/11033657/ Eric Auger (1): scripts/update-linu

[PATCH v1 02/22] header file update VFIO/IOMMU vSVA APIs

2020-03-22 Thread Liu Yi L
: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Signed-off-by: Liu Yi L --- linux-headers/linux/iommu.h | 378 linux-headers/linux/vfio.h | 127 +++ 2 files changed, 505 insertions(+) create mode 100644 linux-headers

[PATCH v1 08/22] vfio: init HostIOMMUContext per-container

2020-03-22 Thread Liu Yi L
: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/vfio/common.c | 80 +++ hw/vfio/pci.c | 13 ++ include/hw/iommu/host_iommu_context.h | 3

[PATCH v1 01/22] scripts/update-linux-headers: Import iommu.h

2020-03-22 Thread Liu Yi L
From: Eric Auger Update the script to import the new iommu.h uapi header. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Acked-by: Cornelia Huck Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file

[PATCH v1 06/22] hw/pci: introduce pci_device_set/unset_iommu_context()

2020-03-22 Thread Liu Yi L
Sun Cc: David Gibson Cc: Michael S. Tsirkin Signed-off-by: Liu Yi L --- hw/pci/pci.c | 49 - include/hw/pci/pci.h | 10 ++ 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index aa9025c

[PATCH v1 13/22] vfio: add bind stage-1 page table support

2020-03-22 Thread Liu Yi L
Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 49 ++- hw/vfio/common.c | 55 ++- include/hw/iommu/host_iommu_context.h | 26 - 3 files

[PATCH v1 05/22] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2020-03-22 Thread Liu Yi L
specific operations. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Reviewed-by: David Gibson Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/alpha/typhoon.c | 6 +- hw/arm/smmu-common.c | 6 +- hw/hppa

[RFC v3.1 12/22] intel_iommu: add PASID cache management infrastructure

2020-02-22 Thread Liu Yi L
: Liu Yi L --- hw/i386/intel_iommu.c | 386 + hw/i386/intel_iommu_internal.h | 14 ++ hw/i386/trace-events | 1 + include/hw/i386/intel_iommu.h | 33 +++- 4 files changed, 433 insertions(+), 1 deletion(-) diff --git a/hw/i386

[RFC v3.1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-02-22 Thread Liu Yi L
table related mappings during DMA address translation. This patch traps the guest PASID-based iotlb flush and propagate it to host. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_i

[RFC v3.1 14/22] intel_iommu: bind/unbind guest page table to host

2020-02-22 Thread Liu Yi L
ed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 93 -- hw/i386/intel_iommu_internal.h | 26 2 files changed, 115 insertions(+), 4 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index b032a7c..8bd27b1 100644 --

[RFC v3.1 18/22] vfio/common: add support for flush iommu stage-1 cache

2020-02-22 Thread Liu Yi L
: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 10 ++ hw/vfio/common.c | 24 include/hw/iommu/host_iommu_context.h | 14 ++ 3 files

[RFC v3.1 15/22] intel_iommu: replay guest pasid bindings to host

2020-02-22 Thread Liu Yi L
Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 183 ++--- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 173 insertions(+), 11 deletions(-) diff --git a/hw/i386/intel_iommu.c

[RFC v3.1 04/22] hw/iommu: introduce HostIOMMUContext

2020-02-22 Thread Liu Yi L
o operations included to demonstrate the design, in future, there will be more operations like bind_stage1_pgtbl and invalidate_stage1_cache and etc. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Signed-off-by: Liu Yi L --- hw/M

[RFC v3.1 06/22] vfio/pci: init HostIOMMUContext per-container

2020-02-22 Thread Liu Yi L
: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/vfio/common.c | 11 +++ hw/vfio/pci.c | 21 + include/hw/vfio/vfio-common.h | 2 ++ 3 files changed, 34 insertions

[RFC v3.1 02/22] header file update VFIO/IOMMU vSVA APIs

2020-02-22 Thread Liu Yi L
: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Signed-off-by: Liu Yi L --- linux-headers/linux/iommu.h | 372 linux-headers/linux/vfio.h | 127 +++ 2 files changed, 499 insertions(+) create mode 100644 linux-headers

[RFC v3.1 19/22] intel_iommu: process PASID-based iotlb invalidation

2020-02-22 Thread Liu Yi L
Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 57 ++ hw/i386/intel_iommu_internal.h | 13 ++ 2 files changed, 70 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386

[RFC v3.1 13/22] vfio: add bind stage-1 page table support

2020-02-22 Thread Liu Yi L
: David Gibson Cc: Alex Williamson Signed-off-by: Liu, Yi L --- hw/iommu/host_iommu_context.c | 20 ++ hw/vfio/common.c | 49 +++ include/hw/iommu/host_iommu_context.h | 23 3 files changed, 92 insertions

[RFC v3.1 10/22] intel_iommu: add virtual command capability support

2020-02-22 Thread Liu Yi L
-by: Liu Yi L Signed-off-by: Yi Sun --- hw/i386/intel_iommu.c | 166 + hw/i386/intel_iommu_internal.h | 37 + hw/i386/trace-events | 1 + include/hw/i386/intel_iommu.h | 6 +- 4 files changed, 209 insertions(+), 1 deletion

[RFC v3.1 07/22] vfio: get nesting iommu cap info from Kernel

2020-02-22 Thread Liu Yi L
: Shameer Kolothum Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 5 +- hw/vfio/common.c | 97 ++- include/hw/iommu/host_iommu_context.h | 10 +++- 3 files changed, 108 insertions(+), 4 deletions(-) diff --git a/hw/iommu

[RFC v3.1 11/22] intel_iommu: process pasid cache invalidation

2020-02-22 Thread Liu Yi L
subsequent patches. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 66 ++ hw/i386/intel_iommu_internal.h

[RFC v3.1 21/22] intel_iommu: process PASID-based Device-TLB invalidation

2020-02-22 Thread Liu Yi L
: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 18 ++ hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 19 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index e6326ef..f5faa75 100644 --- a/hw

[RFC v3.1 22/22] intel_iommu: modify x-scalable-mode to be string option

2020-02-22 Thread Liu Yi L
lable mode support - if not configured, means no scalable mode support, if not proper configured, will throw error Note: this patch is supposed to be merged when the whole vSVA patch series were merged. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richar

[RFC v3.1 00/22] intel_iommu: expose Shared Virtual Addressing to VMs

2020-02-22 Thread Liu Yi L
ment and addressed the TODOs mentioned in RFC v1. RFC v1: https://patchwork.kernel.org/cover/11033657/ Eric Auger (1): scripts/update-linux-headers: Import iommu.h Liu Yi L (21): header file update VFIO/IOMMU vSVA APIs vfio: check VFIO_TYPE1_NESTING_IOMMU support hw/iom

[RFC v3.1 05/22] hw/pci: add pci_device_setup_iommu

2020-02-22 Thread Liu Yi L
emulators to get HostIOMMUContext. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Signed-off-by: Liu, Yi L --- hw/pci/pci.c | 10 ++ include/hw/pci/pci.h | 6 ++ 2 files changed, 16 insertions(+) diff --git

[RFC v3.1 17/22] intel_iommu: do not pass down pasid bind for PASID #0

2020-02-22 Thread Liu Yi L
l.org/lkml/2019/9/23/297 Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iom

[RFC v3.1 16/22] intel_iommu: replay pasid binds after context cache invalidation

2020-02-22 Thread Liu Yi L
: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 67 ++ hw/i386/intel_iommu_internal.h | 6 +++- hw/i386/trace-events | 1 + 3 files changed, 73 insertions(+), 1 deletion

[RFC v3.1 03/22] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-02-22 Thread Liu Yi L
VFIO needs to check VFIO_TYPE1_NESTING_IOMMU support with Kernel before further using it. e.g. requires to check IOMMU UAPI version. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L Signed-off-by: Yi Sun

[RFC v3.1 08/22] vfio/common: add pasid_alloc/free support

2020-02-22 Thread Liu Yi L
: Liu Yi L --- hw/vfio/common.c | 47 ++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index f9be68d..8f30a52 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1179,8 +1179,53 @@ static int

[RFC v3.1 01/22] scripts/update-linux-headers: Import iommu.h

2020-02-22 Thread Liu Yi L
From: Eric Auger Update the script to import the new iommu.h uapi header. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Acked-by: Cornelia Huck Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file

[RFC v3.1 09/22] hw/pci: add pci_device_host_iommu_context()

2020-02-22 Thread Liu Yi L
This patch adds pci_device_host_iommu_context() to expose HostIOMMUContext to vIOMMU emulators via pci layer. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Signed-off-by: Liu Yi L --- hw/pci/pci.c | 8 include

<    1   2   3   4   5   6   7   >