Skip to content

Commit 3847a4d

Browse files
zhenggenjren1
authored andcommitted
hypercall: bug fix on the address convertion while hypercall
Before copy data between guest and host, should convert the GPA to HVA and do the copy. Signed-off-by: Zheng, Gen <gen.zheng@intel.com> Reviewed-by: Chen, Jason Cl <jason.cj.chen@intel.com> Reviewed-by: Yakui, Zhao <yakui.zhao@intel.com>
1 parent ebba622 commit 3847a4d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hypervisor/include/common/hypercall.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ static inline int check_result(int found)
370370
int found = 0; \
371371
typeof(*(ptr)) *h_ptr = (ptr); \
372372
typeof(*(ptr)) *g_ptr = \
373-
(void *)gpa2hpa_check(vm, gpa, \
374-
sizeof(*h_ptr), &found, true); \
373+
HPA2HVA(gpa2hpa_check(vm, gpa, \
374+
sizeof(*h_ptr), &found, true)); \
375375
if (found) { \
376376
*h_ptr = *g_ptr; \
377377
} \
@@ -382,8 +382,8 @@ static inline int check_result(int found)
382382
int found = 0; \
383383
typeof(*(ptr)) *h_ptr = (ptr); \
384384
typeof(*(ptr)) *g_ptr = \
385-
(void *)gpa2hpa_check(vm, gpa, \
386-
sizeof(*h_ptr), &found, true); \
385+
HPA2HVA(gpa2hpa_check(vm, gpa, \
386+
sizeof(*h_ptr), &found, true)); \
387387
if (found) { \
388388
*g_ptr = *h_ptr; \
389389
} \

0 commit comments

Comments
 (0)