From 76662a634fe9a877395c0bc2fcbda94b322a09b0 Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Thu, 5 Jul 2018 11:26:22 +0800 Subject: [PATCH] loader: Update the memory address of GUEST_CFG_OFFSET GUEST_CFG_OFFSET is used to pass the memory top info from DM to HV. The address should be in E820 reserved range to prevent guest use it for other purpose. Signed-off-by: Yin Fengwei Acked-by: Anthony Xu --- devicemodel/core/sw_load_common.c | 12 ++++++------ devicemodel/include/public/acrn_common.h | 8 ++++---- hypervisor/include/public/acrn_common.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/devicemodel/core/sw_load_common.c b/devicemodel/core/sw_load_common.c index 99278595f..1cce8f9a4 100644 --- a/devicemodel/core/sw_load_common.c +++ b/devicemodel/core/sw_load_common.c @@ -50,8 +50,8 @@ static char bootargs[STR_LEN]; * ctx->highmem = request_memory_size - ctx->lowmem_limit * * Begin End Type Length - * 0: 0 - 0xF0000 RAM 0xF0000 - * 1 0xf0000 - 0x100000 (reserved) 0x10000 + * 0: 0 - 0xef000 RAM 0xEF000 + * 1 0xef000 - 0x100000 (reserved) 0x11000 * 2 0x100000 - lowmem RAM lowmem - 0x100000 * 3: lowmem - bff_fffff (reserved) 0xc00_00000-lowmem * 4: 0xc00_00000 - dff_fffff PCI hole 512MB @@ -61,13 +61,13 @@ static char bootargs[STR_LEN]; const struct e820_entry e820_default_entries[NUM_E820_ENTRIES] = { { /* 0 to mptable/smbios/acpi */ .baseaddr = 0x00000000, - .length = 0xF0000, + .length = 0xEF000, .type = E820_TYPE_RAM }, - { /* mptable/smbios/acpi to lowmem */ - .baseaddr = 0xF0000, - .length = 0x10000, + { /* guest_cfg_addr/mptable/smbios/acpi to lowmem */ + .baseaddr = 0xEF000, + .length = 0x11000, .type = E820_TYPE_RESERVED }, diff --git a/devicemodel/include/public/acrn_common.h b/devicemodel/include/public/acrn_common.h index df3286574..5c47a2a4f 100644 --- a/devicemodel/include/public/acrn_common.h +++ b/devicemodel/include/public/acrn_common.h @@ -282,11 +282,11 @@ struct acrn_vm_pci_msix_remap { * It's designed to support passing DM config data pointer, based on it, * hypervisor would parse then pass DM defined configuration to GUEST VCPU * when booting guest VM. - * the address 0xd0000 here is designed by DM, as it arranged all memory - * layout below 1M, DM should make sure there is no overlap for the address - * 0xd0000 usage. + * the address 0xef000 here is designed by DM, as it arranged all memory + * layout below 1M, DM add this address to E280 reserved range to make sure + * there is no overlap for the address 0xef000 usage. */ -#define GUEST_CFG_OFFSET 0xd0000 +#define GUEST_CFG_OFFSET 0xef000 /** * @brief Info The power state data of a VCPU. diff --git a/hypervisor/include/public/acrn_common.h b/hypervisor/include/public/acrn_common.h index 910aba231..40326a900 100644 --- a/hypervisor/include/public/acrn_common.h +++ b/hypervisor/include/public/acrn_common.h @@ -262,11 +262,11 @@ struct acrn_vm_pci_msix_remap { * It's designed to support passing DM config data pointer, based on it, * hypervisor would parse then pass DM defined configuration to GUEST VCPU * when booting guest VM. - * the address 0xd0000 here is designed by DM, as it arranged all memory - * layout below 1M, DM should make sure there is no overlap for the address - * 0xd0000 usage. + * the address 0xef000 here is designed by DM, as it arranged all memory + * layout below 1M, DM add this address to E280 reserved range to make sure + * there is no overlap for the address 0xef000 usage. */ -#define GUEST_CFG_OFFSET 0xd0000 +#define GUEST_CFG_OFFSET 0xef000 /** * @brief Info The power state data of a VCPU.