VirtualBox

Changeset 47737 in vbox


Ignore:
Timestamp:
Aug 14, 2013 7:50:27 PM (11 years ago)
Author:
vboxsync
Message:

HM.cpp: Added APIs for checking whether VT-x and AMD-V are enabled.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/hm.h

    r47619 r47737  
    189189VMMR3DECL(bool)                 HMR3IsVpidActive(PUVM pVUM);
    190190VMMR3DECL(bool)                 HMR3IsUXActive(PUVM pVUM);
     191VMMR3DECL(bool)                 HMR3IsSvmEnabled(PUVM pUVM);
     192VMMR3DECL(bool)                 HMR3IsVmxEnabled(PUVM pUVM);
    191193
    192194VMMR3_INT_DECL(bool)            HMR3IsEventPending(PVMCPU pVCpu);
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r47705 r47737  
    26652665 * enabled.
    26662666 *
    2667  * @returns true if nested paging is being used, otherwise false.
     2667 * @returns true if VT-x or AMD-V is being used, otherwise false.
    26682668 * @param   pUVM        The user mode VM handle.
    26692669 * @sa      HMIsEnabled, HMIsEnabledNotMacro.
     
    26752675    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    26762676    return pVM->fHMEnabled; /* Don't use the macro as the GUI may query us very very early. */
     2677}
     2678
     2679
     2680/**
     2681 * External interface for querying whether VT-x is being used.
     2682 *
     2683 * @returns true if VT-x is being used, otherwise false.
     2684 * @param   pUVM        The user mode VM handle.
     2685 * @sa      HMR3IsSvmEnabled, HMIsEnabled
     2686 */
     2687VMMR3DECL(bool) HMR3IsVmxEnabled(PUVM pUVM)
     2688{
     2689    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     2690    PVM pVM = pUVM->pVM;
     2691    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     2692    return pVM->hm.s.vmx.fEnabled
     2693        && pVM->hm.s.vmx.fSupported
     2694        && pVM->fHMEnabled;
     2695}
     2696
     2697
     2698/**
     2699 * External interface for querying whether AMD-V is being used.
     2700 *
     2701 * @returns true if VT-x is being used, otherwise false.
     2702 * @param   pUVM        The user mode VM handle.
     2703 * @sa      HMR3IsVmxEnabled, HMIsEnabled
     2704 */
     2705VMMR3DECL(bool) HMR3IsSvmEnabled(PUVM pUVM)
     2706{
     2707    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     2708    PVM pVM = pUVM->pVM;
     2709    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     2710    return pVM->hm.s.svm.fEnabled
     2711        && pVM->hm.s.svm.fSupported
     2712        && pVM->fHMEnabled;
    26772713}
    26782714
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