VirtualBox

Changeset 73406 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jul 31, 2018 10:29:21 AM (6 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 Implement MSR_IA32_VMX_VMCS_ENUM.

File:
1 edited

Legend:

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

    r73395 r73406  
    21872187
    21882188
    2189 /** @name VMX_XDTR_INSINFO_XXX - VMX_EXIT_XDTR_ACCESS instruction information
     2189/** @name VMX_XDTR_INSINFO_XXX - VMX_EXIT_XDTR_ACCESS instruction information.
    21902190 * Found in VMX_VMCS32_RO_EXIT_INSTR_INFO.
    21912191 * @{
     
    22422242
    22432243
    2244 /** @name VMX_YYTR_INSINFO_XXX - VMX_EXIT_TR_ACCESS instruction information
     2244/** @name VMX_YYTR_INSINFO_XXX - VMX_EXIT_TR_ACCESS instruction information.
    22452245 * Found in VMX_VMCS32_RO_EXIT_INSTR_INFO.
    22462246 * This is similar to VMX_XDTR_INSINFO_XXX.
     
    23182318
    23192319
    2320 /** @defgroup grp_hm_vmx_emu    VMX emulation.
    2321  * @{
    2322  */
    2323 /** VMCS revision identifier used for emulating VMX (bit 31 MBZ). Bump this
    2324  *  arbitarily chosen identifier if incompatible changes to the layout of our VMCS
    2325  *  structure is done. */
    2326 #define VMX_E_VMCS_REVISION_ID                                  UINT32_C(0x1d000001)
    2327 AssertCompile(!(VMX_E_VMCS_REVISION_ID & RT_BIT(31)));
     2320/** @name VMCS field encoding.
     2321 * @{ */
     2322#define VMX_VMCS_ENC_GET_INDEX(a)
     2323
     2324#define VMX_BF_VMCS_ENC_ACCESS_TYPE_SHIFT                       0
     2325#define VMX_BF_VMCS_ENC_ACCESS_TYPE_MASK                        UINT32_C(0x00000001)
     2326#define VMX_BF_VMCS_ENC_INDEX_SHIFT                             1
     2327#define VMX_BF_VMCS_ENC_INDEX_MASK                              UINT32_C(0x000003fe)
     2328#define VMX_BF_VMCS_ENC_TYPE_SHIFT                              10
     2329#define VMX_BF_VMCS_ENC_TYPE_MASK                               UINT32_C(0x00000c00)
     2330#define VMX_BF_VMCS_ENC_RSVD_12_SHIFT                           12
     2331#define VMX_BF_VMCS_ENC_RSVD_12_MASK                            UINT32_C(0x00001000)
     2332#define VMX_BF_VMCS_ENC_WIDTH_SHIFT                             13
     2333#define VMX_BF_VMCS_ENC_WIDTH_MASK                              UINT32_C(0x00006000)
     2334#define VMX_BF_VMCS_ENC_RSVD_15_31_SHIFT                        15
     2335#define VMX_BF_VMCS_ENC_RSVD_15_31_MASK                         UINT32_C(0xffff8000)
     2336RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_VMCS_ENC_, UINT32_C(0), UINT32_MAX,
     2337                            (ACCESS_TYPE, INDEX, TYPE, RSVD_12, WIDTH, RSVD_15_31));
     2338/** @} */
     2339
     2340
     2341/** @defgroup grp_hm_vmx_virt    VMX virtualization.
     2342 * @{
     2343 */
    23282344
    23292345/** CR0 bits set here must always be set when in VMX operation. */
    2330 #define VMX_E_CR0_FIXED0                                        (X86_CR0_PE | X86_CR0_NE | X86_CR0_PG)
     2346#define VMX_V_CR0_FIXED0                                        (X86_CR0_PE | X86_CR0_NE | X86_CR0_PG)
    23312347/** CR4 bits set here must always be set when in VMX operation. */
    2332 #define VMX_E_CR4_FIXED0                                        (X86_CR4_VMXE)
    2333 
     2348#define VMX_V_CR4_FIXED0                                        (X86_CR4_VMXE)
     2349
     2350/** Virtual VMCS revision ID. Bump this arbitarily chosen identifier if incompatible
     2351 *  changes to the layout of VMXVVMCS is done.  Bit 31 MBZ.  */
     2352#define VMX_V_VMCS_REVISION_ID                                  UINT32_C(0x1d000001)
     2353AssertCompile(!(VMX_V_VMCS_REVISION_ID & RT_BIT(31)));
     2354
     2355/** The highest index value used for VMCS field encoding. */
     2356#define VMX_V_VMCS_MAX_INDEX                                    RT_BF_GET(VMX_VMCS32_PREEMPT_TIMER_VALUE, VMX_BF_VMCS_ENC_INDEX)
     2357
     2358/**
     2359 * Virtual VMCS.
     2360 * This is our custom format and merged into the actual VMCS (/shadow) when we
     2361 * execute nested-guest code using hardware-assisted VMX.
     2362 *
     2363 * The first 8 bytes are as per Intel spec. 24.2 "Format of the VMCS Region".
     2364 */
     2365#pragma pack(1)
     2366typedef struct
     2367{
     2368    /** Revision identifier. */
     2369    uint32_t            u31RevisionId : 31;
     2370    /** Whether this is a shadow VMCS. */
     2371    uint32_t            fIsShadowVmcs : 1;
     2372
     2373    /** VMX-abort indicator. */
     2374    uint32_t            u32VmxAbortId;
     2375    /** @todo VMCS data. We can use RTUINT64U for the full/high 64-bit VMCS fields. */
     2376    uint8_t             abPadding0[X86_PAGE_4K_SIZE - 8];
     2377} VMXVVMCS;
     2378#pragma pack()
     2379AssertCompileSize(VMXVVMCS, X86_PAGE_4K_SIZE);
     2380AssertCompileMemberOffset(VMXVVMCS, u32VmxAbortId, 4);
     2381/** Pointer to the VMXVVMCS struct. */
     2382typedef VMXVVMCS *PVMXVVMCS;
     2383/** Pointer to a const VMXVVMCS struct. */
     2384typedef const VMXVVMCS *PCVMXVVMCS;
    23342385
    23352386/** @} */
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