Skip to content

Commit 1b34870

Browse files
JasonChenCJlijinxia
authored andcommitted
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>
1 parent 3444500 commit 1b34870

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hypervisor/arch/x86/guest/guest.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ int copy_from_vm(struct vm *vm, void *h_ptr, uint64_t gpa, uint32_t size)
148148
g_ptr = HPA2HVA(hpa);
149149
memcpy_s(h_ptr, len, g_ptr, len);
150150
gpa += len;
151+
h_ptr += len;
151152
size -= len;
152153
} while (size > 0);
153154

@@ -176,6 +177,7 @@ int copy_to_vm(struct vm *vm, void *h_ptr, uint64_t gpa, uint32_t size)
176177
g_ptr = HPA2HVA(hpa);
177178
memcpy_s(g_ptr, len, h_ptr, len);
178179
gpa += len;
180+
h_ptr += len;
179181
size -= len;
180182
} while (size > 0);
181183

0 commit comments

Comments
 (0)