X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvm_guest.c;h=de0cb21c143d0fe6df5f215d4f7f5a82567703e0;hp=6b902f01c29a9a3e893160da8903ba743fe6dcb3;hb=5bf6d0c260240e314876a2fca8e3fd56bd6a1029;hpb=cd012ba87f57c1c694038f1a17f249f90f9a2be8 diff --git a/palacios/src/palacios/vm_guest.c b/palacios/src/palacios/vm_guest.c index 6b902f0..de0cb21 100644 --- a/palacios/src/palacios/vm_guest.c +++ b/palacios/src/palacios/vm_guest.c @@ -160,8 +160,7 @@ const uchar_t * v3_mem_mode_to_str(v3_mem_mode_t mode) { } -void v3_print_segments(struct guest_info * info) { - struct v3_segments * segs = &(info->segments); +void v3_print_segments(struct v3_segments * segs) { int i = 0; struct v3_segment * seg_ptr; @@ -265,7 +264,9 @@ void v3_print_guest_state(struct guest_info * info) { linear_addr = get_addr_linear(info, info->rip, &(info->segments.cs)); V3_Print("RIP Linear: %p\n", (void *)linear_addr); - v3_print_segments(info); + V3_Print("NumExits: %u\n", (uint32_t)info->num_exits); + + v3_print_segments(&(info->segments)); v3_print_ctrl_regs(info); if (info->shdw_pg_mode == SHADOW_PAGING) { @@ -276,6 +277,8 @@ void v3_print_guest_state(struct guest_info * info) { // CR4 } v3_print_GPRs(info); + + v3_print_stack(info); } @@ -287,16 +290,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); - + V3_Print("Host Address of rsp = 0x%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) {