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.


timer fixes
[palacios.git] / palacios / src / palacios / vmm_emulator.c
index 2870ba0..859d6b2 100644 (file)
@@ -44,7 +44,7 @@ static int emulate_string_write_op(struct guest_info * info, struct x86_instr *
   addr_t src_addr = 0;
 
   if (dec_instr->op_type == V3_OP_MOVS) {
-    PrintError("MOVS emulation\n");
+    //   PrintError("MOVS emulation\n");
 
     if (dec_instr->dst_operand.operand != write_gva) {
       PrintError("Inconsistency between Pagefault and Instruction Decode XED_ADDR=%p, PF_ADDR=%p\n",
@@ -93,16 +93,17 @@ static int emulate_string_write_op(struct guest_info * info, struct x86_instr *
 
 
     if (dec_instr->dst_operand.size == 1) {
-      movs8((addr_t *)dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags));
+      movs8((addr_t *)&dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags));
     } else if (dec_instr->dst_operand.size == 2) {
-      movs16((addr_t *)dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags));
+      movs16((addr_t *)&dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags));
     } else if (dec_instr->dst_operand.size == 4) {
-      movs32((addr_t*)dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags));
+      movs32((addr_t*)&dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags));
     } else {
       PrintError("Invalid operand length\n");
       return -1;
     }
 
+    PrintDebug("Calling Write function\n");
 
     if (write_fn(write_gpa, (void *)dst_addr, emulation_length, priv_data) != emulation_length) {
       PrintError("Did not fully read hooked data\n");
@@ -212,7 +213,7 @@ int v3_emulate_write_op(struct guest_info * info, addr_t write_gva, addr_t write
   }
 
   if (write_fn(write_gpa, (void *)dst_addr, op_len, priv_data) != op_len) {
-    PrintError("Did not fully read hooked data\n");
+    PrintError("Did not fully write hooked data\n");
     return -1;
   }
 
@@ -232,7 +233,7 @@ int v3_emulate_read_op(struct guest_info * info, addr_t read_gva, addr_t read_gp
   int op_len = 0;
 
   PrintDebug("Emulating Read for instruction at %p\n", (void *)(addr_t)(info->rip));
-  PrintDebug("GVA=%p\n", (void *)write_gva);
+  PrintDebug("GVA=%p\n", (void *)read_gva);
 
   if (info->mem_mode == PHYSICAL_MEM) { 
     ret = read_guest_pa_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr);