[PATCH v5 21/21] intel_iommu: Enable host device when x-flts=on in scalable mode

Zhenzhong Duan posted 21 patches 2 months, 3 weeks ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, Yi Liu <yi.l.liu@intel.com>, "Clément Mathieu--Drif" <clement.mathieu--drif@eviden.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>, Eric Auger <eric.auger@redhat.com>, Zhenzhong Duan <zhenzhong.duan@intel.com>
[PATCH v5 21/21] intel_iommu: Enable host device when x-flts=on in scalable mode
Posted by Zhenzhong Duan 2 months, 3 weeks ago
Now that all infrastructures of supporting passthrough device running
with stage-1 translation are there, enable it now.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 hw/i386/intel_iommu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index f9cb13e945..04a412d460 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -5222,6 +5222,8 @@ static bool vtd_check_hiod(IntelIOMMUState *s, VTDHostIOMMUDevice *vtd_hiod,
                    "when x-flts=on");
         return false;
     }
+
+    return true;
 #endif
 
     error_setg(errp, "host IOMMU is incompatible with stage-1 translation");
-- 
2.47.1
Re: [PATCH v5 21/21] intel_iommu: Enable host device when x-flts=on in scalable mode
Posted by Yi Liu 2 months, 2 weeks ago
On 2025/8/22 14:40, Zhenzhong Duan wrote:
> Now that all infrastructures of supporting passthrough device running
> with stage-1 translation are there, enable it now.
> 
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>   hw/i386/intel_iommu.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index f9cb13e945..04a412d460 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -5222,6 +5222,8 @@ static bool vtd_check_hiod(IntelIOMMUState *s, VTDHostIOMMUDevice *vtd_hiod,
>                      "when x-flts=on");
>           return false;
>       }
> +
> +    return true;
>   #endif

just to echo if this series does not support non-rid_pasid PASIDs, then
factor out the configuration that has both x-flts=on and x-pasid-mode=on.

>   
>       error_setg(errp, "host IOMMU is incompatible with stage-1 translation");

This patch itself looks good to me.

Reviewed-by: Yi Liu <yi.l.liu@intel.com>
RE: [PATCH v5 21/21] intel_iommu: Enable host device when x-flts=on in scalable mode
Posted by Duan, Zhenzhong 1 month, 4 weeks ago

>-----Original Message-----
>From: Liu, Yi L <yi.l.liu@intel.com>
>Subject: Re: [PATCH v5 21/21] intel_iommu: Enable host device when
>x-flts=on in scalable mode
>
>On 2025/8/22 14:40, Zhenzhong Duan wrote:
>> Now that all infrastructures of supporting passthrough device running
>> with stage-1 translation are there, enable it now.
>>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
>> ---
>>   hw/i386/intel_iommu.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
>> index f9cb13e945..04a412d460 100644
>> --- a/hw/i386/intel_iommu.c
>> +++ b/hw/i386/intel_iommu.c
>> @@ -5222,6 +5222,8 @@ static bool vtd_check_hiod(IntelIOMMUState *s,
>VTDHostIOMMUDevice *vtd_hiod,
>>                      "when x-flts=on");
>>           return false;
>>       }
>> +
>> +    return true;
>>   #endif
>
>just to echo if this series does not support non-rid_pasid PASIDs, then
>factor out the configuration that has both x-flts=on and x-pasid-mode=on.

This looks an overkill, imagine a qemu configuration with emulated devices
supporting pasid and passthrough device not, even if we allow it to start,
there is no issue as pasid capability isn't exposed to guest. If we don't allow it,
the whole qemu fails out.

Thanks
Zhenzhong

>
>>
>>       error_setg(errp, "host IOMMU is incompatible with stage-1
>translation");
>
>This patch itself looks good to me.
>
>Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Re: [PATCH v5 21/21] intel_iommu: Enable host device when x-flts=on in scalable mode
Posted by Eric Auger 2 months, 2 weeks ago

On 8/22/25 8:40 AM, Zhenzhong Duan wrote:
> Now that all infrastructures of supporting passthrough device running
> with stage-1 translation are there, enable it now.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>  hw/i386/intel_iommu.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index f9cb13e945..04a412d460 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -5222,6 +5222,8 @@ static bool vtd_check_hiod(IntelIOMMUState *s, VTDHostIOMMUDevice *vtd_hiod,
>                     "when x-flts=on");
>          return false;
>      }
> +
> +    return true;
The easiest one ;-)

Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
>  #endif
>  
>      error_setg(errp, "host IOMMU is incompatible with stage-1 translation");