guest: quick fix for copy_from/to_vm

h_ptr need update from second page walk

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Jason Chen CJ 2018-05-24 14:16:30 +08:00 committed by lijinxia
parent 34445008c2
commit 1b34870824
1 changed files with 2 additions and 0 deletions

View File

@ -148,6 +148,7 @@ int copy_from_vm(struct vm *vm, void *h_ptr, uint64_t gpa, uint32_t size)
g_ptr = HPA2HVA(hpa);
memcpy_s(h_ptr, len, g_ptr, len);
gpa += len;
h_ptr += len;
size -= len;
} while (size > 0);
@ -176,6 +177,7 @@ int copy_to_vm(struct vm *vm, void *h_ptr, uint64_t gpa, uint32_t size)
g_ptr = HPA2HVA(hpa);
memcpy_s(g_ptr, len, h_ptr, len);
gpa += len;
h_ptr += len;
size -= len;
} while (size > 0);