VirtualBox

Changeset 24027 in vbox for trunk/src


Ignore:
Timestamp:
Oct 23, 2009 12:17:23 PM (15 years ago)
Author:
vboxsync
Message:

Fail if VT-x or AMD-V are already enabled (Windows 7)

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

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

    r23553 r24027  
    8383#endif
    8484
     85    uint64_t val = ASMRdMsr(MSR_K6_EFER);
     86    if (val & MSR_K6_EFER_SVME)
     87        return VERR_SVM_IN_USE;
     88
    8589    /* Turn on AMD-V in the EFER MSR. */
    86     uint64_t val = ASMRdMsr(MSR_K6_EFER);
    87     if (!(val & MSR_K6_EFER_SVME))
    88         ASMWrMsr(MSR_K6_EFER, val | MSR_K6_EFER_SVME);
     90    ASMWrMsr(MSR_K6_EFER, val | MSR_K6_EFER_SVME);
    8991
    9092    /* Write the physical page address where the CPU will store the host state while executing the VM. */
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r23983 r24027  
    123123     * (which can have very bad consequences!!!)
    124124     */
     125
     126    if (ASMGetCR4() & X86_CR4_VMXE))
     127        return VERR_VMX_IN_VMX_ROOT_MODE;
    125128
    126129    /* Make sure the VMX instructions don't cause #UD faults. */
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