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.


updated to 64 bits based on the wrong f#@$%ing trunk
[palacios.git] / palacios / src / palacios / svm_handler.c
index ad4fe4c..159cb53 100644 (file)
@@ -1,3 +1,23 @@
+/* 
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
+ * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Jack Lange <jarusl@cs.northwestern.edu>
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
+
 #include <palacios/svm_handler.h>
 #include <palacios/vmm.h>
 #include <palacios/vm_guest_mem.h>
@@ -52,7 +72,7 @@ int handle_svm_exit(struct guest_info * info) {
   //  PrintDebug("SVM Returned: Exit Code: 0x%x \t\t(tsc=%ul)\n",exit_code, (uint_t)info->time_state.guest_tsc); 
   
   if ((0) && (exit_code < 0x4f)) {
-    char instr[32];
+    uchar_t instr[32];
     int ret;
     // Dump out the instr stream
 
@@ -258,6 +278,21 @@ int handle_svm_exit(struct guest_info * info) {
          return -1;
        }
       } else {
+       /*
+       ulong_t tsc_spread = 0;
+       ullong_t exit_tsc = 0;
+
+       ulong_t rax = (ulong_t)info->vm_regs.rbx;
+       ulong_t rdx = (ulong_t)info->vm_regs.rcx;
+
+       *(ulong_t *)(&exit_tsc) = rax;
+       *(((ulong_t *)(&exit_tsc)) + 1) = rdx; 
+
+       tsc_spread = info->exit_tsc - exit_tsc;
+
+       PrintError("VMMCALL tsc diff = %lu\n",tsc_spread); 
+       info->rip += 3;
+       */
        PrintError("VMMCALL with not emulator...\n");
        return -1;
       }
@@ -286,7 +321,7 @@ int handle_svm_exit(struct guest_info * info) {
   default: {
 
     addr_t rip_addr;
-    char buf[15];
+    uchar_t buf[15];
     addr_t host_addr;
 
     PrintDebug("Unhandled SVM Exit: %s\n", vmexit_code_to_str(exit_code));