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 GS.BASE save/restore
Jack Lange [Wed, 22 Oct 2008 02:06:25 +0000 (21:06 -0500)]
palacios/src/palacios/svm.c
palacios/src/palacios/svm_lowlevel.S

index 00a9ebd..4913513 100644 (file)
@@ -301,11 +301,25 @@ static int start_svm_guest(struct guest_info *info) {
 
   while (1) {
     ullong_t tmp_tsc;
+    uint_t vm_cr_low = 0, vm_cr_high = 0;
 
 
     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);
 
     rdtscll(info->time_state.cached_host_tsc);
@@ -315,6 +329,21 @@ static int start_svm_guest(struct guest_info *info) {
 
     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);
+
+      PrintDebug("KernelGSBase: %x:%x\n", vm_cr_high, vm_cr_low); 
+      */
+
+    }
     
     {
       uint_t x = 0;
index e01f069..1e36bc9 100644 (file)
@@ -139,6 +139,9 @@ v3_svm_launch:
        push    %gs;
        PUSHA
 
+       
+       
+
 
        pushq %rsi
 
@@ -146,18 +149,21 @@ v3_svm_launch:
        Restore_SVM_Registers(%rsi);
 
 
-
+       
 
        vmload;
        vmrun;
        vmsave;
 
 
-       
        Save_SVM_Registers(8(%rsp));
 
        addq $8, %rsp
 
+
+
+
+
        POPA
        pop     %gs;
        pop     %fs;