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 generic VMM framework
[palacios.git] / palacios / src / geekos / vmx.c
index 2bfdf1a..e5f08c3 100644 (file)
@@ -126,10 +126,8 @@ static int ExecFaultingInstructionInVMM(struct VM *vm)
 }
 
 
-VmxOnRegion * Init_VMX() {
-  VmxOnRegion * region = NULL;
-
-  unsigned int ret;
+int is_vmx_capable() {
+  uint_t ret;
   union VMX_MSR featureMSR;
   
   ret = cpuid_ecx(1);
@@ -137,15 +135,26 @@ VmxOnRegion * Init_VMX() {
     Get_MSR(IA32_FEATURE_CONTROL_MSR, &featureMSR.regs.high, &featureMSR.regs.low);
 
     SerialPrintLevel(100,"MSRREGlow: 0x%.8x\n", featureMSR.regs.low);
+
     if ((featureMSR.regs.low & FEATURE_CONTROL_VALID) != FEATURE_CONTROL_VALID) {
       PrintBoth("VMX is locked -- enable in the BIOS\n");
-      return NULL;
+      return 0;
     }
   } else {
     PrintBoth("VMX not supported on this cpu\n");
-    return NULL;
+    return 0;
   }
 
+  return 1;
+
+}
+
+
+VmxOnRegion * Init_VMX() {
+  uint_t ret;
+  VmxOnRegion * region = NULL;
+
+
   region = CreateVmxOnRegion();