I'm trying to run vmxon for a few days now and still no luck. Ive done the following:
1) check for VMX support using CPUID
2) allocate a VMX region in the kernel using :
IOBufferMemoryDescriptor::inTaskWithOptions(kernel_task, kIOMemoryPhysicallyContiguous , PAGE_SIZE)
After the allocation, I zeroed all the bytes and copied the VMX rev id to the first 4 bytes of this region (Got the rev id using RDMSR on 0x480 and grabbing the 4 right bytes) - the value is 12 (hex) if that even matters.
3) Turned on cr4.vmxe, cr0.ne, cr0.pg, cr0.pe, cr4.pae.
4) Turned on A20 address line
5) Given : uint64_t physical address = region physical address. Run vmxon with &physical_address.
What am I doing wrong?