mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 09:17:58 +00:00
hv:move 2 APIs from hypervisor.h to guest_memory.c
move gva2hva() & hva2gpa() to guest_memory.c, we will remove hypervisor.h in the future. Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
@@ -424,3 +424,14 @@ int32_t copy_to_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
{
|
||||
return copy_gva(vcpu, h_ptr, gva, size, err_code, fault_addr, 0);
|
||||
}
|
||||
|
||||
/* gpa --> hpa -->hva */
|
||||
void *gpa2hva(struct acrn_vm *vm, uint64_t x)
|
||||
{
|
||||
return hpa2hva(gpa2hpa(vm, x));
|
||||
}
|
||||
|
||||
uint64_t hva2gpa(struct acrn_vm *vm, void *x)
|
||||
{
|
||||
return (is_sos_vm(vm)) ? sos_vm_hpa2gpa(hva2hpa(x)) : INVALID_GPA;
|
||||
}
|
||||
|
Reference in New Issue
Block a user