RE: [RFC v2 4/7] virtio-iommu: Compute host reserved regions

2024-06-10 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [RFC v2 4/7] virtio-iommu: Compute host reserved regions > >Compute the host reserved regions in virtio_iommu_set_iommu_device(). >The usable IOVA regions are retrieved from the HOSTIOMMUDevice. >The virtio_iommu_set_host_iova_ranges()

RE: [RFC v2 3/7] HostIOMMUDevice: Introduce get_iova_ranges callback

2024-06-10 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [RFC v2 3/7] HostIOMMUDevice: Introduce get_iova_ranges >callback > >Introduce a new HostIOMMUDevice callback that allows to >retrieve the usable IOVA ranges. > >Implement this callback in the legacy VFIO and IOMMUFD VFIO >host iommu

RE: [RFC v2 7/7] memory: Remove IOMMU MR iommu_set_iova_range API

2024-06-10 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [RFC v2 7/7] memory: Remove IOMMU MR iommu_set_iova_range >API > >Since the host IOVA ranges are now passed through the >PCIIOMMUOps set_host_resv_regions and we have removed >the only implementation of iommu_set_iova_range() in >the

RE: [RFC v2 6/7] hw/vfio: Remove memory_region_iommu_set_iova_ranges() call

2024-06-10 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [RFC v2 6/7] hw/vfio: Remove >memory_region_iommu_set_iova_ranges() call > >As we have just removed the only implementation of >iommu_set_iova_ranges IOMMU MR callback in the virtio-iommu, >let's remove the call to the memory wrapper.

RE: [RFC v2 5/7] virtio-iommu: Remove the implementation of iommu_set_iova_range

2024-06-10 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [RFC v2 5/7] virtio-iommu: Remove the implementation of >iommu_set_iova_range > >Now that we use PCIIOMMUOps to convey information about usable IOVA >ranges we do not to implement the iommu_set_iova_ranges IOMMU MR >callback. >

RE: [RFC v2 1/7] HostIOMMUDevice: Store the VFIO/VDPA agent

2024-06-10 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [RFC v2 1/7] HostIOMMUDevice: Store the VFIO/VDPA agent > >Store the agent device (VFIO or VDPA) in the host IOMMU device. >This will allow easy access to some of its resources. > >Signed-off-by: Eric Auger >--- Reviewed-by: Zhenzhong

RE: [RFC v2 2/7] virtio-iommu: Implement set|unset]_iommu_device() callbacks

2024-06-10 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: [RFC v2 2/7] virtio-iommu: Implement set|unset]_iommu_device() >callbacks > >Implement PCIIOMMUOPs [set|unset]_iommu_device() callbacks. >In set(), a VirtioHostIOMMUDevice is allocated which holds >a reference to the

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

2024-06-10 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v7 00/17] Add a host IOMMU device abstraction to >check with vIOMMU > >Hi Zhenzhong, > >On 6/5/24 10:30, Zhenzhong Duan wrote: >> Hi, >> >> This series introduce a HostIOMMUDevice abstraction and sub-classes. >> Also

RE: [PATCH v6 09/19] vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler

2024-06-06 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 09/19] vfio/iommufd: Implement >HostIOMMUDeviceClass::realize() handler > > > >On 6/6/24 11:26, Eric Auger wrote: >> Hi Zhenzhong, >> On 6/3/24 08:10, Zhenzhong Duan wrote: >>> It calls

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-05 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > > > >On 6/4/24 07:46, Duan, Zhenzhong wrote: >> >>> -Original Message- >>> From: Eric Auge

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-04 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > > > >On 6/4/24 07:40, Duan, Zhenzhong wrote: >> >>> -Original Message- >>> From: Eric Auge

RE: [PATCH v6 11/19] backends/iommufd: Implement HostIOMMUDeviceClass::get_cap() handler

2024-06-04 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 11/19] backends/iommufd: Implement >HostIOMMUDeviceClass::get_cap() handler > > > >On 6/4/24 05:23, Duan, Zhenzhong wrote: >> Hi Cédric, Eric, >> >>> -Original Message

RE: [PATCH v6 09/19] vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler

2024-06-04 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 09/19] vfio/iommufd: Implement >HostIOMMUDeviceClass::realize() handler > > >Hi, >On 6/4/24 09:51, Duan, Zhenzhong wrote: >> >>> -Original Message- >>> From: Eric Auger

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

2024-06-04 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 07/19] vfio/container: Implement >HostIOMMUDeviceClass::realize() handler > >Hi Zhenzhong, > >On 6/4/24 04:45, Duan, Zhenzhong wrote: >> Hi Eric, >> >>> -Original Message-

RE: [PATCH v6 09/19] vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler

2024-06-04 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 09/19] vfio/iommufd: Implement >HostIOMMUDeviceClass::realize() handler > > > >On 6/4/24 04:58, Duan, Zhenzhong wrote: >> >>> -Original Message- >>> From: Eric Auger

Re: [PATCH v5 37/65] i386/tdvf: Introduce function to parse TDVF metadata

2024-06-04 Thread Duan, Zhenzhong
On 2/29/2024 2:36 PM, Xiaoyao Li wrote: From: Isaku Yamahata TDX VM needs to boot with its specialized firmware, Trusted Domain Virtual Firmware (TDVF). QEMU needs to parse TDVF and map it in TD guest memory prior to running the TDX VM. A TDVF Metadata in TDVF image describes the structure

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > > > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> From: Yi Liu >> >> Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU. >> In set call, a new

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

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 19/19] intel_iommu: Check compatibility with host >IOMMU capabilities > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> If check fails, host device (either VFIO or VDPA device) is not >> compatible with current

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> From: Yi Liu >> >> Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU. >> In set

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

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 13/19] vfio: Create host IOMMU device instance > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> Create host IOMMU device instance in vfio_attach_device() and call >> .realize() to initialize it further. > >I

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > >On 6/3/24 13:02, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From: CLEMENT

RE: [PATCH v6 03/19] backends/iommufd: Introduce abstract TYPE_HOST_IOMMU_DEVICE_IOMMUFD device

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 03/19] backends/iommufd: Introduce abstract >TYPE_HOST_IOMMU_DEVICE_IOMMUFD device > > >Hi Zhenzhong, >On 6/3/24 08:10, Zhenzhong Duan wrote: >> TYPE_HOST_IOMMU_DEVICE_IOMMUFD represents a host IOMMU device >under >> iommufd

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

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 01/19] backends: Introduce HostIOMMUDevice >abstract > > > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> Introduce HostIOMMUDevice as an abstraction of host IOMMU device. >> >> Introduce .realize() to initialize HostIOMMUDevice

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

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 00/19] Add a host IOMMU device abstraction to >check with vIOMMU > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> Hi, >> >> This series introduce a HostIOMMUDevice abstraction and sub-classes. >> Also

RE: [PATCH v6 11/19] backends/iommufd: Implement HostIOMMUDeviceClass::get_cap() handler

2024-06-03 Thread Duan, Zhenzhong
Hi Cédric, Eric, >-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v6 11/19] backends/iommufd: Implement >HostIOMMUDeviceClass::get_cap() handler > >On 6/3/24 13:32, Eric Auger wrote: >> >> >> On 6/3/24 08:10, Zhenzhong Duan wrote: >>> Suggested-by: Cédric Le Goater >>>

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

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v6 01/19] backends: Introduce HostIOMMUDevice >abstract > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> Introduce HostIOMMUDevice as an abstraction of host IOMMU device. >> >> Introduce .realize() to initialize

RE: [PATCH v6 09/19] vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 09/19] vfio/iommufd: Implement >HostIOMMUDeviceClass::realize() handler > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> It calls iommufd_backend_get_device_info() to get host IOMMU >> related information and

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

2024-06-03 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 07/19] vfio/container: Implement >HostIOMMUDeviceClass::realize() handler > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> Utilize range_get_last_bit() to get host IOMMU address width and >> package it in

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > > >On 03/06/2024 08:10, Zhenzhong Duan wrote: >> Caution: External email. Do not open attachments or click links, unless this >email comes from

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

2024-06-03 Thread Duan, Zhenzhong
Hi Michael, >-Original Message- >From: Michael S. Tsirkin >Subject: Re: [PATCH v2 3/5] intel_iommu: Add a framework to do >compatibility check with host IOMMU cap/ecap > >On Fri, Apr 26, 2024 at 03:10:14AM +0000, Duan, Zhenzhong wrote: >> >> >>

Re: [PATCH v5 18/65] i386/tdx: Make Intel-PT unsupported for TD guest

2024-05-31 Thread Duan, Zhenzhong
On 2/29/2024 2:36 PM, Xiaoyao Li wrote: Due to the fact that Intel-PT virtualization support has been broken in QEMU since Sapphire Rapids generation[1], below warning is triggered when luanching TD guest: warning: host doesn't support requested feature: CPUID.07H:EBX.intel-pt [bit 25]

Re: [PATCH v5 19/65] i386/tdx: Update tdx_cpuid_lookup[].tdx_fixed0/1 by tdx_caps.cpuid_config[]

2024-05-31 Thread Duan, Zhenzhong
On 2/29/2024 2:36 PM, Xiaoyao Li wrote: tdx_cpuid_lookup[].tdx_fixed0/1 is QEMU maintained data which reflects TDX restrictions regrading what bits are fixed by TDX module. It's retrieved from TDX spec and static. However, TDX may evolve and change some fixed fields to configurable in the

Re: [PATCH v5 17/65] i386/tdx: Adjust the supported CPUID based on TDX restrictions

2024-05-31 Thread Duan, Zhenzhong
On 2/29/2024 2:36 PM, Xiaoyao Li wrote: According to Chapter "CPUID Virtualization" in TDX module spec, CPUID bits of TD can be classified into 6 types: 1 | As configured | configurable by VMM, independent of native

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

2024-05-27 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v5 19/19] intel_iommu: Check compatibility with host >IOMMU capabilities > >On 5/8/24 11:03, Zhenzhong Duan wrote: >> If check fails, host device (either VFIO or VDPA device) is not >> compatible with current vIOMMU config

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

2024-05-27 Thread Duan, Zhenzhong
Hi Jason, >-Original Message- >From: Duan, Zhenzhong >Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by >spec > > > >>-Original Message- >>From: Jason Wang >>Subject: Re: [PATCH] intel_iommu: Use the latest fault rea

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

2024-05-27 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Wang >Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by >spec > >On Fri, May 24, 2024 at 4:41 PM Duan, Zhenzhong > wrote: >> >> >> >> >-Original Message- >> >Fr

RE: [PATCH 04/16] vfio/helpers: Make vfio_set_irq_signaling() return bool

2024-05-26 Thread Duan, Zhenzhong
>-Original Message- >From: Anthony Krowiak >Subject: Re: [PATCH 04/16] vfio/helpers: Make vfio_set_irq_signaling() >return bool > > >On 5/15/24 4:20 AM, Zhenzhong Duan wrote: >> This is to follow the coding standand in qapi/error.h to return bool >> for bool-valued functions. >> >>

RE: [PATCH rfcv2 09/17] intel_iommu: Flush stage-1 cache in iotlb invalidation

2024-05-26 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: Re: [PATCH rfcv2 09/17] intel_iommu: Flush stage-1 cache in iotlb >invalidation > >Hi Zhenzhong > >On 22/05/2024 08:23, Zhenzhong Duan wrote: >> Caution: External email. Do not open attachments or click links, unless this >email

RE: [PATCH rfcv2 06/17] intel_iommu: Implement stage-1 translation

2024-05-26 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: Re: [PATCH rfcv2 06/17] intel_iommu: Implement stage-1 >translation > >Hi Zhenzhong, > >I already sent you my comments about this patch earlier (question about >checking pgtt) but here is a style review > >On 22/05/2024 08:23,

RE: [PATCH rfcv2 15/17] intel_iommu: Set default aw_bits to 48 in scalable modren mode

2024-05-26 Thread Duan, Zhenzhong
Hi Clement, >-Original Message- >From: CLEMENT MATHIEU--DRIF >Sent: Friday, May 24, 2024 9:57 PM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: alex.william...@redhat.com; c...@redhat.com; eric.au...@redhat.com; >m...@redhat.com; pet...@redhat.com; ja

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

2024-05-24 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Wang >Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by >spec > >On Tue, May 21, 2024 at 6:25 PM Duan, Zhenzhong > wrote: >> >> >> >> >-Original Message- >> >Fr

RE: [PATCH rfcv2 17/17] tests/qtest: Add intel-iommu test

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Thomas Huth >Subject: Re: [PATCH rfcv2 17/17] tests/qtest: Add intel-iommu test > >On 22/05/2024 08.23, Zhenzhong Duan wrote: >> Add the framework to test the intel-iommu device. >> >> Currently only tested cap/ecap bits correctness in scalable >> modern mode.

RE: [PATCH rfcv2 00/17] intel_iommu: Enable stage-1 translation for emulated device

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Wang >Subject: Re: [PATCH rfcv2 00/17] intel_iommu: Enable stage-1 translation >for emulated device > >On Wed, May 22, 2024 at 2:25 PM Zhenzhong Duan > wrote: >> >> Hi, >> >> Per Jason Wang's suggestion, iommufd nesting series[1] is split into >> "Enable

RE: [PATCH 7/7] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH 7/7] vfio/{ap,ccw}: Use warn_report_err() for IRQ notifier >registration errors > >vfio_ccw_register_irq_notifier() and vfio_ap_register_irq_notifier() >errors are currently reported using error_report_err(). Since they are

RE: [PATCH 5/7] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize()

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH 5/7] vfio/ccw: Use the 'Error **errp' argument of >vfio_ccw_realize() > >The local error variable is kept for vfio_ccw_register_irq_notifier() >because it is not considered as a failing condition. We will change >how error

RE: [PATCH 4/7] s390x/css: Make S390CCWDeviceClass::realize return bool

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH 4/7] s390x/css: Make S390CCWDeviceClass::realize return >bool > >Since the realize() handler of S390CCWDeviceClass takes an 'Error **' >argument, best practices suggest to return a bool. See the api/error.h >Rules section.

RE: [PATCH 3/7] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize()

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH 3/7] hw/s390x/ccw: Remove local Error variable from >s390_ccw_realize() > >Use the 'Error **errp' argument of s390_ccw_realize() instead and >remove the error_propagate() call. > >Signed-off-by: Cédric Le Goater Reviewed-by:

RE: [PATCH 2/7] s390x/css: Make CCWDeviceClass::realize return bool

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH 2/7] s390x/css: Make CCWDeviceClass::realize return bool > >Since the realize() handler of CCWDeviceClass takes an 'Error **' >argument, best practices suggest to return a bool. See the api/error.h >Rules section. While at it,

RE: [PATCH 1/7] hw/s390x/ccw: Make s390_ccw_get_dev_info() return a bool

2024-05-23 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH 1/7] hw/s390x/ccw: Make s390_ccw_get_dev_info() return >a bool > >Since s390_ccw_get_dev_info() takes an 'Error **' argument, best >practices suggest to return a bool. See the qapi/error.h Rules >section. While at it, modify

RE: [PATCH v2 20/20] vfio/ccw: Fix the missed unrealize() call in error path

2024-05-22 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Sent: Wednesday, May 22, 2024 3:52 PM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: alex.william...@redhat.com; eric.au...@redhat.com; Peng, Chao P >; Eric Farman ; Matthew >Rosato ; Thomas Huth ; >o

RE: [PATCH v2 19/20] vfio/ccw: Drop local @err in vfio_ccw_realize()

2024-05-22 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v2 19/20] vfio/ccw: Drop local @err in vfio_ccw_realize() > >On 5/22/24 06:40, Zhenzhong Duan wrote: >> Use @errp to fetch error information directly and drop the local >> variable @err. >> >> Suggested-by: Cédric Le

RE: [PATCH 02/16] vfio/display: Make vfio_display_*() return bool

2024-05-21 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH 02/16] vfio/display: Make vfio_display_*() return bool > >On 5/15/24 10:20, Zhenzhong Duan wrote: >> This is to follow the coding standand in qapi/error.h to return bool >> for bool-valued functions. >> >> Suggested-by:

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

2024-05-21 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Wang >Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by >spec > >On Mon, May 20, 2024 at 12:15 PM Liu, Yi L wrote: >> >> > From: Duan, Zhenzhong >> > Sent: Monday, May 20, 2024 11:41 AM

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

2024-05-20 Thread Duan, Zhenzhong
>-Original Message- >From: CLEMENT MATHIEU--DRIF >Subject: Re: [PATCH ats_vtd v2 20/25] intel_iommu: fill the PASID field when >creating an instance of IOMMUTLBEntry > > >On 17/05/2024 12:40, Duan, Zhenzhong wrote: >> Caution: External email. Do not open

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

2024-05-20 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Yi L >Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by >spec > >> From: Duan, Zhenzhong >> Sent: Monday, May 20, 2024 11:41 AM >> >> >> >> >-Original Message- >&g

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

  1   2   3   4   5   >