diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index d45a3cc4f..8a9ab0f51 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -304,12 +304,12 @@ config RELOC wherever appropriate. Without relocation the bootloader must put the image to RAM_START, otherwise the hypervisor will not start up. -config IOMMU_INIT_BUS_LIMIT +config IOMMU_BUS_NUM hex "Limit of PCI bus on IOMMU initialization" - default 0xf if PLATFORM_SBL - default 0xff if PLATFORM_UEFI + default 0x10 if PLATFORM_SBL + default 0x100 if PLATFORM_UEFI help - Any BDF with a bus ID smaller than or equal to this limit is mapped to + Any BDF with a bus ID smaller than this number is mapped to the IOMMU domain of the first VM. config MAX_PCI_DEV_NUM diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c index 227a0f817..df6bbbadd 100644 --- a/hypervisor/arch/x86/vtd.c +++ b/hypervisor/arch/x86/vtd.c @@ -134,7 +134,7 @@ struct iommu_domain { }; struct context_table { - struct page buses[CONFIG_IOMMU_INIT_BUS_LIMIT]; + struct page buses[CONFIG_IOMMU_BUS_NUM]; }; static struct page root_tables[CONFIG_MAX_IOMMU_NUM] __aligned(CPU_PAGE_SIZE); @@ -1250,7 +1250,7 @@ void init_iommu_vm0_domain(struct acrn_vm *vm0) vm0_domain = (struct iommu_domain *) vm0->iommu; - for (bus = 0U; bus <= CONFIG_IOMMU_INIT_BUS_LIMIT; bus++) { + for (bus = 0U; bus < CONFIG_IOMMU_BUS_NUM; bus++) { for (devfun = 0U; devfun <= 255U; devfun++) { add_iommu_device(vm0_domain, 0U, (uint8_t)bus, (uint8_t)devfun);