[PATCH] iommu/amd-vi: fix assert comparing boolean to enum

Roger Pau Monne posted 1 patch 11 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230511145152.98328-1-roger.pau@citrix.com
xen/drivers/passthrough/amd/pci_amd_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] iommu/amd-vi: fix assert comparing boolean to enum
Posted by Roger Pau Monne 11 months, 4 weeks ago
Or else when iommu_intremap is set to iommu_intremap_full the assert
triggers.

Fixes: 1ba66a870eba ('AMD/IOMMU: without XT, x2APIC needs to be forced into physical mode')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 4ba8e764b22f..94e37755064b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -240,7 +240,7 @@ static int __must_check amd_iommu_setup_domain_device(
          */
         if ( dte->it_root )
             ASSERT(dte->int_ctl == IOMMU_DEV_TABLE_INT_CONTROL_TRANSLATED);
-        ASSERT(dte->iv == iommu_intremap);
+        ASSERT(dte->iv == !!iommu_intremap);
         ASSERT(dte->ex == ivrs_dev->dte_allow_exclusion);
         ASSERT(dte->sys_mgt == MASK_EXTR(ivrs_dev->device_flags,
                                          ACPI_IVHD_SYSTEM_MGMT));
-- 
2.40.0


Re: [PATCH] iommu/amd-vi: fix assert comparing boolean to enum
Posted by Jan Beulich 11 months, 4 weeks ago
On 11.05.2023 16:51, Roger Pau Monne wrote:
> Or else when iommu_intremap is set to iommu_intremap_full the assert
> triggers.
> 
> Fixes: 1ba66a870eba ('AMD/IOMMU: without XT, x2APIC needs to be forced into physical mode')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



Re: [PATCH] iommu/amd-vi: fix assert comparing boolean to enum
Posted by Andrew Cooper 11 months, 4 weeks ago
On 11/05/2023 3:53 pm, Jan Beulich wrote:
> On 11.05.2023 16:51, Roger Pau Monne wrote:
>> Or else when iommu_intremap is set to iommu_intremap_full the assert
>> triggers.
>>
>> Fixes: 1ba66a870eba ('AMD/IOMMU: without XT, x2APIC needs to be forced into physical mode')
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

It occurs to me that this might be related to the reports we're still
getting of some problems on these systems...

~Andrew