Account for the case that we have JAILHOUSE_MAX_IOMMU_UNITS units, thus
no zeroed entry in platform_info.x86.iommu_base.
Signed-off-by: Jan Kiszka <
jan.k...@siemens.com>
---
hypervisor/arch/x86/vtd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c
index 8c95c2f..44474fb 100644
--- a/hypervisor/arch/x86/vtd.c
+++ b/hypervisor/arch/x86/vtd.c
@@ -482,7 +482,8 @@ int iommu_init(void)
int_remap_table_size_log2 = n;
- while (system_config->platform_info.x86.iommu_base[units])
+ while (units < JAILHOUSE_MAX_IOMMU_UNITS &&
+ system_config->platform_info.x86.iommu_base[units])
units++;
if (units == 0)
return trace_error(-EINVAL);
--
2.1.4