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.


checkpoint changes to get "reset to BIOS" working.
[palacios.git] / palacios / src / palacios / vmm_checkpoint.c
index f33f64e..3258779 100644 (file)
@@ -26,6 +26,7 @@
 #include <palacios/vmx.h>
 #include <palacios/vmm_checkpoint.h>
 #include <palacios/vmm_hashtable.h>
+#include <palacios/vmm_direct_paging.h>
 
 #include <palacios/vmm_dev_mgr.h>
 
@@ -310,6 +311,8 @@ static int load_core(struct guest_info * info, struct v3_chkpt * chkpt) {
 
     ctx = v3_chkpt_open_ctx(chkpt, NULL, key_name);
 
+    v3_chkpt_load_64(ctx, "RIP", &(info->rip));
+
     V3_CHKPT_STD_LOAD(ctx, info->vm_regs);
 
     V3_CHKPT_STD_LOAD(ctx, info->ctrl_regs.cr0);
@@ -331,6 +334,20 @@ static int load_core(struct guest_info * info, struct v3_chkpt * chkpt) {
     info->cpu_mode = v3_get_vm_cpu_mode(info);
     info->mem_mode = v3_get_vm_mem_mode(info);
 
+    if (info->shdw_pg_mode == SHADOW_PAGING) {
+       if (v3_get_vm_mem_mode(info) == VIRTUAL_MEM) {
+           if (v3_activate_shadow_pt(info) == -1) {
+               PrintError("Failed to activate shadow page tables\n");
+               return -1;
+           }
+       } else {
+           if (v3_activate_passthrough_pt(info) == -1) {
+               PrintError("Failed to activate passthrough page tables\n");
+               return -1;
+           }
+       }
+    }
+
 
     switch (cpu_type) {
        case V3_SVM_CPU:
@@ -371,6 +388,8 @@ static int load_core(struct guest_info * info, struct v3_chkpt * chkpt) {
            return -1;
     }
 
+    v3_print_guest_state(info);
+
     return 0;
 }
 
@@ -382,11 +401,15 @@ static int save_core(struct guest_info * info, struct v3_chkpt * chkpt) {
 
     memset(key_name, 0, 16);
 
+    v3_print_guest_state(info);
+
 
     snprintf(key_name, 16, "guest_info%d", info->vcpu_id);
 
     ctx = v3_chkpt_open_ctx(chkpt, NULL, key_name);
 
+    v3_chkpt_save_64(ctx, "RIP", &(info->rip));
+
     V3_CHKPT_STD_SAVE(ctx, info->vm_regs);
 
     V3_CHKPT_STD_SAVE(ctx, info->ctrl_regs.cr0);