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.


Added RTC functionality (including interrupt injection) to nvram
[palacios.git] / palacios / src / palacios / svm_handler.c
index 1545cad..73f154a 100644 (file)
@@ -32,8 +32,11 @@ int handle_svm_exit(struct guest_info * info) {
   info->ctrl_regs.cr4 = guest_state->cr4;
   info->ctrl_regs.cr8 = guest_ctrl->guest_ctrl.V_TPR;
   info->ctrl_regs.rflags = guest_state->rflags;
+  info->ctrl_regs.efer = guest_state->efer;
 
   get_vmcb_segments((vmcb_t*)(info->vmm_data), &(info->segments));
+  info->cpu_mode = get_cpu_mode(info);
+  info->mem_mode = get_mem_mode(info);
 
 
   exit_code = guest_ctrl->exit_code;
@@ -230,17 +233,22 @@ int handle_svm_exit(struct guest_info * info) {
 
     PrintError("Host Address of rip = 0x%x\n", host_addr);
 
-    memset(buf, 0, 15);
+    memset(buf, 0, 32);
     
-    PrintError("Reading from 0x%x in guest\n", rip_addr);
+    PrintError("Reading instruction stream in guest\n", rip_addr);
     
     if (info->mem_mode == PHYSICAL_MEM) {
-      read_guest_pa_memory(info, rip_addr, 15, buf);
+      read_guest_pa_memory(info, rip_addr-16, 32, buf);
     } else {
-      read_guest_va_memory(info, rip_addr, 15, buf);
+      read_guest_va_memory(info, rip_addr-16, 32, buf);
     }
 
-    PrintTraceMemDump(buf, 15);
+    PrintDebug("16 bytes before Rip\n");
+    PrintTraceMemDump(buf, 16);
+    PrintDebug("Rip onward\n");
+    PrintTraceMemDump(buf+16, 16);
+
+
 
     return -1;
 
@@ -314,16 +322,19 @@ int handle_svm_exit(struct guest_info * info) {
       return -1;
     }
 
+  } else {
+#ifdef DEBUG_INTERRUPTS
+    PrintDebug("No interrupts/exceptions pending\n");
+#endif
   }
 
-
   guest_state->cr0 = info->ctrl_regs.cr0;
   guest_state->cr2 = info->ctrl_regs.cr2;
   guest_state->cr3 = info->ctrl_regs.cr3;
   guest_state->cr4 = info->ctrl_regs.cr4;
   guest_ctrl->guest_ctrl.V_TPR = info->ctrl_regs.cr8 & 0xff;
   guest_state->rflags = info->ctrl_regs.rflags;
-
+  guest_state->efer = info->ctrl_regs.efer;
 
   guest_state->cpl = info->cpl;