diff --git a/hypervisor/arch/x86/configs/apl-mrb/ve820.c b/hypervisor/arch/x86/configs/apl-mrb/ve820.c index e32c61fbb..3318c5238 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/ve820.c +++ b/hypervisor/arch/x86/configs/apl-mrb/ve820.c @@ -46,5 +46,5 @@ static const struct e820_entry ve820_entry[VE820_ENTRIES_APL_MRB] = { void create_prelaunched_vm_e820(struct acrn_vm *vm) { vm->e820_entry_num = VE820_ENTRIES_APL_MRB; - vm->e820_entries = (struct e820_entry *)ve820_entry; + vm->e820_entries = ve820_entry; } diff --git a/hypervisor/arch/x86/configs/dnv-cb2/ve820.c b/hypervisor/arch/x86/configs/dnv-cb2/ve820.c index 3eade9050..159808a98 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/ve820.c +++ b/hypervisor/arch/x86/configs/dnv-cb2/ve820.c @@ -46,5 +46,5 @@ static const struct e820_entry ve820_entry[VE820_ENTRIES_DNV_CB2] = { void create_prelaunched_vm_e820(struct acrn_vm *vm) { vm->e820_entry_num = VE820_ENTRIES_DNV_CB2; - vm->e820_entries = (struct e820_entry *)ve820_entry; + vm->e820_entries = ve820_entry; } diff --git a/hypervisor/arch/x86/configs/nuc7i7bnh/ve820.c b/hypervisor/arch/x86/configs/nuc7i7bnh/ve820.c index 15cd258ed..a7930c133 100644 --- a/hypervisor/arch/x86/configs/nuc7i7bnh/ve820.c +++ b/hypervisor/arch/x86/configs/nuc7i7bnh/ve820.c @@ -45,5 +45,5 @@ static const struct e820_entry ve820_entry[VE820_ENTRIES_KBL_NUC_i7] = { void create_prelaunched_vm_e820(struct acrn_vm *vm) { vm->e820_entry_num = VE820_ENTRIES_KBL_NUC_i7; - vm->e820_entries = (struct e820_entry *)ve820_entry; + vm->e820_entries = ve820_entry; } diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index 5ce5f083f..1c80b4c94 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -188,7 +188,7 @@ static void prepare_prelaunched_vm_memmap(struct acrn_vm *vm, const struct acrn_ uint32_t i; for (i = 0U; i < vm->e820_entry_num; i++) { - struct e820_entry *entry = &(vm->e820_entries[i]); + const struct e820_entry *entry = &(vm->e820_entries[i]); if (entry->length == 0UL) { break; @@ -327,7 +327,7 @@ static void prepare_sos_vm_memmap(struct acrn_vm *vm) const struct e820_entry *entry; uint32_t entries_count = vm->e820_entry_num; - struct e820_entry *p_e820 = vm->e820_entries; + const struct e820_entry *p_e820 = vm->e820_entries; const struct e820_mem_params *p_e820_mem_info = get_e820_mem_info(); pr_dbg("sos_vm: bottom memory - 0x%llx, top memory - 0x%llx\n", diff --git a/hypervisor/common/vm_load.c b/hypervisor/common/vm_load.c index 696a7ce69..0b964be3a 100644 --- a/hypervisor/common/vm_load.c +++ b/hypervisor/common/vm_load.c @@ -38,7 +38,7 @@ static uint32_t create_zeropage_e820(struct zero_page *zp, const struct acrn_vm { uint32_t entry_num = vm->e820_entry_num; struct e820_entry *zp_e820 = zp->entries; - struct e820_entry *vm_e820 = vm->e820_entries; + const struct e820_entry *vm_e820 = vm->e820_entries; if ((zp_e820 == NULL) || (vm_e820 == NULL) || (entry_num == 0U) || (entry_num > E820_MAX_ENTRIES)) { pr_err("e820 create error"); diff --git a/hypervisor/include/arch/x86/guest/vm.h b/hypervisor/include/arch/x86/guest/vm.h index 7dcecf727..23a9a206e 100644 --- a/hypervisor/include/arch/x86/guest/vm.h +++ b/hypervisor/include/arch/x86/guest/vm.h @@ -111,7 +111,7 @@ struct acrn_vm { struct vm_sw_info sw; /* Reference to SW associated with this VM */ struct vm_pm_info pm; /* Reference to this VM's arch information */ uint32_t e820_entry_num; - struct e820_entry *e820_entries; + const struct e820_entry *e820_entries; uint16_t vm_id; /* Virtual machine identifier */ enum vm_state state; /* VM state */ struct acrn_vuart vuart[MAX_VUART_NUM_PER_VM]; /* Virtual UART */