hv: get correct fault address for copy_to/from_gva

When doing copy_to/from_gva, it's possible the guest no page
happens on none-first page. In this case, we need get correct
fault address from gva2gpa.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
This commit is contained in:
Yin Fengwei
2018-08-07 11:36:06 +08:00
committed by lijinxia
parent 55105dbdeb
commit 63fe48c27f
6 changed files with 26 additions and 20 deletions

View File

@@ -592,7 +592,7 @@ int shell_vcpu_dumpreg(int argc, char **argv)
char temp_str[MAX_STR_SIZE];
struct vm *vm;
struct vcpu *vcpu;
uint64_t i;
uint64_t i, fault_addr;
uint64_t tmp[DUMPREG_SP_SIZE];
uint32_t err_code = 0;
@@ -676,7 +676,8 @@ int shell_vcpu_dumpreg(int argc, char **argv)
/* dump sp */
status = copy_from_gva(vcpu, tmp, vcpu_get_gpreg(vcpu, CPU_REG_RSP),
DUMPREG_SP_SIZE*sizeof(uint64_t), &err_code);
DUMPREG_SP_SIZE*sizeof(uint64_t), &err_code,
&fault_addr);
if (status < 0) {
/* copy_from_gva fail */
shell_puts("Cannot handle user gva yet!\r\n");