VirtualBox

Changeset 59213 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Dec 22, 2015 3:33:10 PM (9 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Add CR4.VMXE check before setting up the VM in ring-0, some column nits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r59195 r59213  
    27252725#endif
    27262726
     2727    /* At least verify VMX is enabled, since we can't check if we're in VMX root mode without #GP'ing. */
     2728    RTCCUINTREG uHostCR4 = ASMGetCR4();
     2729    if (RT_UNLIKELY(!(uHostCR4 & X86_CR4_VMXE)))
     2730        return VERR_VMX_NOT_IN_VMX_ROOT_MODE;
     2731
    27272732    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    27282733    {
     
    31003105
    31013106/**
    3102  * Figures out if we need to swap the EFER MSR which is
    3103  * particularly expensive.
    3104  *
    3105  * We check all relevant bits. For now, that's everything
    3106  * besides LMA/LME, as these two bits are handled by VM-entry,
    3107  * see hmR0VmxLoadGuestExitCtls() and
     3107 * Figures out if we need to swap the EFER MSR which is particularly expensive.
     3108 *
     3109 * We check all relevant bits. For now, that's everything besides LMA/LME, as
     3110 * these two bits are handled by VM-entry, see hmR0VmxLoadGuestExitCtls() and
    31083111 * hmR0VMxLoadGuestEntryCtls().
    31093112 *
     
    79897992
    79907993#ifdef VBOX_STRICT
    7991     /* Make sure we're in VMX root mode. */
    7992     RTCCUINTREG u32HostCR4 = ASMGetCR4();
    7993     if (!(u32HostCR4 & X86_CR4_VMXE))
     7994    /* At least verify VMX is enabled, since we can't check if we're in VMX root mode without #GP'ing. */
     7995    RTCCUINTREG uHostCR4 = ASMGetCR4();
     7996    if (!(uHostCR4 & X86_CR4_VMXE))
    79947997    {
    79957998        LogRel(("VMXR0Enter: X86_CR4_VMXE bit in CR4 is not set!\n"));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette