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

2024-05-19 Thread Duan, Zhenzhong
>-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 >; Yu Zhang ; Michael >S. Tsirkin ; Paolo Bonzini ; >Richard Henderson ; Eduardo Habkost >; Marcel Apfe

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

2024-05-19 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Yi L >Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by >spec > >> 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.

RE: [PATCH ats_vtd v2 21/25] atc: generic ATC that can be used by PCIe devices that support SVM

2024-05-17 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v2 21/25] atc: generic ATC that can be used by PCIe >devices that support SVM > >As the SVM-capable devices will need to cache translations, we provide >an first implementation. > >This cache uses a two-level

RE: [PATCH ats_vtd v2 20/25] intel_iommu: fill the PASID field when creating an instance of IOMMUTLBEntry

2024-05-17 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v2 20/25] intel_iommu: fill the PASID field when >creating an instance of IOMMUTLBEntry > >Signed-off-by: Clément Mathieu--Drif >--- > hw/i386/intel_iommu.c | 7 +++ > 1 file changed, 7 insertions(+) > >diff

RE: [PATCH 00/16] VFIO: misc cleanups part2

2024-05-17 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Sent: Friday, May 17, 2024 12:48 AM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: alex.william...@redhat.com; eric.au...@redhat.com; Peng, Chao P > >Subject: Re: [PATCH 00/16] VFIO: misc cleanups

RE: [PATCH ats_vtd v1 03/24] intel_iommu: check if the input address is canonical

2024-05-16 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: Re: [PATCH ats_vtd v1 03/24] intel_iommu: check if the input >address is canonical > >Hi zhenzhong, > >On 14/05/2024 09:34, Duan, Zhenzhong wrote: >> Caution: External email. Do not open atta

RE: [PATCH ats_vtd v1 14/24] pci: add IOMMU operations to get address spaces and memory regions with PASID

2024-05-14 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v1 14/24] pci: add IOMMU operations to get >address spaces and memory regions with PASID > >Signed-off-by: Clément Mathieu--Drif >--- > hw/pci/pci.c | 20 > include/hw/pci/pci.h | 34

RE: [PATCH ats_vtd v1 09/24] pcie: helper functions to check if PASID and ATS are enabled

2024-05-14 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v1 09/24] pcie: helper functions to check if PASID >and ATS are enabled > >ats_enabled and pasid_enabled check whether the capabilities are >present or not. If so, we read the configuration space to get >the

RE: [PATCH ats_vtd v1 08/24] pcie: add helper to declare PASID capability for a pcie device

2024-05-14 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v1 08/24] pcie: add helper to declare PASID >capability for a pcie device > >Signed-off-by: Clément Mathieu--Drif >--- > hw/pci/pcie.c | 24 > include/hw/pci/pcie.h | 6

RE: [PATCH ats_vtd v1 07/24] memory: add permissions in IOMMUAccessFlags

2024-05-14 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v1 07/24] memory: add permissions in >IOMMUAccessFlags > >This will be necessary for devices implementing ATS. >We also define a new macro IOMMU_ACCESS_FLAG_FULL in addition to >IOMMU_ACCESS_FLAG to support more

RE: [PATCH ats_vtd v1 04/24] intel_iommu: set accessed and dirty bits during first stage translation

2024-05-14 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v1 04/24] intel_iommu: set accessed and dirty bits >during first stage translation > >Signed-off-by: Clément Mathieu--Drif >--- > hw/i386/intel_iommu.c | 26 ++ >

RE: [PATCH ats_vtd v1 06/24] intel_iommu: do not consider wait_desc as an invalid descriptor

2024-05-14 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v1 06/24] intel_iommu: do not consider wait_desc >as an invalid descriptor > >Signed-off-by: Clément Mathieu--Drif >--- > hw/i386/intel_iommu.c | 5 + > 1 file changed, 5 insertions(+) > >diff --git

RE: [PATCH ats_vtd v1 03/24] intel_iommu: check if the input address is canonical

2024-05-14 Thread Duan, Zhenzhong
Hi Clement, >-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: [PATCH ats_vtd v1 03/24] intel_iommu: check if the input address >is canonical > >First stage translation must fail if the address to translate is >not canonical. > >Signed-off-by: Clément Mathieu--Drif >--- >

RE: [PATCH intel_iommu 0/7] FLTS for VT-d

2024-05-13 Thread Duan, Zhenzhong
hes? > >Thanks > >cmd > > >On 06/05/2024 03:38, Duan, Zhenzhong 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. >> >> >> Hi Clement, >>

RE: [PATCH v2 00/11] VFIO: misc cleanups

2024-05-13 Thread Duan, Zhenzhong
d to 'bool-valued functions'? Is there a clear rule in which case to change 'int testfunc(... Error **errp)' to ' bool testfunc(... Error **errp)'? Thanks Zhenzhong >-Original Message- >From: Duan, Zhenzhong > >Subject: [PATCH v2 00/11] VFIO: misc cleanups > >Hi > >

RE: [PATCH v5 01/19] backends: Introduce HostIOMMUDevice abstract

2024-05-13 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v5 01/19] backends: Introduce HostIOMMUDevice >abstract > >Hello Zhenzhong, > >On 5/8/24 11:03, Zhenzhong Duan wrote: >> Introduce HostIOMMUDevice as an abstraction of host IOMMU device. >> >> Introduce

RE: [PATCH] vfio: container: Fix missing allocation of VFIOSpaprContainer

2024-05-09 Thread Duan, Zhenzhong
>-Original Message- >From: Shivaprasad G Bhat >Subject: [PATCH] vfio: container: Fix missing allocation of >VFIOSpaprContainer > >The commit 6ad359ec29 "(vfio/spapr: Move prereg_listener into >spapr container)" began to use the newly introduced VFIOSpaprContainer >structure. > >After

RE: [PATCH v3 00/19] Add a host IOMMU device abstraction to check with vIOMMU

2024-05-08 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Gunthorpe >Subject: Re: [PATCH v3 00/19] Add a host IOMMU device abstraction to >check with vIOMMU > >On Tue, May 07, 2024 at 02:24:30AM +0000, Duan, Zhenzhong wrote: >> >On Mon, May 06, 2024 at 02:30:47AM +, Duan, Zhen

RE: [PATCH v4 19/19] intel_iommu: Check compatibility with host IOMMU capabilities

2024-05-08 Thread Duan, Zhenzhong
Hi Clement, See inline. From: CLEMENT MATHIEU--DRIF Sent: Tuesday, May 7, 2024 7:40 PM To: Duan, Zhenzhong ; qemu-devel@nongnu.org Cc: alex.william...@redhat.com; c...@redhat.com; eric.au...@redhat.com; m...@redhat.com; pet...@redhat.com; jasow...@redhat.com; j...@nvidia.com; nicol

RE: [PATCH v3 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-05-08 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 15/19] hw/pci: Introduce >pci_device_[set|unset]_iommu_device() > >On 5/7/24 09:48, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Original Message- >>> From: Cédric

RE: [PATCH v4 04/19] vfio/iommufd: Introduce TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO device

2024-05-08 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v4 04/19] vfio/iommufd: Introduce >TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO device > >On 5/7/24 11:20, Zhenzhong Duan wrote: >> TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO represents a host IOMMU >device under >> VFIO iommufd backend.

RE: [PATCH v4 01/19] backends: Introduce HostIOMMUDevice abstract

2024-05-07 Thread Duan, Zhenzhong
Hi Philippe, >-Original Message- >From: Philippe Mathieu-Daudé >Subject: Re: [PATCH v4 01/19] backends: Introduce HostIOMMUDevice >abstract > >Hi Zhenzhong, > >On 7/5/24 11:20, Zhenzhong Duan wrote: >> Introduce HostIOMMUDevice as an abstraction of host IOMMU device. >> >> Introduce

RE: [PATCH v3 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-05-07 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 15/19] hw/pci: Introduce >pci_device_[set|unset]_iommu_device() > >Hello Zhenzhong, > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> From: Yi Liu >> >> pci_device_[set|unset]_iommu_device() call

RE: [PATCH v2 03/11] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-07 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 03/11] vfio: Make VFIOIOMMUClass::attach_device() >and its wrapper return bool > >On 5/7/24 08:42, Zhenzhong Duan wrote: >> Make VFIOIOMMUClass::attach_device() and its wrapper function >> vfio_attach_device() return

RE: [PATCH v3 05/19] backends/host_iommu_device: Introduce HostIOMMUDeviceCaps

2024-05-07 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 05/19] backends/host_iommu_device: Introduce >HostIOMMUDeviceCaps > >Hello Zhenzhong, > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> HostIOMMUDeviceCaps's elements map to the host IOMMU's capabilities. >> Different

RE: [PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-07 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and >its wrapper return bool > >On 5/7/24 04:09, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From: Céd

RE: [PATCH v3 00/19] Add a host IOMMU device abstraction to check with vIOMMU

2024-05-06 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Gunthorpe >Subject: Re: [PATCH v3 00/19] Add a host IOMMU device abstraction to >check with vIOMMU > >On Mon, May 06, 2024 at 02:30:47AM +0000, Duan, Zhenzhong wrote: > >> I'm not clear how useful multiple iommufd instances s

RE: [PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-06 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and >its wrapper return bool > >On 5/6/24 10:33, Zhenzhong Duan wrote: >> Make VFIOIOMMUClass::attach_device() and its wrapper function >> vfio_attach_device() return bool.

RE: [PATCH v3 06/19] range: Introduce range_get_last_bit()

2024-05-06 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 06/19] range: Introduce range_get_last_bit() > >On 4/30/24 11:58, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From: Cédric Le Goater >&

RE: [PATCH v3 00/19] Add a host IOMMU device abstraction to check with vIOMMU

2024-05-05 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Sent: Friday, May 3, 2024 10:04 PM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: alex.william...@redhat.com; eric.au...@redhat.com; m...@redhat.com; >pet...@redhat.com; jasow...@redhat.com; j.

RE: [PATCH v3 11/19] backends/iommufd: Implement HostIOMMUDeviceClass::check_cap() handler

2024-05-05 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 11/19] backends/iommufd: Implement >HostIOMMUDeviceClass::check_cap() handler > >> +static int hiod_iommufd_check_cap(HostIOMMUDevice *hiod, int >cap, > Error **errp) >> +{ >> +switch (cap) { >> +

RE: [PATCH intel_iommu 0/7] FLTS for VT-d

2024-05-05 Thread Duan, Zhenzhong
T-d > >Hi Zhenzhong, > >I will rebase, > >thanks > >On 01/05/2024 14:40, Duan, Zhenzhong 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. >> >> >> Ah,

RE: [PATCH intel_iommu 0/7] FLTS for VT-d

2024-05-01 Thread Duan, Zhenzhong
Ah, this is a duplicate effort on stage-1 translation. Hi Clement, We had ever sent a rfcv1 series "intel_iommu: Enable stage-1 translation" for both emulated and passthrough device, link: https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg02740.html which now evolves to rfcv2, link:

RE: [PATCH v3 11/19] backends/iommufd: Implement HostIOMMUDeviceClass::check_cap() handler

2024-05-01 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 11/19] backends/iommufd: Implement >HostIOMMUDeviceClass::check_cap() handler > >On 4/30/24 12:06, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From:

RE: [PATCH v3 13/19] vfio: Create host IOMMU device instance

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 13/19] vfio: Create host IOMMU device instance > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> Create host IOMMU device instance in vfio_attach_device() and call >> .realize() to initialize it further. >> >> Suggested-by:

RE: [PATCH v3 08/19] backends/iommufd: Introduce helper function iommufd_backend_get_device_info()

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 08/19] backends/iommufd: Introduce helper >function iommufd_backend_get_device_info() > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> Introduce a helper function iommufd_backend_get_device_info() to get >> host IOMMU

RE: [PATCH v3 11/19] backends/iommufd: Implement HostIOMMUDeviceClass::check_cap() handler

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 11/19] backends/iommufd: Implement >HostIOMMUDeviceClass::check_cap() handler > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> Suggested-by: Cédric Le Goater >> Signed-off-by: Zhenzhong Duan >> --- >>

RE: [PATCH v3 07/19] vfio/container: Implement HostIOMMUDeviceClass::realize() handler

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 07/19] vfio/container: Implement >HostIOMMUDeviceClass::realize() handler > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> Utilize range_get_last_bit() to get host IOMMU address width and >> package it in

RE: [PATCH v3 06/19] range: Introduce range_get_last_bit()

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 06/19] range: Introduce range_get_last_bit() > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> This helper get the highest 1 bit position of the upper bound. >> >> If the range is empty or upper bound is zero, -1 is

RE: [PATCH v3 05/19] backends/host_iommu_device: Introduce HostIOMMUDeviceCaps

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 05/19] backends/host_iommu_device: Introduce >HostIOMMUDeviceCaps > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> HostIOMMUDeviceCaps's elements map to the host IOMMU's capabilities. >> Different platform IOMMU can

RE: [PATCH v3 04/19] vfio/iommufd: Introduce HostIOMMUDeviceIOMMUFDVFIO device

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 04/19] vfio/iommufd: Introduce >HostIOMMUDeviceIOMMUFDVFIO device > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> HostIOMMUDeviceIOMMUFDVFIO represents a host IOMMU device under >VFIO >> iommufd backend. It will be

RE: [PATCH v3 02/19] vfio/container: Introduce HostIOMMUDeviceLegacyVFIO device

2024-04-30 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 02/19] vfio/container: Introduce >HostIOMMUDeviceLegacyVFIO device > >On 4/29/24 08:50, Zhenzhong Duan wrote: >> HostIOMMUDeviceLegacyVFIO represents a host IOMMU device under >VFIO >> legacy container backend. >> >> It

RE: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-25 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >On 4/25/24 10:46, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Original Message-

RE: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-25 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >Hello Zhenzhong, > >On 4/18/24 10:42, Duan, Zhenzhong wrote: >> Hi Cédric, >> >

RE: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-19 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >Hello Zhenzhong, > >On 4/18/24 10:42, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -

RE: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-18 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >Hello Zhenzhong > >On 4/17/24 11:24, Duan, Zhenzhong wrote: >> >> >>> -

RE: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-17 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >On 4/17/24 06:21, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>>

RE: [PATCH v2 02/10] vfio: Introduce HIODLegacyVFIO device

2024-04-16 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 02/10] vfio: Introduce HIODLegacyVFIO device > >Hello, > >On 4/16/24 05:41, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Original Message- >>> From: Cédri

RE: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-16 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >Hello, > >On 4/16/24 09:09, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Ori

RE: [PATCH v2 3/5] intel_iommu: Add a framework to do compatibility check with host IOMMU cap/ecap

2024-04-16 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >On 4/8/24 10:44, Zhenzhong Duan wrote: >> From: Yi Liu >> >> If check fails, the host side device(either vfio or vdpa

RE: [PATCH v2 08/10] vfio: Create host IOMMU device instance

2024-04-16 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 08/10] vfio: Create host IOMMU device instance > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> Create host IOMMU device instance and initialize it based on backend. >> >> Signed-off-by: Zhenzhong Duan >> --- >>

RE: [PATCH v2 09/10] hw/pci: Introduce pci_device_set/unset_iommu_device()

2024-04-16 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 09/10] hw/pci: Introduce >pci_device_set/unset_iommu_device() > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> From: Yi Liu >> >> This adds pci_device_set/unset_iommu_device() to set/unset >> HostIOMMUDevice for a given

RE: [PATCH v2 07/10] backends/iommufd: Implement get_host_iommu_info() callback

2024-04-16 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 07/10] backends/iommufd: Implement >get_host_iommu_info() callback > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> It calls iommufd_backend_get_device_info() to get host IOMMU >> related information. >> >> Define a common

RE: [PATCH v2 06/10] backends/iommufd: Introduce helper function iommufd_backend_get_device_info()

2024-04-16 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 06/10] backends/iommufd: Introduce helper >function iommufd_backend_get_device_info() > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> Introduce a helper function iommufd_backend_get_device_info() to get >> host IOMMU

RE: [PATCH v2 05/10] vfio: Implement get_host_iommu_info() callback

2024-04-15 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 05/10] vfio: Implement get_host_iommu_info() >callback > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> Utilize iova_ranges to calculate host IOMMU address width and >> package it in HIOD_LEGACY_INFO for vIOMMU usage. >> >>

RE: [PATCH v2 03/10] backends/iommufd: Introduce abstract HIODIOMMUFD device

2024-04-15 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 03/10] backends/iommufd: Introduce abstract >HIODIOMMUFD device > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> HIODIOMMUFD represents a host IOMMU device under iommufd backend. >> >> Currently it includes only public

RE: [PATCH v2 02/10] vfio: Introduce HIODLegacyVFIO device

2024-04-15 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 02/10] vfio: Introduce HIODLegacyVFIO device > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> HIODLegacyVFIO represents a host IOMMU device under VFIO legacy >> container backend. >> >> It includes a link to

RE: [PATCH v2 02/10] vfio: Introduce HIODLegacyVFIO device

2024-04-15 Thread Duan, Zhenzhong
>-Original Message- >From: Philippe Mathieu-Daudé >Subject: Re: [PATCH v2 02/10] vfio: Introduce HIODLegacyVFIO device > >On 15/4/24 12:10, Duan, Zhenzhong wrote: >> Hi Philippe, >> >>> -Original Message- >>> From: Philippe Mathieu-Da

RE: [PATCH v2 02/10] vfio: Introduce HIODLegacyVFIO device

2024-04-15 Thread Duan, Zhenzhong
Hi Philippe, >-Original Message- >From: Philippe Mathieu-Daudé >Sent: Monday, April 15, 2024 5:20 PM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: alex.william...@redhat.com; c...@redhat.com; eric.au...@redhat.com; >pet...@redhat.com; jasow...@redhat.com

RE: [PATCH v2 01/10] backends: Introduce abstract HostIOMMUDevice

2024-04-15 Thread Duan, Zhenzhong
>-Original Message- >From: Philippe Mathieu-Daudé >Subject: Re: [PATCH v2 01/10] backends: Introduce abstract >HostIOMMUDevice > >Hi Zhenzhong, > >On 8/4/24 10:12, Zhenzhong Duan wrote: >> Introduce HostIOMMUDevice as an abstraction of host IOMMU device. >> >> get_host_iommu_info() is

RE: [PATCH v2 01/10] backends: Introduce abstract HostIOMMUDevice

2024-04-15 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 01/10] backends: Introduce abstract >HostIOMMUDevice > >On 4/8/24 10:12, Zhenzhong Duan wrote: >> Introduce HostIOMMUDevice as an abstraction of host IOMMU device. >> >> get_host_iommu_info() is used to get host IOMMU

RE: [PATCH v2 03/10] backends/iommufd: Introduce abstract HIODIOMMUFD device

2024-04-08 Thread Duan, Zhenzhong
Hi All, >-Original Message- >From: Duan, Zhenzhong >Subject: [PATCH v2 03/10] backends/iommufd: Introduce abstract >HIODIOMMUFD device > >HIODIOMMUFD represents a host IOMMU device under iommufd backend. > >Currently it includes only public iommufd handle and

RE: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-03-31 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v1 01/11] Introduce a common abstract struct >HostIOMMUDevice > >Hello Zhenzhong, > >On 3/28/24 04:06, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Original Message

RE: [PATCH v1 3/6] intel_iommu: Add a framework to check and sync host IOMMU cap/ecap

2024-03-28 Thread Duan, Zhenzhong
3/24 12:17, Michael S. Tsirkin wrote: >> > On Wed, Mar 13, 2024 at 07:54:11AM +, Duan, Zhenzhong wrote: >> >> >> >>> -Original Message- >> >>> From: Michael S. Tsirkin >> >>> Subject: Re: [PATCH v1 3/6] intel_iommu: Add a fr

RE: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-03-27 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v1 01/11] Introduce a common abstract struct >HostIOMMUDevice > >Hello Zhenzhong, > >On 3/19/24 12:58, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Original Mess

RE: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-03-19 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Sent: Tuesday, March 19, 2024 4:17 PM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: alex.william...@redhat.com; eric.au...@redhat.com; >pet...@redhat.com; jasow...@redhat.com; m...@redhat.com; &g

RE: [PATCH v1 11/11] backends/iommufd: Introduce helper function iommufd_device_get_info()

2024-03-19 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 11/11] backends/iommufd: Introduce helper >function iommufd_device_get_info() > >Hi Joao, > >On 3/18/24 16:09, Joao Martins wrote: >> On 18/03/2024 07:54, Eric Auger wrote: >>> Hi Zhenzhong, >>> >>> On 2/28/24 04:59,

RE: [PATCH v1 00/11] Add a host IOMMU device abstraction

2024-03-19 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 00/11] Add a host IOMMU device abstraction > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Hi, >> >> Based on Joao's suggestion, the iommufd nesting prerequisite series [1] >> is further splitted to host IOMMU device

RE: [PATCH v1 09/11] hw/pci: Introduce pci_device_set/unset_iommu_device()

2024-03-19 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 09/11] hw/pci: Introduce >pci_device_set/unset_iommu_device() > >Hi Zhenzhong, > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> From: Yi Liu >> >> This adds pci_device_set/unset_iommu_device() to set/unset >> HostIOMMUDevice

RE: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create callback

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create >callback > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Introduce host_iommu_device_create callback and a wrapper for it. >> >> This callback is used to allocate a host

RE: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 01/11] Introduce a common abstract struct >HostIOMMUDevice > >Hi Zhenzhong, >On 2/28/24 04:58, Zhenzhong Duan wrote: >> HostIOMMUDevice will be inherited by two sub classes, >> legacy and iommufd currently. >As this patch

RE: [PATCH v1 08/11] vfio/pci: Allocate and initialize HostIOMMUDevice after attachment

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 08/11] vfio/pci: Allocate and initialize >HostIOMMUDevice after attachment > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Signed-off-by: Zhenzhong Duan >> --- >> hw/vfio/pci.c | 4 >> 1 file changed, 4 insertions(+)

RE: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create callback

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create >callback > > > >On 3/18/24 14:52, Eric Auger wrote: >> Hi ZHenzhong, >> >> On 2/28/24 04:58, Zhenzhong Duan wrote: >>> Introduce host_iommu_device_create callback and a wrapper

RE: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create callback

2024-03-18 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create >callback > >Hi ZHenzhong, > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Introduce host_iommu_device_create callback and a wrapper for it. >> >> This callback is used to

RE: [PATCH v1 04/11] vfio: Add HostIOMMUDevice handle into VFIODevice

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 04/11] vfio: Add HostIOMMUDevice handle into >VFIODevice > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> This handle points to either IOMMULegacyDevice or IOMMUFDDevice >variant, >> neither both. >I would reword into:

RE: [PATCH 2/2] qom/object_interfaces: Remove local_err in user_creatable_add_type

2024-03-15 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Zhao1 >Subject: Re: [PATCH 2/2] qom/object_interfaces: Remove local_err in >user_creatable_add_type > >On Thu, Feb 29, 2024 at 11:37:39AM +0800, Zhenzhong Duan wrote: >> Date: Thu, 29 Feb 2024 11:37:39 +0800 >> From: Zhenzhong Duan >> Subject: [PATCH

RE: [PATCH 1/2] qom/object_interfaces: Remove unnecessary local_err check

2024-03-15 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Zhao1 >Subject: Re: [PATCH 1/2] qom/object_interfaces: Remove unnecessary >local_err check > >On Thu, Feb 29, 2024 at 11:37:38AM +0800, Zhenzhong Duan wrote: >> Date: Thu, 29 Feb 2024 11:37:38 +0800 >> From: Zhenzhong Duan >> Subject: [PATCH 1/2]

RE: [PATCH v2] vfio/iommufd: Fix memory leak

2024-03-14 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH v2] vfio/iommufd: Fix memory leak > >Coverity reported a memory leak on variable 'contents' in routine >iommufd_cdev_getfd(). Use g_autofree variables to simplify the exit >path and get rid of g_free() calls. > >Cc: Eric Auger

RE: [PATCH v1 3/6] intel_iommu: Add a framework to check and sync host IOMMU cap/ecap

2024-03-13 Thread Duan, Zhenzhong
>-Original Message- >From: Michael S. Tsirkin >Subject: Re: [PATCH v1 3/6] intel_iommu: Add a framework to check and >sync host IOMMU cap/ecap > >On Wed, Mar 13, 2024 at 07:54:11AM +0000, Duan, Zhenzhong wrote: >> >> >> >-Original Me

RE: [PATCH] vfio/iommufd: Fix memory leak

2024-03-13 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Thursday, March 14, 2024 5:06 AM >To: qemu-devel@nongnu.org >Cc: Alex Williamson ; Cédric Le Goater >; Eric Auger ; Liu, Yi L >; Duan, Zhenzhong >Subject: [PATCH] vfio/iommufd: Fix memory leak > >Make s

RE: [PATCH v1 3/6] intel_iommu: Add a framework to check and sync host IOMMU cap/ecap

2024-03-13 Thread Duan, Zhenzhong
>-Original Message- >From: Michael S. Tsirkin >Subject: Re: [PATCH v1 3/6] intel_iommu: Add a framework to check and >sync host IOMMU cap/ecap > >On Wed, Mar 13, 2024 at 02:52:39AM +0000, Duan, Zhenzhong wrote: >> Hi Michael, >> >> >-Or

RE: [PATCH v1 3/6] intel_iommu: Add a framework to check and sync host IOMMU cap/ecap

2024-03-12 Thread Duan, Zhenzhong
Hi Michael, >-Original Message- >From: Michael S. Tsirkin >Subject: Re: [PATCH v1 3/6] intel_iommu: Add a framework to check and >sync host IOMMU cap/ecap > >On Wed, Feb 28, 2024 at 05:44:29PM +0800, Zhenzhong Duan wrote: >> From: Yi Liu >> >> Add a framework to check and synchronize

RE: [PATCH v8 7/9] hw/i386/q35: Set virtio-iommu aw-bits default value to 39

2024-03-07 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [PATCH v8 7/9] hw/i386/q35: Set virtio-iommu aw-bits default >value to 39 > >Currently the default input range can extend to 64 bits. On x86, >when the virtio-iommu protects vfio devices, the physical iommu >may support only 39 bits. Let's

RE: [PATCH v6 8/9] hw/arm/virt: Set virtio-iommu aw-bits default value to 48

2024-03-05 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [PATCH v6 8/9] hw/arm/virt: Set virtio-iommu aw-bits default value >to 48 > >On ARM we set 48b as a default (matching SMMUv3 SMMU_IDR5.VAX == 0). > >hw_compat_8_2 is used to handle the compatibility for machine types >before 9.0 (default

RE: [PATCH v6 7/9] hw/i386/q35: Set virtio-iommu aw-bits default value to 39

2024-03-05 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: [PATCH v6 7/9] hw/i386/q35: Set virtio-iommu aw-bits default >value to 39 > >Currently the default input range can extend to 64 bits. On x86, >when the virtio-iommu protects vfio devices, the physical iommu >may support only 39

RE: [PATCH v1 6/6] intel_iommu: Block migration if cap is updated

2024-03-04 Thread Duan, Zhenzhong
>-Original Message- >From: Prasad Pandit >Subject: Re: [PATCH v1 6/6] intel_iommu: Block migration if cap is updated > >On Mon, 4 Mar 2024 at 13:41, Duan, Zhenzhong > wrote: >> This is to deal with a special case when cold plugged vfio device is >unplugged &g

RE: [PATCH v1 6/6] intel_iommu: Block migration if cap is updated

2024-03-04 Thread Duan, Zhenzhong
>-Original Message- >From: Prasad Pandit >Subject: Re: [PATCH v1 6/6] intel_iommu: Block migration if cap is updated > >On Wed, 28 Feb 2024 at 15:17, Zhenzhong Duan > wrote: >> When there is VFIO device and vIOMMU cap/ecap is updated based on >host > >* cap/ecap -> capability/extended

RE: [PATCH v1 0/6] Check and sync host IOMMU cap/ecap with vIOMMU

2024-03-03 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Wang >Subject: Re: [PATCH v1 0/6] Check and sync host IOMMU cap/ecap with >vIOMMU > >On Wed, Feb 28, 2024 at 5:46 PM Zhenzhong Duan > wrote: >> >> Hi, >> >> Based on Joao's suggestion, the iommufd nesting prerequisite series [1] >> is further splitted to

RE: [PATCH 02/16] backends/iommufd: Fix missing ERRP_GUARD() for error_prepend()

2024-02-28 Thread Duan, Zhenzhong
>-Original Message- >From: Zhao Liu >Subject: [PATCH 02/16] backends/iommufd: Fix missing ERRP_GUARD() for >error_prepend() > >From: Zhao Liu > >As the comment in qapi/error, passing @errp to error_prepend() requires >ERRP_GUARD(): > >* = Why, when and how to use ERRP_GUARD() = >* >*

RE: [PATCH rfcv2 18/18] intel_iommu: Block migration if cap is updated

2024-02-27 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Subject: Re: [PATCH rfcv2 18/18] intel_iommu: Block migration if cap is >updated > >On 27/02/2024 02:41, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From: Joao Martins >>

RE: [PATCH RFCv2 1/8] backends/iommufd: Introduce helper function iommufd_device_get_hw_capabilities()

2024-02-26 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Subject: Re: [PATCH RFCv2 1/8] backends/iommufd: Introduce helper >function iommufd_device_get_hw_capabilities() > >On 26/02/2024 07:29, Duan, Zhenzhong wrote: >> Hi Joao, >> >>> -Original Message--

RE: [PATCH v5 3/3] virtio-iommu: Change the default granule to the host page size

2024-02-26 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: [PATCH v5 3/3] virtio-iommu: Change the default granule to the >host page size > >We used to set the default granule to 4KB but with VFIO assignment >it makes more sense to use the actual host page size. > >Indeed when hotplugging

RE: [PATCH v5 1/3] qdev: Add a granule_mode property

2024-02-26 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [PATCH v5 1/3] qdev: Add a granule_mode property > >Introduce a new enum type property allowing to set an >IOMMU granule. Values are 4k, 8k, 16k, 64k and host. >This latter indicates the vIOMMU granule will match >the host page size. > >A

RE: [PATCH v5 2/3] virtio-iommu: Add a granule property

2024-02-26 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [PATCH v5 2/3] virtio-iommu: Add a granule property > >This allows to choose which granule will be used by >default by the virtio-iommu. Current page size mask >default is qemu_target_page_mask so this translates >into a 4K granule. >

RE: [PATCH rfcv2 18/18] intel_iommu: Block migration if cap is updated

2024-02-26 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Subject: Re: [PATCH rfcv2 18/18] intel_iommu: Block migration if cap is >updated > >On 01/02/2024 07:28, Zhenzhong Duan wrote: >> When there is VFIO device and vIOMMU cap/ecap is updated based on >host >> IOMMU cap/ecap, migration should be

RE: [PATCH RFCv2 2/8] vfio/iommufd: Introduce auto domain creation

2024-02-26 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Subject: Re: [PATCH RFCv2 2/8] vfio/iommufd: Introduce auto domain >creation > >On 12/02/2024 16:27, Jason Gunthorpe wrote: >> On Mon, Feb 12, 2024 at 01:56:37PM +, Joao Martins wrote: >>> There's generally two modes of operation for IOMMUFD:

RE: [PATCH rfcv2 14/18] intel_iommu: Add a framework to check and sync host IOMMU cap/ecap

2024-02-25 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH rfcv2 14/18] intel_iommu: Add a framework to check >and sync host IOMMU cap/ecap > > > >On 2/1/24 08:28, Zhenzhong Duan wrote: >> From: Yi Liu >> >> Add a framework to check and synchronize host IOMMU cap/ecap with >> vIOMMU

RE: [PATCH RFCv2 1/8] backends/iommufd: Introduce helper function iommufd_device_get_hw_capabilities()

2024-02-25 Thread Duan, Zhenzhong
Hi Joao, >-Original Message- >From: Joao Martins >Subject: [PATCH RFCv2 1/8] backends/iommufd: Introduce helper function >iommufd_device_get_hw_capabilities() > >The new helper will fetch vendor agnostic IOMMU capabilities supported >both by hardware and software. Right now it is only

RE: [PATCH rfcv2 07/18] vfio/container: Implement host_iommu_device_init callback in legacy mode

2024-02-25 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH rfcv2 07/18] vfio/container: Implement >host_iommu_device_init callback in legacy mode > >Hi Zhenzhong, >On 2/1/24 08:28, Zhenzhong Duan wrote: >> This callback will be used to initialize base and public elements >> in

RE: [PATCH rfcv2 11/18] intel_iommu: Add set/unset_iommu_device callback

2024-02-25 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH rfcv2 11/18] intel_iommu: Add >set/unset_iommu_device callback > > > >On 2/1/24 08:28, Zhenzhong Duan wrote: >> From: Yi Liu >> >> This adds set/unset_iommu_device() implementation in Intel vIOMMU. >> In set call, a pointer to

  1   2   3   4   >