mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user