RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

2024-05-19 Thread Liu, Yi L
> From: Duan, Zhenzhong > Sent: Monday, May 20, 2024 11:41 AM > > > > >-Original Message- > >From: Jason Wang > >Sent: Monday, May 20, 2024 8:44 AM > >To: Duan, Zhenzhong > >Cc: qemu-devel@nongnu.org; Liu, Yi L ; Peng, Chao P > >

RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

2024-05-18 Thread Liu, Yi L
> From: CLEMENT MATHIEU--DRIF > Sent: Friday, May 17, 2024 9:13 PM > > Hi Zhenzhong > > On 17/05/2024 12:23, Zhenzhong Duan wrote: > > Caution: External email. Do not open attachments or click links, unless > > this email > comes from a known sender and you know the content is safe. > > > > >

RE: [PATCH] intel_iommu: Optimize out some unnecessary UNMAP calls

2023-05-26 Thread Liu, Yi L
> From: Jason Wang > Sent: Friday, May 26, 2023 2:28 PM > > On Fri, May 26, 2023 at 2:22 PM Duan, Zhenzhong > wrote: > > > > > > >-Original Message- > > >From: Peter Xu > > >Sent: Thursday, May 25, 2023 9:54 PM > > >Subject: Re: [PATCH] intel_iommu: Optimize out some unnecessary UNMAP

Re: [PATCH 3/3] intel-iommu: PASID support

2022-01-14 Thread Liu Yi L
On 2022/1/14 15:22, Jason Wang wrote: On Fri, Jan 14, 2022 at 3:13 PM Peter Xu wrote: On Fri, Jan 14, 2022 at 01:58:07PM +0800, Jason Wang wrote: Right, but I think you meant to do this only when scalable mode is disabled. Yes IMHO it will definitely suite for !scalable case since that's

RE: [PATCH] docs: fix section numbering in pcie.txt

2021-11-30 Thread Liu, Yi L
> From: Qemu-devel > On Behalf Of Ani Sinha > Sent: Wednesday, December 1, 2021 2:43 PM > > There is no 5.2 section. Section 5.3 should really be 5.2. Fix it. Reviewed-by: Liu Yi L BTW. Is a fix tag needed? Regards, Yi Liu > Signed-off-by: Ani Sinha > --- > docs/p

RE: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-28 Thread Liu, Yi L
> From: Peter Xu > Sent: Monday, November 29, 2021 11:14 AM > > On Mon, Nov 29, 2021 at 10:28:42AM +0800, Jason Wang wrote: > > > > And in the future, it could be even more troublesome,e.g there's one > > day we found another bit that needs not to be checked. Maybe we should > > even remove all

RE: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-27 Thread Liu, Yi L
> From: Peter Xu > Sent: Thursday, November 25, 2021 2:14 PM > > On Thu, Nov 25, 2021 at 05:49:38AM +0000, Liu, Yi L wrote: > > > From: Peter Xu > > > Sent: Thursday, November 25, 2021 12:31 PM > > > > > > On Thu, Nov 25, 2021 at 04:03:34AM

RE: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-24 Thread Liu, Yi L
> From: Jason Wang > Sent: Wednesday, November 24, 2021 4:29 PM > > On Wed, Nov 24, 2021 at 3:57 PM Peter Xu wrote: > > > > On Wed, Nov 24, 2021 at 02:03:09PM +0800, Jason Wang wrote: > > > When booting with scalable mode, I hit this error: > > > > > > qemu-system-x86_64: vtd_iova_to_slpte:

RE: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-24 Thread Liu, Yi L
> From: Jason Wang > Sent: Wednesday, November 24, 2021 5:35 PM > > On Wed, Nov 24, 2021 at 5:23 PM Peter Xu wrote: > > > > On Wed, Nov 24, 2021 at 05:01:42PM +0800, Jason Wang wrote: > > > > > > > -static bool vtd_slpte_nonzero_rsvd(uint64_t slpte, uint32_t > level) > > > > > > > +static bool

RE: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-24 Thread Liu, Yi L
> From: Peter Xu > Sent: Thursday, November 25, 2021 12:31 PM > > On Thu, Nov 25, 2021 at 04:03:34AM +0000, Liu, Yi L wrote: > > > From: Peter Xu > > > Sent: Wednesday, November 24, 2021 3:57 PM > > > > > > On Wed, Nov 24, 2021 at 02:03:09

RE: [PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-24 Thread Liu, Yi L
> From: Peter Xu > Sent: Wednesday, November 24, 2021 3:57 PM > > On Wed, Nov 24, 2021 at 02:03:09PM +0800, Jason Wang wrote: > > When booting with scalable mode, I hit this error: > > > > qemu-system-x86_64: vtd_iova_to_slpte: detected splte reserve non- > zero iova=0xf002,

RE: [PATCH] docs: Add '-device intel-iommu' entry

2021-07-07 Thread Liu, Yi L
options there, but I hide them explicitly > because > they shouldn't be used by normal QEMU users. yes, it's a good start. Looks good to me. Reviewed-by: Liu Yi L Regards, Yi Liu > > Cc: Chao Yang > Cc: Lei Yang > Cc: Jing Zhao > Cc: Jason Wang > Cc: Michael S. Tsi

[RFC v11 23/25] intel_iommu: propagate PASID-based iotlb invalidation to host

2021-03-02 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 --- rfcv4 (v1) ->

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

2021-03-02 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 | 24 include/hw/iommu

[RFC v11 16/25] intel_iommu: process PASID cache invalidation

2021-03-02 Thread Liu Yi L
in 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 --- rfcv4 (v1) -> rfcv5 (v2): *) remove vtd_pasid_cache_gsi(), vtd_pasid_cache_psi() and vtd_pasid_cache_

[RFC v11 15/25] intel_iommu: add virtual command capability support

2021-03-02 Thread Liu Yi L
-by: Liu Yi L Signed-off-by: Yi Sun --- rfcv10 -> rfcv11: *) use /dev/ioasid FD for pasid alloc/free, /dev/ioasid open is added in latter patch. --- hw/i386/intel_iommu.c | 141 + hw/i386/intel_iommu_internal.h | 37 + hw/i386/trace-eve

[RFC v11 13/25] vfio: init HostIOMMUContext per-container

2021-03-02 Thread Liu Yi L
could make use of the methods provided by host iommu context. e.g. propagate requests to host iommu. 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 | 135

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

2021-03-02 Thread Liu Yi L
: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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 915db7ad1f

[RFC v11 12/25] vfio: add HostIOMMUContext support

2021-03-02 Thread Liu Yi L
Signed-off-by: Liu Yi L --- hw/vfio/common.c | 70 +++ include/hw/iommu/host_iommu_context.h | 3 ++ include/hw/vfio/vfio-common.h | 3 ++ 3 files changed, 76 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 883815d5b0

[RFC v11 22/25] intel_iommu: process PASID-based iotlb invalidation

2021-03-02 Thread Liu Yi L
Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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

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

2021-03-02 Thread Liu Yi L
: no scalable 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 v11 11/25] intel_iommu: add set/unset_iommu_context callback

2021-03-02 Thread Liu Yi L
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 | 71 --- include/hw/i386/intel_iommu.h | 21 +-- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git

[RFC v11 10/25] hw/pci: introduce pci_device_set/unset_iommu_context()

2021-03-02 Thread Liu Yi L
ntext() to set/unset HostIOMMUContext for a given PCIe device (VFIO case). Caller of set should fail if set operation failed. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Reviewed-by: Peter Xu Signed-off-by: Liu Yi L ---

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

2021-03-02 Thread Liu Yi L
kernel.org/linux-iommu/20191219031634.15168-1-baolu...@linux.intel.com/ 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 c

[RFC v11 19/25] intel_iommu: replay pasid binds after context cache invalidation

2021-03-02 Thread Liu Yi L
: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 50 ++ hw/i386/intel_iommu_internal.h | 1 + hw/i386/trace-events | 1 + 3 files changed, 52 insertions(+) diff --git a/hw/i386

[RFC v11 07/25] vfio: pass nesting requirement into vfio_get_group()

2021-03-02 Thread Liu Yi L
This patch passes the nesting requirement into vfio_get_group() to indicate whether VFIO_TYPE1_NESTING_IOMMU is required. 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/ap.c | 2

[RFC v11 08/25] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2021-03-02 Thread Liu Yi L
Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L Signed-off-by: Eric Auger Signed-off-by: Yi Sun --- hw/vfio/common.c | 37 ++--- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 44097875e2..883815d5b0

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

2021-03-02 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

[RFC v11 17/25] intel_iommu: add PASID cache management infrastructure

2021-03-02 Thread Liu Yi L
-by: Liu Yi L --- rfcv4 (v1) -> rfcv5 (v2): *) merged this patch with former replay binding patch, makes PSI/DSI/GSI use the unified function to do cache invalidation and pasid binding replay. *) dropped pasid_cache_gen in both iommu_state and vtd_pasid_as as it is not necessary so far, we

[RFC v11 04/25] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2021-03-02 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 --- rfcv9 -> rfcv10: *) Fix a bug in pci_device_iommu_address_space() + iommu_

[RFC v11 02/25] scripts/update-linux-headers: Import ioasid.h

2021-03-02 Thread Liu Yi L
Update the script to import the new ioasid.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: Liu Yi L --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[RFC v11 09/25] hw/iommu: introduce HostIOMMUContext

2021-03-02 Thread Liu Yi L
l S. Tsirkin Signed-off-by: Liu Yi L --- rfcv10 -> rfcv11: *) removed pasid_alloc/free in HostIOMMUContextClass, define bind_stage1_pgtbl and unbind_stage1_pgtbl() as a start for HostIOMMUContextClass. rfcv9 -> rfcv10: *) adjust to meson build --- hw/Kconfig

[RFC v11 14/25] intel_iommu: sync IOMMU nesting cap info for assigned devices

2021-03-02 Thread Liu Yi L
. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 105 + hw/i386/intel_iommu_internal.h | 18 ++ include/hw/i386/intel_iommu.h | 4 ++ 3 files

[RFC v11 01/25] scripts/update-linux-headers: Import iommu.h

2021-03-02 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 Signed-off-by: Liu Yi L --- scripts/update-linux

[RFC v11 06/25] intel_iommu: add get_iommu_attr() callback

2021-03-02 Thread Liu Yi L
Return vIOMMU attribute to caller. e.g. VFIO call via PCI layer. 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 | 23 +++ 1 file changed, 23 insertions

[RFC v11 05/25] hw/pci: introduce pci_device_get_iommu_attr()

2021-03-02 Thread Liu Yi L
This patch adds pci_device_get_iommu_attr() to get vIOMMU attributes. e.g. if nesting IOMMU wanted. 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 | 35

[RFC v11 03/25] header file update VFIO/IOMMU vSVA APIs kernel 5.12-rc1

2021-03-02 Thread Liu Yi L
: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Michael S. Tsirkin Signed-off-by: Liu Yi L --- linux-headers/linux/iommu.h | 413 linux-headers/linux/vfio.h | 84 2 files changed, 497 insertions(+) create mode 100644 linux-headers/linux/iommu.h diff --git

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

2021-03-02 Thread Liu Yi L
anagement 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 (24): scripts/update-linux-headers: Import ioasid.h header file update VFIO/IOMMU vSVA

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

2020-09-10 Thread Liu Yi L
: no scalable 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 v10 16/25] vfio: add bind stage-1 page table support

2020-09-10 Thread Liu Yi L
Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 57 +- hw/vfio/common.c | 58 ++- include/hw/iommu/host_iommu_context.h | 19 +++- 3 files

[RFC v10 13/25] intel_iommu: add virtual command capability support

2020-09-10 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

[RFC v10 12/25] vfio: init HostIOMMUContext per-container

2020-09-10 Thread Liu Yi L
could make use the methods provided by host iommu context. e.g. propagate requests to host iommu. 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 | 113

[RFC v10 23/25] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-09-10 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 --- rfcv4 (v1) ->

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

2020-09-10 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

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

2020-09-10 Thread Liu Yi L
: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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 32b0029

[RFC v10 09/25] hw/pci: introduce pci_device_set/unset_iommu_context()

2020-09-10 Thread Liu Yi L
ntext() to set/unset HostIOMMUContext for a given PCIe device (VFIO case). Caller of set should fail if set operation failed. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Reviewed-by: Peter Xu Signed-off-by: Liu Yi L ---

[RFC v10 11/25] vfio/common: provide PASID alloc/free hooks

2020-09-10 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

[RFC v10 14/25] intel_iommu: process PASID cache invalidation

2020-09-10 Thread Liu Yi L
in 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 --- rfcv4 (v1) -> rfcv5 (v2): *) remove vtd_pasid_cache_gsi(), vtd_pasid_cache_psi() and vtd_pasid_cache_

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

2020-09-10 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 | 24 include/hw/iommu

[RFC v10 17/25] intel_iommu: sync IOMMU nesting cap info for assigned devices

2020-09-10 Thread Liu Yi L
. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 105 + hw/i386/intel_iommu_internal.h | 18 +++ include/hw/i386/intel_iommu.h | 4 ++ 3

[RFC v10 03/25] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2020-09-10 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 --- rfcv9 -> rfcv10: *) Fix a bug in pci_device_iommu_address_space() + iommu_

[RFC v10 10/25] intel_iommu: add set/unset_iommu_context callback

2020-09-10 Thread Liu Yi L
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 | 71 --- include/hw/i386/intel_iommu.h | 21 ++--- 2 files changed, 83 insertions(+), 9 deletions(-)

[RFC v10 01/25] scripts/update-linux-headers: Import iommu.h

2020-09-10 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

[RFC v10 15/25] intel_iommu: add PASID cache management infrastructure

2020-09-10 Thread Liu Yi L
-by: Liu Yi L --- rfcv4 (v1) -> rfcv5 (v2): *) merged this patch with former replay binding patch, makes PSI/DSI/GSI use the unified function to do cache invalidation and pasid binding replay. *) dropped pasid_cache_gen in both iommu_state and vtd_pasid_as as it is not necessary so far, we

[RFC v10 06/25] vfio: pass nesting requirement into vfio_get_group()

2020-09-10 Thread Liu Yi L
This patch passes the nesting requirement into vfio_get_group() to indicate whether VFIO_TYPE1_NESTING_IOMMU is required. 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/ap.c | 2

[RFC v10 08/25] hw/iommu: introduce HostIOMMUContext

2020-09-10 Thread Liu Yi L
ID in system-wide. 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 --- rfcv9 -> rfcv10: *) adjust to meson build --- hw/Kconfig| 3 ++ hw/iommu/Kconfig |

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

2020-09-10 Thread Liu Yi L
adding a new option as RFC v1 did. Refined the pasid cache management --- Eric Auger (1): scripts/update-linux-headers: Import iommu.h Liu Yi L (24): header file update VFIO/IOMMU vSVA APIs kernel 5.9-rc2 hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps hw/pci: introduce pci_device_g

[RFC v10 07/25] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-09-10 Thread Liu Yi L
Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L Signed-off-by: Eric Auger Signed-off-by: Yi Sun --- hw/vfio/common.c | 37 ++--- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 80d7a00..af91eca 100644

[RFC v10 05/25] intel_iommu: add get_iommu_attr() callback

2020-09-10 Thread Liu Yi L
Return vIOMMU attribute to caller. e.g. VFIO call via PCI layer. 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 | 23 +++ 1 file changed, 23 insertions

[RFC v10 02/25] header file update VFIO/IOMMU vSVA APIs kernel 5.9-rc2

2020-09-10 Thread Liu Yi L
be replaced with a full header files update when the vSVA uPAPI is stable. 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: Liu Yi L --- linux-headers/linux/iommu.h | 420

[RFC v10 22/25] intel_iommu: process PASID-based iotlb invalidation

2020-09-10 Thread Liu Yi L
Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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

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

2020-09-10 Thread Liu Yi L
kernel.org/linux-iommu/20191219031634.15168-1-baolu...@linux.intel.com/ 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 c

[RFC v10 04/25] hw/pci: introduce pci_device_get_iommu_attr()

2020-09-10 Thread Liu Yi L
This patch adds pci_device_get_iommu_attr() to get vIOMMU attributes. e.g. if nesting IOMMU wanted. 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 | 35

[RFC v10 19/25] intel_iommu: replay pasid binds after context cache invalidation

2020-09-10 Thread Liu Yi L
: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 50 ++ hw/i386/intel_iommu_internal.h | 1 + hw/i386/trace-events | 1 + 3 files changed, 52 insertions(+) diff --git a/hw

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

2020-07-28 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

[RFC v9 19/25] intel_iommu: replay pasid binds after context cache invalidation

2020-07-28 Thread Liu Yi L
: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 50 ++ hw/i386/intel_iommu_internal.h | 1 + hw/i386/trace-events | 1 + 3 files changed, 52 insertions(+) diff --git a/hw

[RFC v9 07/25] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-07-28 Thread Liu Yi L
Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L Signed-off-by: Eric Auger Signed-off-by: Yi Sun --- hw/vfio/common.c | 37 ++--- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 80d7a00..af91eca 100644

[RFC v9 15/25] intel_iommu: add PASID cache management infrastructure

2020-07-28 Thread Liu Yi L
-by: Liu Yi L --- rfcv4 (v1) -> rfcv5 (v2): *) merged this patch with former replay binding patch, makes PSI/DSI/GSI use the unified function to do cache invalidation and pasid binding replay. *) dropped pasid_cache_gen in both iommu_state and vtd_pasid_as as it is not necessary so far, we

[RFC v9 17/25] intel_iommu: sync IOMMU nesting cap info for assigned devices

2020-07-28 Thread Liu Yi L
. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 107 + hw/i386/intel_iommu_internal.h | 18 +++ include/hw/i386/intel_iommu.h | 4 ++ 3

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

2020-07-28 Thread Liu Yi L
: no scalable 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 v9 22/25] intel_iommu: process PASID-based iotlb invalidation

2020-07-28 Thread Liu Yi L
Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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

[RFC v9 23/25] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-07-28 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 --- rfcv4 (v1) ->

[RFC v9 08/25] hw/iommu: introduce HostIOMMUContext

2020-07-28 Thread Liu Yi L
ID in system-wide. 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/Makefile.objs| 1 + hw/iommu/host_iommu_context.c

[RFC v9 03/25] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2020-07-28 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 v9 20/25] intel_iommu: do not pass down pasid bind for PASID #0

2020-07-28 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

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

2020-07-28 Thread Liu Yi L
: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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 db4460a

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

2020-07-28 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 | 24 include/hw/iommu

[RFC v9 09/25] hw/pci: introduce pci_device_set/unset_iommu_context()

2020-07-28 Thread Liu Yi L
ntext() to set/unset HostIOMMUContext for a given PCIe device (VFIO case). Caller of set should fail if set operation failed. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Reviewed-by: Peter Xu Signed-off-by: Liu Yi L ---

[RFC v9 05/25] intel_iommu: add get_iommu_attr() callback

2020-07-28 Thread Liu Yi L
Return vIOMMU attribute to caller. e.g. VFIO call via PCI layer. 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 | 23 +++ 1 file changed, 23 insertions

[RFC v9 16/25] vfio: add bind stage-1 page table support

2020-07-28 Thread Liu Yi L
Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/iommu/host_iommu_context.c | 57 +- hw/vfio/common.c | 58 ++- include/hw/iommu/host_iommu_context.h | 19 +++- 3 files

[RFC v9 13/25] intel_iommu: add virtual command capability support

2020-07-28 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

[RFC v9 10/25] intel_iommu: add set/unset_iommu_context callback

2020-07-28 Thread Liu Yi L
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 | 71 --- include/hw/i386/intel_iommu.h | 21 ++--- 2 files changed, 83 insertions(+), 9 deletions(-)

[RFC v9 14/25] intel_iommu: process PASID cache invalidation

2020-07-28 Thread Liu Yi L
in 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 --- rfcv4 (v1) -> rfcv5 (v2): *) remove vtd_pasid_cache_gsi(), vtd_pasid_cache_psi() and vtd_pasid_cache_

[RFC v9 06/25] vfio: pass nesting requirement into vfio_get_group()

2020-07-28 Thread Liu Yi L
This patch passes the nesting requirement into vfio_get_group() to indicate whether VFIO_TYPE1_NESTING_IOMMU is required. 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/ap.c | 2

[RFC v9 12/25] vfio: init HostIOMMUContext per-container

2020-07-28 Thread Liu Yi L
could make use the methods provided by host iommu context. e.g. propagate requests to host iommu. 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 | 113

[RFC v9 11/25] vfio/common: provide PASID alloc/free hooks

2020-07-28 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

[RFC v9 02/25] header file update VFIO/IOMMU vSVA APIs kernel 5.8-rc6

2020-07-28 Thread Liu Yi L
be replaced with a full header files update when the vSVA uPAPI is stable. TODO: add the note for the Linux version. 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: Liu Yi L --- linux-headers/linux/iommu.h

[RFC v9 01/25] scripts/update-linux-headers: Import iommu.h

2020-07-28 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

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

2020-07-28 Thread Liu Yi L
e PCIPASIDOps 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 --- Eric Auger (1): scripts/update-linux-headers: Import iommu.h Liu Yi L (24): header file update VFIO/IOMMU vSVA APIs

[RFC v9 04/25] hw/pci: introduce pci_device_get_iommu_attr()

2020-07-28 Thread Liu Yi L
This patch adds pci_device_get_iommu_attr() to get vIOMMU attributes. e.g. if nesting IOMMU wanted. 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 | 35

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

2020-07-12 Thread Liu Yi L
: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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 d3c41a6

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

2020-07-12 Thread Liu Yi L
: no scalable 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 v8 22/25] intel_iommu: process PASID-based iotlb invalidation

2020-07-12 Thread Liu Yi L
Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu 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

[RFC v8 23/25] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-07-12 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 --- rfcv4 (v1) ->

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

2020-07-12 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

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

2020-07-12 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 | 24 include/hw/iommu

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

2020-07-12 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

[RFC v8 19/25] intel_iommu: replay pasid binds after context cache invalidation

2020-07-12 Thread Liu Yi L
: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 50 ++ hw/i386/intel_iommu_internal.h | 1 + hw/i386/trace-events | 1 + 3 files changed, 52 insertions(+) diff --git a/hw

[RFC v8 17/25] intel_iommu: sync IOMMU nesting cap info for assigned devices

2020-07-12 Thread Liu Yi L
. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 107 + hw/i386/intel_iommu_internal.h | 18 +++ include/hw/i386/intel_iommu.h | 4 ++ 3

[RFC v8 13/25] intel_iommu: add virtual command capability support

2020-07-12 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

  1   2   3   4   5   6   7   >