X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_ctrl_regs.c;h=add91ff5ea4842adb3a3ad538877aa00ad32d5a0;hb=d13fa71cb7a372c39ea92aaa69d74d63d9e0ed8e;hp=2a3ebbda811e4880081a08b8523399aed861329b;hpb=c7dc4898f820a63f38c04add12f74d9ea1295ffc;p=palacios.git 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;