diff --git a/hypervisor/arch/x86/guest/ve820.c b/hypervisor/arch/x86/guest/ve820.c index b300f9b63..5fd906294 100644 --- a/hypervisor/arch/x86/guest/ve820.c +++ b/hypervisor/arch/x86/guest/ve820.c @@ -15,7 +15,7 @@ #include #define ENTRY_HPA1_LOW_PART1 2U -#define ENTRY_HPA1_LOW_PART2 5U +#define ENTRY_HPA1_LOW_PART2 4U #define ENTRY_HPA1_HI 9U static struct e820_entry service_vm_e820[E820_MAX_ENTRIES]; @@ -199,16 +199,16 @@ static const struct e820_entry pre_ve820_template[E820_MAX_ENTRIES] = { .length = PRE_RTVM_SW_SRAM_MAX_SIZE, .type = E820_TYPE_RESERVED }, + { /* part2 of lowmem of hpa1*/ + .baseaddr = PRE_RTVM_SW_SRAM_BASE_GPA + PRE_RTVM_SW_SRAM_MAX_SIZE, + .length = GPU_OPREGION_GPA - (PRE_RTVM_SW_SRAM_BASE_GPA + PRE_RTVM_SW_SRAM_MAX_SIZE), + .type = E820_TYPE_RAM + }, { /* GPU OpRegion for pre-launched VM */ .baseaddr = GPU_OPREGION_GPA, .length = GPU_OPREGION_SIZE, .type = E820_TYPE_RESERVED }, - { /* part2 of lowmem of hpa1*/ - .baseaddr = GPU_OPREGION_GPA + GPU_OPREGION_SIZE, - .length = VIRT_ACPI_DATA_ADDR - (GPU_OPREGION_GPA + GPU_OPREGION_SIZE), - .type = E820_TYPE_RAM - }, { /* ACPI Reclaim */ .baseaddr = VIRT_ACPI_DATA_ADDR,/* consecutive from 0x7fe00000UL */ .length = VIRT_ACPI_DATA_LEN, diff --git a/hypervisor/include/common/ptdev.h b/hypervisor/include/common/ptdev.h index f586e20bd..9ebc83d7a 100644 --- a/hypervisor/include/common/ptdev.h +++ b/hypervisor/include/common/ptdev.h @@ -9,6 +9,7 @@ #include #include #include +#include enum intx_ctlr { @@ -20,7 +21,7 @@ enum intx_ctlr { #define PTDEV_INTR_INTX (1U << 1U) #define GPU_OPREGION_SIZE 0x5000U -#define GPU_OPREGION_GPA 0x40880000U +#define GPU_OPREGION_GPA (VIRT_ACPI_DATA_ADDR - GPU_OPREGION_SIZE) #define PCIR_ASLS_CTL 0xfcU /* register offset in PCIe configuration space for Opregion base address */ #define PCIM_ASLS_OPREGION_MASK 0xfffff000U /* opregion need 4KB aligned */ diff --git a/hypervisor/include/dm/vacpi.h b/hypervisor/include/dm/vacpi.h index 0266b82a7..87424d805 100644 --- a/hypervisor/include/dm/vacpi.h +++ b/hypervisor/include/dm/vacpi.h @@ -8,6 +8,7 @@ #define VACPI_H #include +#include #define ACPI_OEM_ID "ACRN "