VirtualBox

Changeset 73771 in vbox for trunk/include


Ignore:
Timestamp:
Aug 20, 2018 7:52:39 AM (6 years ago)
Author:
vboxsync
Message:

hm_vmx.h: Nested VMX: bugref:9180 Define VMCS field widths, add inline function for getting the width given the encoding.

File:
1 edited

Legend:

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

    r73756 r73771  
    11151115typedef const VMXMSRS *PCVMXMSRS;
    11161116
    1117 
    11181117/** @name VMX Basic Exit Reasons.
    11191118 * @{
     
    17811780
    17821781
     1782/** @name VMCS field encoding: Widths
     1783 * @{ */
     1784typedef enum
     1785{
     1786    VMXVMCSFIELDWIDTH_16BIT = 0,
     1787    VMXVMCSFIELDWIDTH_64BIT,
     1788    VMXVMCSFIELDWIDTH_32BIT,
     1789    VMXVMCSFIELDWIDTH_NATURAL
     1790} VMXVMCSFIELDWIDTH;
     1791AssertCompileSize(VMXVMCSFIELDWIDTH, 4);
     1792/** @} */
     1793
     1794
    17831795/** @name Pin-based VM-execution controls.
    17841796 * @{
     
    28102822
    28112823
     2824/** @defgroup grp_hm_vmx_inline    VMX Inline Helpers
     2825 * @{
     2826 */
     2827/**
     2828 * Gets the width of a VMCS field given it's encoding.
     2829 *
     2830 * @returns The VMCS field width.
     2831 * @param   uFieldEnc   The VMCS field encoding.
     2832 *
     2833 * @remarks Warning! This function does not verify the encoding is for a valid and
     2834 *          supported VMCS field.
     2835 */
     2836DECLINLINE(uint32_t) HMVmxGetVmcsFieldWidth(uint32_t uFieldEnc)
     2837{
     2838    /* Only the "HIGH" parts of all 64-bit fields have bit 0 set. */
     2839    if (uFieldEnc & RT_BIT(0))
     2840        return VMXVMCSFIELDWIDTH_32BIT;
     2841
     2842    /* Bits 13:14 contains the width of the VMCS field, see VMXVMCSFIELDWIDTH_XXX. */
     2843    return (uFieldEnc >> 13) & 0x3;
     2844}
     2845/** @} */
     2846
     2847
    28122848/** @defgroup grp_hm_vmx_asm    VMX Assembly Helpers
    28132849 * @{
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