Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added back in 32 bit support
[palacios.git] / palacios / src / palacios / vm_guest.c
index 04d887d..c2bb07d 100644 (file)
@@ -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;
 
@@ -267,7 +266,7 @@ void v3_print_guest_state(struct guest_info * info) {
 
     V3_Print("NumExits: %u\n", (uint32_t)info->num_exits);
 
-    v3_print_segments(info);
+    v3_print_segments(&(info->segments));
     v3_print_ctrl_regs(info);
 
     if (info->shdw_pg_mode == SHADOW_PAGING) {
@@ -291,20 +290,27 @@ 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) {
-           V3_Print("\t%p\n", (void *)*(uint64_t *)(host_addr + (i * 8)));
+           V3_Print("\t%p\n", (void *)*(addr_t *)(host_addr + (i * 8)));
        } else if (cpu_mode == REAL) {
            V3_Print("Don't currently handle 16 bit stacks... \n");
        } else {