Skip to content

Commit b08dbd4

Browse files
jsun26intelwenlingz
authored andcommitted
HV: fix wrong gpa start of hpa2 in ve820.c
The current logic puts hpa2 above GPA 4G always, which is incorrect. Need to set gpa start of hpa2 right after hpa1 when hpa1 size is less then 2G; Tracked-On: #4458 Signed-off-by: Victor Sun <victor.sun@intel.com>
1 parent 60178a9 commit b08dbd4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hypervisor/arch/x86/guest/ve820.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ void create_prelaunched_vm_e820(struct acrn_vm *vm)
190190
} else {
191191
/* need to revise length of hpa1 entry to its actual size */
192192
vm->e820_entries[ENTRY_HPA1].length = vm_config->memory.size - MEM_1M;
193+
/* need to set gpa_start for hpa2 */
194+
gpa_start = vm->e820_entries[ENTRY_HPA1].baseaddr + vm->e820_entries[ENTRY_HPA1].length;
193195
if ((vm_config->memory.size < MEM_2G)
194196
&& (remaining_hpa2_size > (MEM_2G - vm_config->memory.size))) {
195197
/* need to split hpa2 and add an entry for hpa2_lo */

0 commit comments

Comments
 (0)