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.


fixed ins/outs and moved the gs.base save/restore point
Jack Lange [Wed, 22 Oct 2008 02:13:14 +0000 (21:13 -0500)]
palacios/src/palacios/svm.c
palacios/src/palacios/svm_io.c

index 4913513..b9f4a9f 100644 (file)
@@ -307,44 +307,22 @@ static int start_svm_guest(struct guest_info *info) {
     v3_enable_ints();
     v3_clgi();
 
-    {
-
-      v3_get_msr(0xc0000101, &vm_cr_high, &vm_cr_low);
-
-      PrintDebug("GS.Base: %x:%x\n", vm_cr_high, vm_cr_low); 
-      /*
-      v3_get_msr(0xc0000102, &vm_cr_high, &vm_cr_low);
-
-      PrintDebug("KernelGSBase: %x:%x\n", vm_cr_high, vm_cr_low); 
-      */
-
-    }
 
     PrintDebug("SVM Entry to rip=%x...\n", info->rip);
 
+    v3_get_msr(0xc0000101, &vm_cr_high, &vm_cr_low);
+
     rdtscll(info->time_state.cached_host_tsc);
+
     guest_ctrl->TSC_OFFSET = info->time_state.guest_tsc - info->time_state.cached_host_tsc;
 
     v3_svm_launch((vmcb_t*)V3_PAddr(info->vmm_data), &(info->vm_regs));
-
     rdtscll(tmp_tsc);
-    PrintDebug("SVM Returned\n");
-
-
-    {
-
-      v3_set_msr(0xc0000101, vm_cr_high, vm_cr_low);
 
-      PrintDebug("GS.Base: %x:%x\n", vm_cr_high, vm_cr_low); 
-
-      /*
-      v3_get_msr(0xc0000102, &vm_cr_high, &vm_cr_low);
+    v3_set_msr(0xc0000101, vm_cr_high, vm_cr_low);
+    PrintDebug("SVM Returned\n");
 
-      PrintDebug("KernelGSBase: %x:%x\n", vm_cr_high, vm_cr_low); 
-      */
 
-    }
-    
     {
       uint_t x = 0;
       PrintDebug("RSP=%p\n", &x);
index cad3fbe..c46d45a 100644 (file)
@@ -114,7 +114,7 @@ int v3_handle_svm_io_ins(struct guest_info * info) {
   
   addr_t inst_ptr;
 
-  if (guest_va_to_host_pa(info,get_addr_linear(info,info->rip,&(info->segments.cs)),&inst_ptr)==-1) {
+  if (guest_va_to_host_va(info, get_addr_linear(info, info->rip, &(info->segments.cs)), &inst_ptr) == -1) {
     PrintError("Can't access instruction\n");
     return -1;
   }
@@ -325,7 +325,7 @@ int v3_handle_svm_io_outs(struct guest_info * info) {
   
   addr_t inst_ptr;
 
-  if (guest_va_to_host_pa(info,get_addr_linear(info,info->rip,&(info->segments.cs)),&inst_ptr)==-1) {
+  if (guest_va_to_host_va(info,get_addr_linear(info,info->rip,&(info->segments.cs)),&inst_ptr)==-1) {
     PrintError("Can't access instruction\n");
     return -1;
   }