X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvm_guest.c;h=44673cb0403337e7ff68160bbb35637a92499da5;hb=123a1ba27ea09c8fa77a1b36ce625b43d7c48b14;hp=04d887d3c9d4c4835bc3b7de6d414dd3cde11860;hpb=4290e5f20a4ea5e5f32cb8228ac4d7446dc1021b;p=palacios.git diff --git a/palacios/src/palacios/vm_guest.c b/palacios/src/palacios/vm_guest.c index 04d887d..44673cb 100644 --- a/palacios/src/palacios/vm_guest.c +++ b/palacios/src/palacios/vm_guest.c @@ -291,16 +291,23 @@ void v3_print_stack(struct guest_info * info) { linear_addr = get_addr_linear(info, info->vm_regs.rsp, &(info->segments.ss)); - + + V3_Print("Stack at %p:\n", (void *)linear_addr); + if (info->mem_mode == PHYSICAL_MEM) { - guest_pa_to_host_va(info, linear_addr, &host_addr); + if (guest_pa_to_host_va(info, linear_addr, &host_addr) == -1) { + PrintError("Could not translate Stack address\n"); + return; + } } else if (info->mem_mode == VIRTUAL_MEM) { - guest_va_to_host_va(info, linear_addr, &host_addr); + if (guest_va_to_host_va(info, linear_addr, &host_addr) == -1) { + PrintError("Could not translate Virtual Stack address\n"); + return; + } } V3_Print("Host Address of rsp = 0x%p\n", (void *)host_addr); - V3_Print("Stack at %p:\n", (void *)host_addr); - + // We start i at one because the current stack pointer points to an unused stack element for (i = 0; i <= 24; i++) { if (cpu_mode == LONG) {