X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_checkpoint.c;h=8156cdf415bc2565b061310afbd88ec6e315e62a;hb=8e4b89f4bc2e252e0c1bc7cbc52bf1f4ae2e538c;hp=7a564e61e6dbbf825c150d5915bfefa0b43c11c0;hpb=9feccf93cd8327d1d30a404a92f19716bf5a1e96;p=palacios.git diff --git a/palacios/src/palacios/vmm_checkpoint.c b/palacios/src/palacios/vmm_checkpoint.c index 7a564e6..8156cdf 100644 --- a/palacios/src/palacios/vmm_checkpoint.c +++ b/palacios/src/palacios/vmm_checkpoint.c @@ -490,7 +490,7 @@ static struct mem_migration_state *start_page_tracking(struct v3_vm_info *vm) v3_invalidate_shadow_pts(&(vm->cores[i])); } } else if (vm->cores[0].shdw_pg_mode==NESTED_PAGING) { - //v3_register_nested_paging_event_callback(vm,nested_paging_callback,m); + //v3_register_nested_paging_event_callback(vm,nested_paging_callback,m); for (i=0;inum_cores;i++) { //v3_invalidate_nested_addr_range(&(vm->cores[i]),0,vm->mem_size-1); @@ -715,6 +715,11 @@ static int load_header(struct v3_vm_info * vm, struct v3_chkpt * chkpt) { ctx = v3_chkpt_open_ctx(chkpt, "header"); + if (!ctx) { + PrintError(vm, VCORE_NONE, "Cannot open context to load header\n"); + return -1; + } + switch (v3_mach_type) { case V3_SVM_CPU: case V3_SVM_REV3_CPU: { @@ -779,6 +784,15 @@ static int load_core(struct guest_info * info, struct v3_chkpt * chkpt, v3_chkpt // Run state is needed to determine when AP cores need // to be immediately run after resume V3_CHKPT_LOAD(ctx,"run_state",info->core_run_state,loadfailout); + V3_CHKPT_LOAD(ctx,"cpu_mode",info->cpu_mode,loadfailout); + V3_CHKPT_LOAD(ctx,"mem_mode",info->mem_mode,loadfailout); + + V3_CHKPT_LOAD(ctx,"CPL",info->cpl,loadfailout); + + if (info->cpl != info->segments.ss.dpl) { + V3_Print(info->vm_info,info,"Strange, CPL=%d but ss.dpl=%d on core save\n",info->cpl,info->segments.ss.dpl); + } + V3_CHKPT_LOAD(ctx, "RIP", info->rip, loadfailout); @@ -834,7 +848,11 @@ static int load_core(struct guest_info * info, struct v3_chkpt * chkpt, v3_chkpt V3_CHKPT_LOAD(ctx, "GDTR", info->segments.gdtr, loadfailout); V3_CHKPT_LOAD(ctx, "IDTR", info->segments.idtr, loadfailout); V3_CHKPT_LOAD(ctx, "TR", info->segments.tr, loadfailout); - + + if (info->cpl != info->segments.ss.dpl) { + V3_Print(info->vm_info,info,"Strange, CPL=%d but ss.dpl=%d on core load\n",info->cpl,info->segments.ss.dpl); + } + // several MSRs... V3_CHKPT_LOAD(ctx, "STAR", info->msrs.star, loadfailout); V3_CHKPT_LOAD(ctx, "LSTAR", info->msrs.lstar, loadfailout); @@ -966,9 +984,13 @@ static int save_core(struct guest_info * info, struct v3_chkpt * chkpt, v3_chkpt } V3_CHKPT_SAVE(ctx,"run_state",info->core_run_state,savefailout); + V3_CHKPT_SAVE(ctx,"cpu_mode",info->cpu_mode,savefailout); + V3_CHKPT_SAVE(ctx,"mem_mode",info->mem_mode,savefailout); + + V3_CHKPT_SAVE(ctx,"CPL",info->cpl,savefailout); V3_CHKPT_SAVE(ctx, "RIP", info->rip, savefailout); - + // GPRs V3_CHKPT_SAVE(ctx,"RDI",info->vm_regs.rdi, savefailout); V3_CHKPT_SAVE(ctx,"RSI",info->vm_regs.rsi, savefailout);