Skip to content

Commit 2111fcf

Browse files
binbinwu1lijinxia
authored andcommitted
hv: vtd: add config for bus limitation when init
Currently, hypervisor doesn't have the information of pci devices on the platform when init. In order to reduce boot time and memory usage, hypervisor set a bus limitation for pci devices when init vtd. However, maximum bus number varies on different platforms. This patch add a config for the bus limitation. Set 0xF as the default value for the maximum bus number on sbl platform. Set 0xFF as the default value for the maximum bus number on uefi platfrom. Tracked-On: #1339 Signed-off-by: Binbin Wu <binbin.wu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 6fcaa1a commit 2111fcf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hypervisor/arch/x86/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,8 @@ config MTRR_ENABLED
147147
config RELOC
148148
bool "Enable relocation"
149149
default y
150+
151+
config IOMMU_INIT_BUS_LIMIT
152+
hex "bus limitation when iommu init"
153+
default 0xf if PLATFORM_SBL
154+
default 0xff if PLATFORM_UEFI

hypervisor/arch/x86/vtd.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
#define ACRN_DBG_IOMMU 6U
1818
#endif
1919

20-
/* set an appropriate bus limitation when iommu init,
21-
* to reduce memory & time cost
22-
*/
23-
#define IOMMU_INIT_BUS_LIMIT (0xfU)
24-
2520
#define LEVEL_WIDTH 9U
2621

2722
#define ROOT_ENTRY_LOWER_PRESENT_POS (0U)
@@ -1300,7 +1295,7 @@ void init_iommu_vm0_domain(struct vm *vm0)
13001295

13011296
vm0_domain = (struct iommu_domain *) vm0->iommu;
13021297

1303-
for (bus = 0U; bus <= IOMMU_INIT_BUS_LIMIT; bus++) {
1298+
for (bus = 0U; bus <= CONFIG_IOMMU_INIT_BUS_LIMIT; bus++) {
13041299
for (devfun = 0U; devfun <= 255U; devfun++) {
13051300
add_iommu_device(vm0_domain, 0U,
13061301
(uint8_t)bus, (uint8_t)devfun);

0 commit comments

Comments
 (0)