hv: remove hardcoding of SW SRAM HPA base

Physical address to SW SRAM region maybe different
 on different platforms, this hardcoded address may
 result in address mismatch for SW SRAM operations.

 This patch removes above hardcoded address and uses
 the physical address parsed from native RTCT.

Tracked-On: #5649
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yonghua Huang
2021-01-26 22:56:07 +08:00
committed by wenlingz
parent a6420e8cfa
commit a6e666dbe7
5 changed files with 56 additions and 45 deletions

View File

@@ -235,8 +235,8 @@ static void prepare_prelaunched_vm_memmap(struct acrn_vm *vm, const struct acrn_
((vm_config->guest_flags & GUEST_FLAG_RT) != 0U)){
/* pass through Software SRAM to pre-RTVM */
ept_add_mr(vm, (uint64_t *)vm->arch_vm.nworld_eptp,
SOFTWARE_SRAM_BASE_HPA, SOFTWARE_SRAM_BASE_GPA,
SOFTWARE_SRAM_MAX_SIZE, EPT_RWX | EPT_WB);
get_software_sram_base(), SOFTWARE_SRAM_BASE_GPA,
get_software_sram_size(), EPT_RWX | EPT_WB);
continue;
}
}