From: Maciek Swiech Date: Wed, 22 Jan 2014 22:54:08 +0000 (-0600) Subject: Addition of state to checkpoint X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=444896a3622e7918f81ccc7c0ac17edf90a6f7b9 Addition of state to checkpoint - now includes memory and cpu modes and CPL - CPL sanity check --- diff --git a/palacios/src/palacios/vmm_checkpoint.c b/palacios/src/palacios/vmm_checkpoint.c index d96cbee..6bb8a79 100644 --- a/palacios/src/palacios/vmm_checkpoint.c +++ b/palacios/src/palacios/vmm_checkpoint.c @@ -784,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); @@ -839,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); @@ -971,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);