From 3847a4d1a99f7fb1e6ed2bf13918283d886a70ef Mon Sep 17 00:00:00 2001 From: "Zheng, Gen" Date: Thu, 12 Apr 2018 10:33:05 +0800 Subject: [PATCH] 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 Reviewed-by: Chen, Jason Cl Reviewed-by: Yakui, Zhao --- hypervisor/include/common/hypercall.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hypervisor/include/common/hypercall.h b/hypervisor/include/common/hypercall.h index 6584e94a8..9426c8b7f 100644 --- a/hypervisor/include/common/hypercall.h +++ b/hypervisor/include/common/hypercall.h @@ -370,8 +370,8 @@ static inline int check_result(int found) int found = 0; \ typeof(*(ptr)) *h_ptr = (ptr); \ typeof(*(ptr)) *g_ptr = \ - (void *)gpa2hpa_check(vm, gpa, \ - sizeof(*h_ptr), &found, true); \ + HPA2HVA(gpa2hpa_check(vm, gpa, \ + sizeof(*h_ptr), &found, true)); \ if (found) { \ *h_ptr = *g_ptr; \ } \ @@ -382,8 +382,8 @@ static inline int check_result(int found) int found = 0; \ typeof(*(ptr)) *h_ptr = (ptr); \ typeof(*(ptr)) *g_ptr = \ - (void *)gpa2hpa_check(vm, gpa, \ - sizeof(*h_ptr), &found, true); \ + HPA2HVA(gpa2hpa_check(vm, gpa, \ + sizeof(*h_ptr), &found, true)); \ if (found) { \ *g_ptr = *h_ptr; \ } \