From a1e9fdc7f992423b7f54d5efd4794aa690bd8f4a Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Thu, 13 Sep 2018 16:17:38 +0800 Subject: [PATCH] HV: add Kconfig of CONSTANT_ACPI If CONFIG_CONSTANT_ACPI is true, then the value in host_acpi_info structure is constant. Otherwise the host_acpi_info value could be overrided. This is useful when platform ACPI table value is not fixed in Bootloader before production. In production release, this config should be set to yes. Tracked-On: #1264 Signed-off-by: Victor Sun Acked-by: Eddie Dong --- hypervisor/arch/x86/Kconfig | 4 ++ hypervisor/bsp/include/bsp_extern.h | 2 +- hypervisor/bsp/sbl/platform_acpi_info.c | 2 +- hypervisor/bsp/uefi/platform_acpi_info.c | 56 +++++++++++++++++++----- 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index ddc74ee30..0cbbe87ca 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -116,6 +116,10 @@ config RAM_SIZE hex "Size of the RAM region assigned to the hypervisor" default 0x02000000 +config CONSTANT_ACPI + bool "The platform ACPI info is constant" + default n + config DMAR_PARSE_ENABLED bool default n if PLATFORM_SBL diff --git a/hypervisor/bsp/include/bsp_extern.h b/hypervisor/bsp/include/bsp_extern.h index 691ba8caa..d392963bb 100644 --- a/hypervisor/bsp/include/bsp_extern.h +++ b/hypervisor/bsp/include/bsp_extern.h @@ -31,7 +31,7 @@ struct acpi_info { /* EXTERNAL VARIABLES */ /**********************************/ extern struct vm_description vm0_desc; -extern const struct acpi_info host_acpi_info; +extern struct acpi_info host_acpi_info; /* BSP Interfaces */ void init_bsp(void); diff --git a/hypervisor/bsp/sbl/platform_acpi_info.c b/hypervisor/bsp/sbl/platform_acpi_info.c index 98e6415e2..9767bc2ff 100644 --- a/hypervisor/bsp/sbl/platform_acpi_info.c +++ b/hypervisor/bsp/sbl/platform_acpi_info.c @@ -6,7 +6,7 @@ #include -const struct acpi_info host_acpi_info = { +struct acpi_info host_acpi_info = { .x86_family = 6U, .x86_model = 0x5CU, /* ApolloLake */ .pm_s_state = { diff --git a/hypervisor/bsp/uefi/platform_acpi_info.c b/hypervisor/bsp/uefi/platform_acpi_info.c index 60bc0a02d..3c2479f18 100644 --- a/hypervisor/bsp/uefi/platform_acpi_info.c +++ b/hypervisor/bsp/uefi/platform_acpi_info.c @@ -10,17 +10,49 @@ #include -const struct acpi_info host_acpi_info = { - 0, /* x86 family */ - 0, /* x86 model */ - { - {SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1a EVT */ - {SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b EVT */ - {SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1a CNT */ - {SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b CNT */ - {0, 0, 0}, /* _S3 Package */ - {0, 0, 0}, /* _S5 Package */ - (uint32_t *)0, /* Wake Vector 32 */ - (uint64_t *)0 /* Wake Vector 64 */ +struct acpi_info host_acpi_info = { + .x86_family = 0U, + .x86_model = 0U, + .pm_s_state = { + .pm1a_evt = { + .space_id = SPACE_SYSTEM_IO, + .bit_width = 0U, + .bit_offset = 0U, + .access_size = 0U, + .address = 0UL + }, + .pm1b_evt = { + .space_id = SPACE_SYSTEM_IO, + .bit_width = 0U, + .bit_offset = 0U, + .access_size = 0U, + .address = 0UL + }, + .pm1a_cnt = { + .space_id = SPACE_SYSTEM_IO, + .bit_width = 0U, + .bit_offset = 0U, + .access_size = 0U, + .address = 0UL + }, + .pm1b_cnt = { + .space_id = SPACE_SYSTEM_IO, + .bit_width = 0U, + .bit_offset = 0U, + .access_size = 0U, + .address = 0UL + }, + .s3_pkg = { + .val_pm1a = 0U, + .val_pm1b = 0U, + .reserved = 0U + }, + .s5_pkg = { + .val_pm1a = 0U, + .val_pm1b = 0U, + .reserved = 0U + }, + .wake_vector_32 = (uint32_t *)0UL, + .wake_vector_64 = (uint64_t *)0UL } };