RE: [RFC v3 16/25] intel_iommu: add PASID cache management infrastructure

2020-02-15 Thread Liu, Yi L
> -Original Message- > From: Peter Xu > Sent: Thursday, February 13, 2020 11:14 PM > To: Liu, Yi L > Subject: Re: [RFC v3 16/25] intel_iommu: add PASID cache management > infrastructure > > On Thu, Feb 13, 2020 at 02:59:37AM +, Liu, Yi L wrote: > &g

RE: [RFC v3 14/25] intel_iommu: add virtual command capability support

2020-02-15 Thread Liu, Yi L
> From: Peter Xu < pet...@redhat.com > > Sent: Thursday, February 13, 2020 11:09 PM > To: Liu, Yi L > Subject: Re: [RFC v3 14/25] intel_iommu: add virtual command capability > support > > On Thu, Feb 13, 2020 at 09:31:10AM -0500, Peter Xu wrote: > > [...] >

RE: [RFC v3 03/25] hw/iommu: introduce IOMMUContext

2020-02-14 Thread Liu, Yi L
> From: David Gibson < da...@gibson.dropbear.id.au > > Sent: Friday, February 14, 2020 1:36 PM > To: Liu, Yi L > Subject: Re: [RFC v3 03/25] hw/iommu: introduce IOMMUContext > > On Wed, Feb 12, 2020 at 07:15:13AM +, Liu, Yi L wrote: > > Hi Peter, > &

RE: [RFC v3 16/25] intel_iommu: add PASID cache management infrastructure

2020-02-12 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 11:26 PM > To: Liu, Yi L > Subject: Re: [RFC v3 16/25] intel_iommu: add PASID cache management > infrastructure > > On Wed, Feb 12, 2020 at 08:37:30AM +, Liu, Yi L wrote: > > > From: Peter Xu > > &g

RE: [RFC v3 03/25] hw/iommu: introduce IOMMUContext

2020-02-12 Thread Liu, Yi L
> From: Peter Xu > Sent: Thursday, February 13, 2020 12:00 AM > To: Liu, Yi L > Subject: Re: [RFC v3 03/25] hw/iommu: introduce IOMMUContext > > On Wed, Feb 12, 2020 at 07:15:13AM +, Liu, Yi L wrote: > > [...] > > > While considering your suggestion on

RE: [RFC v3 13/25] intel_iommu: modify x-scalable-mode to be string option

2020-02-12 Thread Liu, Yi L
> From: Peter Xu > Sent: Thursday, February 13, 2020 12:06 AM > To: Liu, Yi L > Subject: Re: [RFC v3 13/25] intel_iommu: modify x-scalable-mode to be string > option > > On Wed, Feb 12, 2020 at 07:28:24AM +, Liu, Yi L wrote: > > > From: Peter Xu > > &g

RE: [RFC v3 14/25] intel_iommu: add virtual command capability support

2020-02-12 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 5:57 AM > To: Liu, Yi L > Subject: Re: [RFC v3 14/25] intel_iommu: add virtual command capability > support > > On Wed, Jan 29, 2020 at 04:16:45AM -0800, Liu, Yi L wrote: > > +/* > > + * The basic idea is

RE: [RFC v3 16/25] intel_iommu: add PASID cache management infrastructure

2020-02-12 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 7:36 AM > To: Liu, Yi L > Subject: Re: [RFC v3 16/25] intel_iommu: add PASID cache management > infrastructure > > On Wed, Jan 29, 2020 at 04:16:47AM -0800, Liu, Yi L wrote: > > From: Liu Yi L > >

RE: [RFC v3 15/25] intel_iommu: process pasid cache invalidation

2020-02-11 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 4:17 AM > To: Liu, Yi L > Subject: Re: [RFC v3 15/25] intel_iommu: process pasid cache invalidation > > On Wed, Jan 29, 2020 at 04:16:46AM -0800, Liu, Yi L wrote: > > From: Liu Yi L > > > > This patch ad

RE: [RFC v3 14/25] intel_iommu: add virtual command capability support

2020-02-11 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 4:16 AM > To: Liu, Yi L > Subject: Re: [RFC v3 14/25] intel_iommu: add virtual command capability > support > > On Wed, Jan 29, 2020 at 04:16:45AM -0800, Liu, Yi L wrote: > > From: Liu Yi L > > > >

RE: [RFC v3 13/25] intel_iommu: modify x-scalable-mode to be string option

2020-02-11 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 3:44 AM > To: Liu, Yi L > Subject: Re: [RFC v3 13/25] intel_iommu: modify x-scalable-mode to be string > option > > On Wed, Jan 29, 2020 at 04:16:44AM -0800, Liu, Yi L wrote: > > From: Liu Yi L > > >

RE: [RFC v3 12/25] vfio/common: add pasid_alloc/free support

2020-02-11 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 3:32 AM > To: Liu, Yi L > Subject: Re: [RFC v3 12/25] vfio/common: add pasid_alloc/free support > > On Wed, Jan 29, 2020 at 04:16:43AM -0800, Liu, Yi L wrote: > > From: Liu Yi L > > > > This patch adds VF

RE: [RFC v3 11/25] vfio: get stage-1 pasid formats from Kernel

2020-02-11 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 3:30 AM > To: Liu, Yi L > Subject: Re: [RFC v3 11/25] vfio: get stage-1 pasid formats from Kernel > > On Wed, Jan 29, 2020 at 04:16:42AM -0800, Liu, Yi L wrote: > > From: Liu Yi L > > > > VFIO checks IOM

RE: [RFC v3 09/25] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-02-11 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, February 12, 2020 3:08 AM > Subject: Re: [RFC v3 09/25] vfio: check VFIO_TYPE1_NESTING_IOMMU support > > On Wed, Jan 29, 2020 at 04:16:40AM -0800, Liu, Yi L wrote: > > From: Liu Yi L > > > > VFIO needs to check VFIO_TYPE1_

RE: [RFC v3 03/25] hw/iommu: introduce IOMMUContext

2020-02-11 Thread Liu, Yi L
Hi Peter, > From: Peter Xu > Sent: Wednesday, February 12, 2020 12:59 AM > To: Liu, Yi L > Subject: Re: [RFC v3 03/25] hw/iommu: introduce IOMMUContext > > On Fri, Jan 31, 2020 at 11:42:13AM +, Liu, Yi L wrote: > > > I'm not very clear on the relation

RE: [RFC v3 07/25] header file update VFIO/IOMMU vSVA APIs

2020-01-31 Thread Liu, Yi L
> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Cornelia Huck > Sent: Wednesday, January 29, 2020 8:29 PM > To: Liu, Yi L > Subject: Re: [RFC v3 07/25] header file update VFIO/IOMMU vSVA APIs > > On Wed, 29 Jan 2020 04:16:38 -0800

RE: [RFC v3 02/25] hw/iommu: introduce DualStageIOMMUObject

2020-01-31 Thread Liu, Yi L
Hi David, > From: David Gibson [mailto:da...@gibson.dropbear.id.au] > Sent: Friday, January 31, 2020 11:59 AM > To: Liu, Yi L > Subject: Re: [RFC v3 02/25] hw/iommu: introduce DualStageIOMMUObject > > On Wed, Jan 29, 2020 at 04:16:33AM -0800, Liu, Yi L wrote:

RE: [RFC v3 03/25] hw/iommu: introduce IOMMUContext

2020-01-31 Thread Liu, Yi L
Hi David, > From: David Gibson [mailto:da...@gibson.dropbear.id.au] > Sent: Friday, January 31, 2020 12:07 PM > To: Liu, Yi L > Subject: Re: [RFC v3 03/25] hw/iommu: introduce IOMMUContext > > On Wed, Jan 29, 2020 at 04:16:34AM -0800, Liu, Yi L wrote: > > From: Peter Xu

RE: [RFC v3 06/25] scripts/update-linux-headers: Import iommu.h

2020-01-31 Thread Liu, Yi L
> From: Cornelia Huck [mailto:coh...@redhat.com] > Sent: Wednesday, January 29, 2020 8:25 PM > To: Liu, Yi L > Subject: Re: [RFC v3 06/25] scripts/update-linux-headers: Import iommu.h > > On Wed, 29 Jan 2020 04:16:37 -0800 > "Liu, Yi L" wrote: > > > Fro

[RFC v3 23/25] intel_iommu: process PASID-based iotlb invalidation

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds the basic PASID-based iotlb (piotlb) invalidation support. piotlb is used during walking Intel VT-d 1st level page table. This patch only adds the basic processing. Detailed handling will be added in next patch. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi

[RFC v3 21/25] intel_iommu: do not pass down pasid bind for PASID #0

2020-01-29 Thread Liu, Yi L
From: Liu Yi L RID_PASID field was introduced in VT-d 3.0 spec, it is used for DMA requests w/o PASID in scalable mode VT-d. It is also known as IOVA. And in VT-d 3.1 spec, there is definition on it: "Implementations not supporting RID_PASID capability (ECAP_REG.RPS is 0b), use a PASID

[RFC v3 25/25] intel_iommu: process PASID-based Device-TLB invalidation

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds an empty handling for PASID-based Device-TLB invalidation. For now it is enough as it is not necessary to propagate it to host for passthru device and also there is no emulated device has device tlb. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc

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

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds flush_stage1_cache() definition in DualStageIOMMUOops. And adds corresponding implementation in VFIO. This is to expose a way for vIOMMU to flush stage-1 cache in host side since guest owns stage-1 translation structures in dual stage DMA translation. Cc: Kevin

[RFC v3 16/25] intel_iommu: add PASID cache management infrastructure

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds a PASID cache management infrastructure based on new added structure VTDPASIDAddressSpace, which is used to track the PASID usage and future PASID tagged DMA address translation support in vIOMMU. struct VTDPASIDAddressSpace { VTDBus *vtd_bus

[RFC v3 20/25] intel_iommu: replay pasid binds after context cache invalidation

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch replays guest pasid bindings after context cache invalidation. This is a behavior to ensure safety. Actually, programmer should issue pasid cache invalidation with proper granularity after issuing a context cache invalidation. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter

[RFC v3 17/25] vfio: add bind stage-1 page table support

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds bind_stage1_pgtbl() definition in DualStageIOMMUOops, also adds corresponding implementation in VFIO. This is to expose a way for vIOMMU to setup dual stage DMA translation for passthru devices on hardware. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric

[RFC v3 15/25] intel_iommu: process pasid cache invalidation

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds PASID cache invalidation handling. When guest enabled PASID usages (e.g. SVA), guest software should issue a proper PASID cache invalidation when caching-mode is exposed. This patch only adds the draft handling of pasid cache invalidation. Detailed handling

[RFC v3 11/25] vfio: get stage-1 pasid formats from Kernel

2020-01-29 Thread Liu, Yi L
From: Liu Yi L VFIO checks IOMMU UAPI version when it finds Kernel supports VFIO_TYPE1_NESTING_IOMMU. It is enough for UAPI compatibility check. However, IOMMU UAPI may support multiple stage-1 pasid formats in a specific UAPI version, which is highly possible since IOMMU UAPI supports stage-1

[RFC v3 18/25] intel_iommu: bind/unbind guest page table to host

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch captures the guest PASID table entry modifications and propagates the changes to host to setup dual stage DMA translation. The guest page table is configured as 1st level page table (GVA->GPA) whose translation result would further go through host VT-d 2nd level p

[RFC v3 13/25] intel_iommu: modify x-scalable-mode to be string option

2020-01-29 Thread Liu, Yi L
From: Liu Yi L Intel VT-d 3.0 introduces scalable mode, and it has a bunch of capabilities related to scalable mode translation, thus there are multiple combinations. While this vIOMMU implementation wants simplify it for user by providing typical combinations. User could config it by &q

[RFC v3 24/25] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch propagates PASID-based iotlb invalidation to host. Intel VT-d 3.0 supports nested translation in PASID granular. Guest SVA support could be implemented by configuring nested translation on specific PASID. This is also known as dual stage DMA translation. Under

[RFC v3 12/25] vfio/common: add pasid_alloc/free support

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds VFIO pasid alloc/free support to allow host intercept in PASID allocation for VM by adding VFIO implementation of DualStageIOMMUOps.pasid_alloc/free callbacks. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex

[RFC v3 10/25] vfio: register DualStageIOMMUObject to vIOMMU

2020-01-29 Thread Liu, Yi L
From: Liu Yi L After confirming dual stage DMA translation support with kernel by checking VFIO_TYPE1_NESTING_IOMMU, VFIO could register DualStageIOMMUObject instance to vIOMMU, thus that vIOMMU is aware of such hardware capability. vIOMMU may make use of such capability by leveraging the ops

[RFC v3 02/25] hw/iommu: introduce DualStageIOMMUObject

2020-01-29 Thread Liu, Yi L
From: Liu Yi L Currently, many platform vendors provide the capability of dual stage DMA address translation in hardware. For example, nested translation on Intel VT-d scalable mode, nested stage translation on ARM SMMUv3, and etc. In dual stage DMA address translation, there are two stages

[RFC v3 19/25] intel_iommu: replay guest pasid bindings to host

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds guest pasid bindings replay for domain selective pasid cache invalidation(dsi) and global pasid cache invalidation by walking guest pasid table. Reason: Guest OS may flush the pasid cache with a larger granularity. e.g. guest does a svm_bind() but flush the pasid

[RFC v3 01/25] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch modifies pci_setup_iommu() to set PCIIOMMUOps instead of setting PCIIOMMUFunc. PCIIOMMUFunc is used to get an address space for a PCI device in vendor specific way. The PCIIOMMUOps still offers this functionality. But using PCIIOMMUOps leaves space to add more iommu

[RFC v3 08/25] vfio: pass IOMMUContext into vfio_get_group()

2020-01-29 Thread Liu, Yi L
From: Liu Yi L IOMMUContext provides an explicit way for VFIO to talk with vIOMMU. This patch passes IOMMUContext instance into vfio_get_group() for the reason of potential VFIO_TYPE1_NESTING_IOMMU configuration as such configuration requires interaction with vIOMMU. Cc: Kevin Tian Cc: Jacob

[RFC v3 05/25] intel_iommu: provide get_iommu_context() callback

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds get_iommu_context() callback to return an iommu_context Intel VT-d platform. 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 | 92

[RFC v3 03/25] hw/iommu: introduce IOMMUContext

2020-01-29 Thread Liu, Yi L
Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Peter Xu Signed-off-by: Liu Yi L --- hw/iommu/Makefile.objs | 1 + hw/iommu/iommu_context.c | 54 +++ include/hw/iommu/iommu_context.h | 61

[RFC v3 14/25] intel_iommu: add virtual command capability support

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds virtual command support to Intel vIOMMU per Intel VT-d 3.1 spec. And adds two virtual commands: allocate pasid and free pasid. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off

[RFC v3 04/25] hw/pci: introduce pci_device_iommu_context()

2020-01-29 Thread Liu, Yi L
From: Liu Yi L This patch adds pci_device_iommu_context() to get an iommu_context for a given device. A new callback is added in PCIIOMMUOps. Users who wants to call into vIOMMU could leaverage it. And further vIOMMU operation could be done via IOMMUContext. Note: Previous version has got

[RFC v3 06/25] scripts/update-linux-headers: Import iommu.h

2020-01-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 Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1

[RFC v3 00/25] intel_iommu: expose Shared Virtual Addressing to VMs

2020-01-29 Thread Liu, Yi L
tioned in RFC v1. RFC v1: https://patchwork.kernel.org/cover/11033657/ Eric Auger (1): scripts/update-linux-headers: Import iommu.h Liu Yi L (23): hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps hw/iommu: introduce DualStageIOMMUObject hw/pci: introduce pci_device_iommu_context() inte

[RFC v3 07/25] header file update VFIO/IOMMU vSVA APIs

2020-01-29 Thread Liu, Yi L
From: Liu Yi L The kernel uapi/linux/iommu.h header file includes the extensions for vSVA support. e.g. bind gpasid, iommu fault report related user structures and etc. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Signed

[RFC v3 09/25] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-01-29 Thread Liu, Yi L
From: 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

[PATCH v1 1/2] intel_iommu: a fix to vtd_find_as_from_bus_num()

2020-01-03 Thread Liu Yi L
Ensure the return value of vtd_find_as_from_bus_num() is NULL by enforcing vtd_bus=NULL. This would help caller of vtd_find_as_from_bus_num() to decide if any further operation on the returned vtd_bus. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L Signed-off

[PATCH v1 0/2] intel_iommu: two fixes to intel scalable vIOMMU

2020-01-03 Thread Liu Yi L
These two fixes are found in vSVA implementation, and could be upstreamed separately. Please feel free give your comments. Thanks, Yi Liu Liu Yi L (2): intel_iommu: a fix to vtd_find_as_from_bus_num() intel_iommu: add present bit check for pasid table entries hw/i386/intel_iommu.c

[PATCH v1 2/2] intel_iommu: add present bit check for pasid table entries

2020-01-03 Thread Liu Yi L
: Peter Xu Cc: Yi Sun Reviewed-by: Peter Xu Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 92 +- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 74 insertions(+), 19 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iom

Re: about QEMU release schedule

2019-12-06 Thread Liu, Yi L
>> On Dec 6, 2019, at 17:57, Peter Maydell wrote: >> >> On Fri, 6 Dec 2019 at 04:00, Liu, Yi L wrote: >> Hi Peter, >> I’m wondering what’s the rule of QEMU version naming and release. >> I noticed there is a v3.1.1.1 released after v4.1.0 was released.

RE: [RFC v2 09/22] vfio/pci: add iommu_context notifier for pasid alloc/free

2019-11-25 Thread Liu, Yi L
Hi David, > From: David Gibson < da...@gibson.dropbear.id.au> > Sent: Wednesday, November 20, 2019 12:28 PM > To: Liu, Yi L > Subject: Re: [RFC v2 09/22] vfio/pci: add iommu_context notifier for pasid > alloc/free > > On Wed, Nov 06, 2019 at 12:14:50PM +, Liu, Yi

RE: [RFC v2 10/22] intel_iommu: add virtual command capability support

2019-11-11 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, November 6, 2019 10:01 PM > To: Liu, Yi L > Subject: Re: [RFC v2 10/22] intel_iommu: add virtual command capability > support > > On Wed, Nov 06, 2019 at 12:40:41PM +, Liu, Yi L wrote: > > > > > > Do you know wha

RE: [RFC v2 09/22] vfio/pci: add iommu_context notifier for pasid alloc/free

2019-11-06 Thread Liu, Yi L
> From: Peter Xu > Sent: Saturday, November 2, 2019 1:26 AM > To: David Gibson > Subject: Re: [RFC v2 09/22] vfio/pci: add iommu_context notifier for pasid > alloc/free > > On Tue, Oct 29, 2019 at 01:15:44PM +0100, David Gibson wrote: > > > +union IOMMUCTXPASIDReqDesc { > > > +struct { > >

RE: [RFC v2 10/22] intel_iommu: add virtual command capability support

2019-11-06 Thread Liu, Yi L
> From: Peter Xu > Sent: Saturday, November 2, 2019 2:06 AM > To: Liu, Yi L > Subject: Re: [RFC v2 10/22] intel_iommu: add virtual command capability > support > > On Thu, Oct 24, 2019 at 08:34:31AM -0400, Liu Yi L wrote: > > This patch adds virtual command support to

RE: [RFC v2 14/22] vfio/pci: add iommu_context notifier for pasid bind/unbind

2019-11-06 Thread Liu, Yi L
> From: David Gibson > Sent: Tuesday, November 5, 2019 12:02 AM > To: Liu, Yi L > Subject: Re: [RFC v2 14/22] vfio/pci: add iommu_context notifier for pasid > bind/unbind > > On Thu, Oct 24, 2019 at 08:34:35AM -0400, Liu Yi L wrote: > > This patch adds notifier

RE: [RFC v2 09/22] vfio/pci: add iommu_context notifier for pasid alloc/free

2019-11-06 Thread Liu, Yi L
> From: David Gibson [mailto:da...@gibson.dropbear.id.au] > Sent: Tuesday, October 29, 2019 8:16 PM > To: Liu, Yi L > Subject: Re: [RFC v2 09/22] vfio/pci: add iommu_context notifier for pasid > alloc/free > > On Thu, Oct 24, 2019 at 08:34:30AM -0400, Liu Yi L wrote: >

RE: [RFC v2 04/22] hw/iommu: introduce IOMMUContext

2019-11-06 Thread Liu, Yi L
> From: David Gibson [mailto:da...@gibson.dropbear.id.au] > Sent: Monday, October 28, 2019 1:39 AM > To: Liu, Yi L > Subject: Re: [RFC v2 04/22] hw/iommu: introduce IOMMUContext > > On Thu, Oct 24, 2019 at 08:34:25AM -0400, Liu Yi L wrote: > > From: Peter Xu > > &g

RE: [RFC v2 05/22] vfio/common: add iommu_ctx_notifier in container

2019-11-06 Thread Liu, Yi L
> From: Peter Xu > Sent: Friday, November 1, 2019 10:59 PM > To: Liu, Yi L > Subject: Re: [RFC v2 05/22] vfio/common: add iommu_ctx_notifier in container > > On Thu, Oct 24, 2019 at 08:34:26AM -0400, Liu Yi L wrote: > > [...] > > > +typedef struct VFIOIOMM

RE: [RFC v2 08/22] intel_iommu: provide get_iommu_context() callback

2019-11-06 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, November 1, 2019 10:55 PM > To: Liu, Yi L > Subject: Re: [RFC v2 08/22] intel_iommu: provide get_iommu_context() callback > > On Thu, Oct 24, 2019 at 08:34:29AM -0400, Liu Yi L wrote: > > This patch adds get_

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

2019-11-06 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, November 5, 2019 8:50 PM > To: Liu, Yi L > Subject: Re: [RFC v2 03/22] intel_iommu: modify x-scalable-mode to be string > option > > On Tue, Nov 05, 2019 at 09:14:08AM +, Liu, Yi L wrote: > > > Som

RE: [RFC v2 07/22] hw/pci: introduce pci_device_iommu_context()

2019-11-06 Thread Liu, Yi L
> From: David Gibson > Sent: Tuesday, October 29, 2019 7:51 PM > To: Liu, Yi L > Subject: Re: [RFC v2 07/22] hw/pci: introduce pci_device_iommu_context() > > On Thu, Oct 24, 2019 at 08:34:28AM -0400, Liu Yi L wrote: > > This patch adds pci_device_iommu_context()

RE: [RFC v2 06/22] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2019-11-06 Thread Liu, Yi L
> From: David Gibson > Sent: Monday, October 28, 2019 1:44 AM > To: Liu, Yi L > Subject: Re: [RFC v2 06/22] hw/pci: modify pci_setup_iommu() to set > PCIIOMMUOps > > On Thu, Oct 24, 2019 at 08:34:27AM -0400, Liu Yi L wrote: > > This patch modifies pci_setup_iommu()

RE: [RFC v2 06/22] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2019-11-06 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Saturday, November 2, 2019 2:09 AM > To: Liu, Yi L > Subject: Re: [RFC v2 06/22] hw/pci: modify pci_setup_iommu() to set > PCIIOMMUOps > > On Thu, Oct 24, 2019 at 08:34:27AM -0400, Liu Yi L wrote: > > This pat

RE: [RFC v2 12/22] intel_iommu: add present bit check for pasid table entries

2019-11-06 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Sunday, November 3, 2019 12:21 AM > To: Liu, Yi L > Subject: Re: [RFC v2 12/22] intel_iommu: add present bit check for pasid table > entries > > On Thu, Oct 24, 2019 at 08:34:33AM -0400, Liu Yi L wrote: > > The presen

RE: [RFC v2 07/22] hw/pci: introduce pci_device_iommu_context()

2019-11-06 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Saturday, November 2, 2019 2:10 AM > To: Liu, Yi L > Subject: Re: [RFC v2 07/22] hw/pci: introduce pci_device_iommu_context() > > On Thu, Oct 24, 2019 at 08:34:28AM -0400, Liu Yi L wrote: > > This patch adds pci_devic

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

2019-11-06 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, November 5, 2019 4:26 AM > To: Liu, Yi L > Subject: Re: [RFC v2 15/22] intel_iommu: bind/unbind guest page table to host > > On Thu, Oct 24, 2019 at 08:34:36AM -0400, Liu Yi L wrote: > > This patch captures the

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

2019-11-05 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, November 5, 2019 4:07 AM > To: Liu, Yi L > Subject: Re: [RFC v2 13/22] intel_iommu: add PASID cache management > infrastructure > > On Thu, Oct 24, 2019 at 08:34:34AM -0400, Liu Yi L wrote: > > This patch ad

RE: [RFC v2 11/22] intel_iommu: process pasid cache invalidation

2019-11-05 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Sunday, November 3, 2019 12:06 AM > To: Liu, Yi L > Subject: Re: [RFC v2 11/22] intel_iommu: process pasid cache invalidation > > On Thu, Oct 24, 2019 at 08:34:32AM -0400, Liu Yi L wrote: > > This patch adds PASID cac

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

2019-11-05 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, November 1, 2019 10:58 PM > To: Liu, Yi L > Subject: Re: [RFC v2 03/22] intel_iommu: modify x-scalable-mode to be string > option > > On Thu, Oct 24, 2019 at 08:34:24AM -0400, Liu Yi L wrote: > > Intel VT-d 3

RE: [RFC v2 00/22] intel_iommu: expose Shared Virtual Addressing to VM

2019-11-05 Thread Liu, Yi L
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, November 5, 2019 1:23 AM > To: Liu, Yi L > Subject: Re: [RFC v2 00/22] intel_iommu: expose Shared Virtual Addressing to > VM > > On Thu, Oct 24, 2019 at 08:34:21AM -0400, Liu Yi L wrote: > > Shared virtual a

RE: [RFC v2 00/22] intel_iommu: expose Shared Virtual Addressing to VM

2019-10-31 Thread Liu, Yi L
@redhat.com] > >> Sent: Friday, October 25, 2019 5:49 PM > >> > >> > >> On 2019/10/24 下午8:34, Liu Yi L wrote: > >>> Shared virtual address (SVA), a.k.a, Shared virtual memory (SVM) on > >>> Intel platforms allow address space sharing

[RFC v2 22/22] intel_iommu: process PASID-based Device-TLB invalidation

2019-10-24 Thread Liu Yi L
This patch adds an empty handling for PASID-based Device-TLB invalidation. For now it is enough as it is not necessary to propagate it to host for passthru device and also there is no emulated device has device tlb. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L

[RFC v2 20/22] intel_iommu: process PASID-based iotlb invalidation

2019-10-24 Thread Liu Yi L
-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/intel_iommu.c index d621455..6cd922f 100644 --- a/hw/i386/intel_iommu.c

[RFC v2 19/22] vfio/pci: add iommu_context notifier for PASID-based iotlb flush

2019-10-24 Thread Liu Yi L
This patch adds notifier for propagating guest PASID-based iotlb invalidation to host. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Liu Yi L --- hw/vfio/pci.c| 29 + include/hw/iommu/iommu.h

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

2019-10-24 Thread Liu Yi L
under nested translation mode. This is a key part of vSVA support. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 81 ++ hw/i386/intel_iommu_internal.h | 20 +++ 2 files change

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

2019-10-24 Thread Liu Yi L
mode support, if not proper configured, will throw error Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L Signed-off-by: Yi Sun --- hw/i386/intel_iommu.c | 15 +-- hw/i386/intel_iommu_internal.h | 3 +++ include/hw/i386/intel_iommu.h | 2

[RFC v2 09/22] vfio/pci: add iommu_context notifier for pasid alloc/free

2019-10-24 Thread Liu Yi L
This patch adds pasid alloc/free notifiers for vfio-pci. It is supposed to be fired by vIOMMU. VFIO then sends PASID allocation or free request to host. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Liu Yi L --- hw/vfio/common.c

[RFC v2 21/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2019-10-24 Thread Liu Yi L
first level page table related mappings during DMA address translation. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 127 + hw/i386/intel_iommu_internal.h | 7 +++ 2 files change

[RFC v2 18/22] intel_iommu: do not passdown pasid bind for PASID #0

2019-10-24 Thread Liu Yi L
Jacob Pan Cc: Peter Xu Cc: Yi Sun 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_iommu.c index 6bceb7f..d621455 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1880,

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

2019-10-24 Thread Liu Yi L
pasid entry to be a present entry *) a non-present pasid entry moved to present vIOMMU emulator could figure out the reason by fetching latest guest pasid entry. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 356

[RFC v2 12/22] intel_iommu: add present bit check for pasid table entries

2019-10-24 Thread Liu Yi L
: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 92 +- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 74 insertions(+), 19 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 84ff6f0..90b8

[RFC v2 08/22] intel_iommu: provide get_iommu_context() callback

2019-10-24 Thread Liu Yi L
This patch adds get_iommu_context() callback to return an iommu_context Intel VT-d platform. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 57 ++- include/hw/i386/intel_iommu.h | 14

[RFC v2 07/22] hw/pci: introduce pci_device_iommu_context()

2019-10-24 Thread Liu Yi L
from vIOMMU. e.g. VFIO is the first user of it to listen to the PASID_ALLOC/PASID_BIND/CACHE_INV events and propagate the events to host. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Liu Yi L --- hw/pci/pci.c | 16

[RFC v2 06/22] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2019-10-24 Thread Liu Yi L
specific operations. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Liu Yi L --- hw/alpha/typhoon.c | 6 +- hw/arm/smmu-common.c | 6 +- hw/hppa/dino.c | 6 +- hw/i386/amd_iommu.c | 6 +- hw

[RFC v2 00/22] intel_iommu: expose Shared Virtual Addressing to VM

2019-10-24 Thread Liu Yi L
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): update-linux-headers: Import iommu.h Liu Yi L (

[RFC v2 17/22] intel_iommu: replay pasid binds after context cache invalidation

2019-10-24 Thread Liu Yi L
Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 68 ++ hw/i386/intel_iommu_internal.h | 3 ++ hw/i386/trace-events | 1 + 3 files changed, 72 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index a9e660c

[RFC v2 11/22] intel_iommu: process pasid cache invalidation

2019-10-24 Thread Liu Yi L
in subsequent patches. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 66 ++ hw/i386/intel_iommu_internal.h | 12 hw/i386/trace-events | 3 ++ 3 files changed, 76 insertions

[RFC v2 02/22] header update VFIO/IOMMU vSVA APIs against 5.4.0-rc3+

2019-10-24 Thread Liu Yi L
The kernel iommu.h header file includes the extensions for vSVA support. e.g. guest PASID bind, iommu fault report related user structures etc. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L --- linux-headers/linux/iommu.h | 324

[RFC v2 05/22] vfio/common: add iommu_ctx_notifier in container

2019-10-24 Thread Liu Yi L
This patch adds a list in VFIOContainer to store iommu_ctx_notifier which is based on IOMMUContext. As a preparation of registering iommu_ctx_notifiers. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Liu Yi L --- hw/vfio/common.c

[RFC v2 16/22] intel_iommu: replay guest pasid bindings to host

2019-10-24 Thread Liu Yi L
Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 160 + hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 149 insertions(+), 12 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 793b0de..a9e660c 100644 --- a/hw

[RFC v2 10/22] intel_iommu: add virtual command capability support

2019-10-24 Thread Liu Yi L
This patch adds virtual command support to Intel vIOMMU per Intel VT-d 3.1 spec. And adds two virtual commands: alloc_pasid and free_pasid. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L Signed-off-by: Yi Sun --- hw/i386/intel_iommu.c | 162

[RFC v2 14/22] vfio/pci: add iommu_context notifier for pasid bind/unbind

2019-10-24 Thread Liu Yi L
Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Liu Yi L --- hw/vfio/pci.c| 39 +++ include/hw/iommu/iommu.h | 11 +++ 2 files changed, 50 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8721ff6..012b8ed 100644

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

2019-10-24 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 Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh

[RFC v2 04/22] hw/iommu: introduce IOMMUContext

2019-10-24 Thread Liu Yi L
. For more background, may refer to the discussion below: https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg05022.html Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Signed-off-by: Peter Xu Signed-off-by: Liu Yi L --- hw/Makefile.objs | 1

Re: [Qemu-devel] [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation

2019-07-25 Thread Liu, Yi L
Hi Eric, > -Original Message- > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: Wednesday, July 24, 2019 5:33 PM > To: Liu, Yi L ; David Gibson > Subject: Re: [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation > > Hi Yi, David, > > On 7/24/

Re: [Qemu-devel] [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation

2019-07-23 Thread Liu, Yi L
> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of David Gibson > Sent: Tuesday, July 23, 2019 11:58 AM > To: Liu, Yi L > Subject: Re: [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation > > On Mon, Jul 22, 2019 at 07:02:51AM +

Re: [Qemu-devel] [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation

2019-07-22 Thread Liu, Yi L
> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of David Gibson > Sent: Wednesday, July 17, 2019 11:07 AM > To: Liu, Yi L > Subject: Re: [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation > > On Tue, Jul 16, 2019 at 10:25:55AM +

Re: [Qemu-devel] [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation

2019-07-16 Thread Liu, Yi L
> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of David Gibson > Sent: Monday, July 15, 2019 10:55 AM > To: Liu, Yi L > Subject: Re: [RFC v1 05/18] vfio/pci: add pasid alloc/free implementation > > On Fri, Jul 05, 2019 at 07:01:38PM

Re: [Qemu-devel] [RFC v1 11/18] intel_iommu: create VTDAddressSpace per BDF+PASID

2019-07-11 Thread Liu, Yi L
> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Peter Xu > Sent: Tuesday, July 9, 2019 2:39 PM > To: Liu, Yi L > Subject: Re: [RFC v1 11/18] intel_iommu: create VTDAddressSpace per BDF+PASID > > On Fri, Jul 05, 2019 at 07:01:44PM

Re: [Qemu-devel] [RFC v1 10/18] intel_iommu: tag VTDAddressSpace instance with PASID

2019-07-11 Thread Liu, Yi L
> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Peter Xu > Sent: Tuesday, July 9, 2019 2:13 PM > To: Liu, Yi L > Subject: Re: [RFC v1 10/18] intel_iommu: tag VTDAddressSpace instance with > PASID > > On Fri, Jul 05, 2019 at 07:01:43

Re: [Qemu-devel] [RFC v1 03/18] hw/pci: introduce PCIPASIDOps to PCIDevice

2019-07-11 Thread Liu, Yi L
> From: da...@gibson.dropbear.id.au [mailto:da...@gibson.dropbear.id.au] > Sent: Thursday, July 11, 2019 11:52 AM > To: Liu, Yi L > Subject: Re: [RFC v1 03/18] hw/pci: introduce PCIPASIDOps to PCIDevice > > On Wed, Jul 10, 2019 at 11:08:15AM +, Liu, Yi L wrote: &g

<    1   2   3   4   5   6   7   >