hv: fix stac/clac context in get_initrd_load_addr()

Tracked-On: #8761
Signed-off-by: Haoyu Tang <haoyu.tang@intel.com>
This commit is contained in:
Haoyu Tang 2025-02-23 19:47:31 +08:00 committed by acrnsi-robot
parent ef49283e51
commit bff0493d25
2 changed files with 5 additions and 3 deletions

View File

@ -61,7 +61,7 @@ static void *get_initrd_load_addr(struct acrn_vm *vm, uint64_t kernel_start)
kernel_init_size = zeropage->hdr.init_size;
kernel_align = zeropage->hdr.kernel_alignment;
initrd_addr_max = zeropage->hdr.initrd_addr_max;
stac();
clac();
kernel_end = roundup(kernel_start, kernel_align) + kernel_init_size;
if (initrd_addr_max != 0U) {

View File

@ -109,7 +109,8 @@ static void *do_load_elf64(struct acrn_vm *vm)
*/
(void)copy_to_gpa(vm, p_elf_img + p_prg_tbl_head64->p_offset,
p_prg_tbl_head64->p_paddr, (uint32_t)p_prg_tbl_head64->p_filesz);
/* copy_to_gpa has it's stac/clac inside. So call stac again here. */
/* copy_to_gpa has its own stac/clac inside. Call stac again here to keep
* the context. */
stac();
}
p_prg_tbl_head64++;
@ -174,7 +175,8 @@ static void *do_load_elf32(struct acrn_vm *vm)
*/
(void)copy_to_gpa(vm, p_elf_img + p_prg_tbl_head32->p_offset,
p_prg_tbl_head32->p_paddr, p_prg_tbl_head32->p_filesz);
/* copy_to_gpa has it's stac/clac inside. So call stac again here. */
/* copy_to_gpa has its own stac/clac inside. Call stac again here to keep
* the context. */
stac();
}
p_prg_tbl_head32++;