]> xenbits.xensource.com Git - xen.git/commitdiff
iommu/amd-vi: fix assert comparing boolean to enum
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 23 May 2023 13:02:50 +0000 (15:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 23 May 2023 13:02:50 +0000 (15:02 +0200)
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>
master commit: 4c507d8a6b6e8be90881a335b0a66eb28e0f7737
master date: 2023-05-12 09:35:36 +0200

xen/drivers/passthrough/amd/pci_amd_iommu.c

index 4792b34bc2f22fcf5169c87843f84c045904d65e..e5e0f0040288aa0146c98cdd0be23dc553e53726 100644 (file)
@@ -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));