X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fvmx.c;h=e5f08c31ae5464fb15493ffd6c3032b8c7b7350b;hb=8126d0d154dfd37ed7997f4fa78a1c179c4d2c81;hp=2bfdf1aa610c8b80906fd1c43ad56d15f99eb6ff;hpb=888115363b482384d91d0f709e817debcc76ba52;p=palacios.git diff --git a/palacios/src/geekos/vmx.c b/palacios/src/geekos/vmx.c index 2bfdf1a..e5f08c3 100644 --- a/palacios/src/geekos/vmx.c +++ b/palacios/src/geekos/vmx.c @@ -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();