From ea145a8678878b2fe9970cf8eb1b49a3fd807dec Mon Sep 17 00:00:00 2001 From: neel Date: Thu, 11 Apr 2013 04:29:45 +0000 Subject: Make the code to check if VMX is enabled more readable by using macros instead of magic numbers. Discussed with: Chris Torek --- sys/amd64/vmm/intel/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/amd64') diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index d927cd9..fb41074 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -441,7 +441,8 @@ vmx_init(void) * are set (bits 0 and 2 respectively). */ feature_control = rdmsr(MSR_IA32_FEATURE_CONTROL); - if ((feature_control & 0x5) != 0x5) { + if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 0 || + (feature_control & IA32_FEATURE_CONTROL_VMX_EN) == 0) { printf("vmx_init: VMX operation disabled by BIOS\n"); return (ENXIO); } -- cgit v1.1