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.


*** empty log message ***
[palacios.git] / palacios / src / geekos / svm.c
index f3865ca..ab2a406 100644 (file)
@@ -43,16 +43,15 @@ int is_svm_capable() {
 
   Get_MSR(SVM_VM_CR_MSR, &vm_cr_high, &vm_cr_low);
 
+  if ((ret & CPUID_SVM_REV_AND_FEATURE_IDS_edx_np) == 1) {
+    PrintDebug("Nested Paging not supported\n");
+  }
+
   if ((vm_cr_low & SVM_VM_CR_MSR_svmdis) == 0) {
     return 1;
   }
 
   ret = cpuid_edx(CPUID_SVM_REV_AND_FEATURE_IDS);
-  
-
-  if ((ret & CPUID_SVM_REV_AND_FEATURE_IDS_edx_np) == 0) {
-    PrintDebug("Nested Paging not supported\n");
-  }
 
   if ((ret & CPUID_SVM_REV_AND_FEATURE_IDS_edx_svml) == 0) {
     PrintDebug("SVM BIOS Disabled, not unlockable\n");
@@ -317,7 +316,8 @@ void Init_VMCB(vmcb_t * vmcb, guest_info_t vm_info) {
   guest_state->rip = vm_info.rip;
 
 
-
+  //ctrl_area->instrs.instrs.CR0 = 1;
+  ctrl_area->cr_reads.crs.cr0 = 1;
   ctrl_area->cr_writes.crs.cr0 = 1;
 
   guest_state->efer |= EFER_MSR_svm_enable;
@@ -395,14 +395,10 @@ void Init_VMCB(vmcb_t * vmcb, guest_info_t vm_info) {
 
     ctrl_area->cr_reads.crs.cr3 = 1;
     ctrl_area->cr_writes.crs.cr3 = 1;
-    ctrl_area->cr_reads.crs.cr0 = 1;
-    ctrl_area->cr_writes.crs.cr0 = 1;
+
 
     ctrl_area->instrs.instrs.INVLPG = 1;
     ctrl_area->instrs.instrs.INVLPGA = 1;
-    ctrl_area->instrs.instrs.CR0 = 1;
-       
-
 
     guest_state->g_pat = 0x7040600070406ULL;