X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_ctrl_regs.c;h=add91ff5ea4842adb3a3ad538877aa00ad32d5a0;hp=2a3ebbda811e4880081a08b8523399aed861329b;hb=c0ecfba627c1d6c3f46d59bd4e5e6f883a494dc4;hpb=2282a040e60b24d3fb7c48bb197c5bff6636df67 diff --git a/palacios/src/palacios/vmm_ctrl_regs.c b/palacios/src/palacios/vmm_ctrl_regs.c index 2a3ebbd..add91ff 100644 --- a/palacios/src/palacios/vmm_ctrl_regs.c +++ b/palacios/src/palacios/vmm_ctrl_regs.c @@ -49,6 +49,11 @@ int v3_handle_cr0_write(struct guest_info * info) { } else { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); @@ -229,7 +234,11 @@ int v3_handle_cr0_read(struct guest_info * info) { } else { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } - + + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); @@ -304,6 +313,11 @@ int v3_handle_cr3_write(struct guest_info * info) { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } + if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); return -1; @@ -381,6 +395,11 @@ int v3_handle_cr3_read(struct guest_info * info) { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } + if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); return -1; @@ -440,6 +459,11 @@ int v3_handle_cr4_read(struct guest_info * info) { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } + if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); return -1; @@ -496,6 +520,12 @@ int v3_handle_cr4_write(struct guest_info * info) { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } + + if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); return -1; @@ -639,6 +669,11 @@ int v3_handle_cr8_write(struct guest_info * info) { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } + if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); return -1; @@ -681,6 +716,11 @@ int v3_handle_cr8_read(struct guest_info * info) { ret = v3_read_gva_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + if (ret!=15) { + PrintError(info->vm_info, info, "Could not read instruction\n"); + return -1; + } + if (v3_decode(info, (addr_t)instr, &dec_instr) == -1) { PrintError(info->vm_info, info, "Could not decode instruction\n"); return -1;