diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index 0cbbe87ca..cb0f70266 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -147,3 +147,8 @@ config MTRR_ENABLED config RELOC bool "Enable relocation" default y + +config IOMMU_INIT_BUS_LIMIT + hex "bus limitation when iommu init" + default 0xf if PLATFORM_SBL + default 0xff if PLATFORM_UEFI diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c index e7102b8f7..513990580 100644 --- a/hypervisor/arch/x86/vtd.c +++ b/hypervisor/arch/x86/vtd.c @@ -17,11 +17,6 @@ #define ACRN_DBG_IOMMU 6U #endif -/* set an appropriate bus limitation when iommu init, - * to reduce memory & time cost - */ -#define IOMMU_INIT_BUS_LIMIT (0xfU) - #define LEVEL_WIDTH 9U #define ROOT_ENTRY_LOWER_PRESENT_POS (0U) @@ -1300,7 +1295,7 @@ void init_iommu_vm0_domain(struct vm *vm0) vm0_domain = (struct iommu_domain *) vm0->iommu; - for (bus = 0U; bus <= IOMMU_INIT_BUS_LIMIT; bus++) { + for (bus = 0U; bus <= CONFIG_IOMMU_INIT_BUS_LIMIT; bus++) { for (devfun = 0U; devfun <= 255U; devfun++) { add_iommu_device(vm0_domain, 0U, (uint8_t)bus, (uint8_t)devfun);