| 630 | } |
| 631 | |
| 632 | static void |
| 633 | vmx_enable(void *arg __unused) |
| 634 | { |
| 635 | int error; |
| 636 | uint64_t feature_control; |
| 637 | |
| 638 | feature_control = rdmsr(MSR_IA32_FEATURE_CONTROL); |
| 639 | if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 0 || |
| 640 | (feature_control & IA32_FEATURE_CONTROL_VMX_EN) == 0) { |
| 641 | wrmsr(MSR_IA32_FEATURE_CONTROL, |
| 642 | feature_control | IA32_FEATURE_CONTROL_VMX_EN | |
| 643 | IA32_FEATURE_CONTROL_LOCK); |
| 644 | } |
| 645 | |
| 646 | load_cr4(rcr4() | CR4_VMXE); |
| 647 | |
| 648 | *(uint32_t *)vmxon_region[curcpu] = vmx_revision(); |
| 649 | error = vmxon(vmxon_region[curcpu]); |
| 650 | if (error == 0) |
| 651 | vmxon_enabled[curcpu] = 1; |
| 652 | } |
| 653 | |
| 654 | static void |
| 655 | vmx_modresume(void) |
nothing calls this directly
no test coverage detected