diff --git a/hypervisor/Makefile b/hypervisor/Makefile index ee1da37b0..c83213b57 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -158,10 +158,10 @@ endif # ACPI parsing component # This part should be isolated from FuSa Cert -ifeq ($(CONFIG_DMAR_PARSE_ENABLED),y) +ifeq ($(CONFIG_ACPI_PARSE_ENABLED),y) C_SRCS += acpi_parser/dmar_parse.c -endif C_SRCS += acpi_parser/acpi_ext.c +endif C_SRCS += boot/acpi_base.c C_SRCS += boot/dmar_info.c diff --git a/hypervisor/acpi_parser/acpi_ext.c b/hypervisor/acpi_parser/acpi_ext.c index 7b33741f0..b48a8adaa 100644 --- a/hypervisor/acpi_parser/acpi_ext.c +++ b/hypervisor/acpi_parser/acpi_ext.c @@ -36,7 +36,6 @@ #include #include -#ifndef CONFIG_CONSTANT_ACPI /* Per ACPI spec: * There are two fundamental types of ACPI tables: * @@ -49,8 +48,7 @@ * * The second type of table, the ACPI Data Table, could be parsed here. * - * When ACRN go FuSa, the platform ACPI data should be fixed. The MACRO of - * CONFIG_CONSTANT_ACPI will be defined, then this code is not needed. + * When ACRN go FuSa, the platform ACPI data should be fixed and this file is not needed. */ #define ACPI_SIG_FACS 0x53434146U /* "FACS" */ @@ -158,4 +156,3 @@ void acpi_fixup(void) } } } -#endif diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index c4e8b9227..c343cf80a 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -226,15 +226,15 @@ config SOS_RAM_SIZE A 64-bit integer indicating the size of the User OS RAM (MMIO not included). Now we assume each UOS uses same amount of RAM size. -config DMAR_PARSE_ENABLED - bool "Enable ACPI DMA Remapping tables parsing" +config ACPI_PARSE_ENABLED + bool "Enable ACPI runtime parsing" default y help - Whether to parse the ACPI DMA Remapping tables at runtime. + Whether to parse the ACPI tables at runtime. config GPU_SBDF hex "Segment, Bus, Device, and function of the GPU" - depends on DMAR_PARSE_ENABLED + depends on ACPI_PARSE_ENABLED default 0x00000010 help A 32-bit integer encoding the segment, bus, device and function of the diff --git a/hypervisor/arch/x86/configs/apl-mrb.config b/hypervisor/arch/x86/configs/apl-mrb.config index 2a61968ef..7590ce51b 100644 --- a/hypervisor/arch/x86/configs/apl-mrb.config +++ b/hypervisor/arch/x86/configs/apl-mrb.config @@ -8,5 +8,4 @@ CONFIG_HV_RAM_SIZE=0x07800000 CONFIG_PLATFORM_RAM_SIZE=0x200000000 CONFIG_SOS_RAM_SIZE=0x200000000 CONFIG_UOS_RAM_SIZE=0x200000000 -CONFIG_DMAR_PARSE_ENABLED=n CONFIG_IOMMU_BUS_NUM=0x10 diff --git a/hypervisor/arch/x86/configs/apl-up2.config b/hypervisor/arch/x86/configs/apl-up2.config index 1fb016619..c5a70420e 100644 --- a/hypervisor/arch/x86/configs/apl-up2.config +++ b/hypervisor/arch/x86/configs/apl-up2.config @@ -3,5 +3,4 @@ CONFIG_BOARD="up2" CONFIG_SERIAL_PCI=y CONFIG_SERIAL_PCI_BDF="0:18.0" CONFIG_COM_IRQ=6 -CONFIG_DMAR_PARSE_ENABLED=y CONFIG_HV_RAM_START=0x5e000000 diff --git a/hypervisor/arch/x86/configs/dnv-cb2.config b/hypervisor/arch/x86/configs/dnv-cb2.config index fbefa0001..d90be1e28 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2.config +++ b/hypervisor/arch/x86/configs/dnv-cb2.config @@ -2,4 +2,3 @@ CONFIG_BOARD="dnv-cb2" CONFIG_SERIAL_LEGACY=y CONFIG_SERIAL_PIO_BASE=0x1000 -CONFIG_DMAR_PARSE_ENABLED=y diff --git a/hypervisor/arch/x86/mmu.c b/hypervisor/arch/x86/mmu.c index c10cc001a..e6cda9502 100644 --- a/hypervisor/arch/x86/mmu.c +++ b/hypervisor/arch/x86/mmu.c @@ -288,7 +288,7 @@ void init_paging(void) mmu_modify_or_del((uint64_t *)ppt_mmu_pml4_addr, (uint64_t)get_reserve_sworld_memory_base(), TRUSTY_RAM_SIZE * (CONFIG_MAX_VM_NUM - 1U), PAGE_USER, 0UL, &ppt_mem_ops, MR_MODIFY); -#ifdef CONFIG_DMAR_PARSE_ENABLED +#ifdef CONFIG_ACPI_PARSE_ENABLED for (i = 0U; i < entries_count; i++) { entry = p_e820 + i; if ((entry->type == E820_TYPE_ACPI_RECLAIM) || (entry->type == E820_TYPE_RESERVED)) { diff --git a/hypervisor/boot/dmar_info.c b/hypervisor/boot/dmar_info.c index 22c3bfae3..3c699e038 100644 --- a/hypervisor/boot/dmar_info.c +++ b/hypervisor/boot/dmar_info.c @@ -131,7 +131,7 @@ static struct dmar_info plat_dmar_info = { */ struct dmar_info *get_dmar_info(void) { -#ifdef CONFIG_DMAR_PARSE_ENABLED +#ifdef CONFIG_ACPI_PARSE_ENABLED parse_dmar_table(&plat_dmar_info); #endif return &plat_dmar_info; diff --git a/hypervisor/boot/guest/vboot_wrapper.c b/hypervisor/boot/guest/vboot_wrapper.c index 297b6fbb6..98ec5f5be 100644 --- a/hypervisor/boot/guest/vboot_wrapper.c +++ b/hypervisor/boot/guest/vboot_wrapper.c @@ -66,7 +66,7 @@ void init_vboot_operations(void) /* @pre: vboot_ops->init != NULL */ void init_vboot(void) { -#ifndef CONFIG_CONSTANT_ACPI +#ifndef CONFIG_ACPI_PARSE_ENABLED acpi_fixup(); #endif vboot_ops->init(); diff --git a/hypervisor/boot/include/acpi.h b/hypervisor/boot/include/acpi.h index 13e4eff2c..42e8b4994 100644 --- a/hypervisor/boot/include/acpi.h +++ b/hypervisor/boot/include/acpi.h @@ -36,7 +36,7 @@ struct ioapic_info; uint16_t parse_madt(uint32_t lapic_id_array[CONFIG_MAX_PCPU_NUM]); uint16_t parse_madt_ioapic(struct ioapic_info *ioapic_id_array); -#ifndef CONFIG_CONSTANT_ACPI +#ifndef CONFIG_ACPI_PARSE_ENABLED void acpi_fixup(void); #endif diff --git a/hypervisor/include/arch/x86/vtd.h b/hypervisor/include/arch/x86/vtd.h index d8b50ea11..84e29d7dc 100644 --- a/hypervisor/include/arch/x86/vtd.h +++ b/hypervisor/include/arch/x86/vtd.h @@ -519,7 +519,7 @@ union dmar_ir_entry { extern struct dmar_info *get_dmar_info(void); -#ifdef CONFIG_DMAR_PARSE_ENABLED +#ifdef CONFIG_ACPI_PARSE_ENABLED int32_t parse_dmar_table(struct dmar_info *plat_dmar_info); #endif diff --git a/hypervisor/scenarios/logical_partition/vm_configurations.h b/hypervisor/scenarios/logical_partition/vm_configurations.h index 795c1f1bc..064fb8ef8 100644 --- a/hypervisor/scenarios/logical_partition/vm_configurations.h +++ b/hypervisor/scenarios/logical_partition/vm_configurations.h @@ -9,9 +9,6 @@ #include -/* Use constant ACPI info which defined in platform_acpi_info.h instead of parsing it. */ -#define CONFIG_CONSTANT_ACPI - /* Bits mask of guest flags that can be programmed by device model. Other bits are set by hypervisor only */ #define DM_OWNED_GUEST_FLAG_MASK 0UL