VirtualBox

Changeset 81578 in vbox


Ignore:
Timestamp:
Oct 30, 2019 4:47:26 AM (5 years ago)
Author:
vboxsync
Message:

HMInternal.h: Alignment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/HMInternal.h

    r80911 r81578  
    691691 * This structure provides information maintained for and during the executing of a
    692692 * guest (or nested-guest) VMCS (VM control structure) using hardware-assisted VMX.
     693 *
     694 * The members here are ordered and aligned based on estimated frequency of usage
     695 * and grouped to fit within a cache line in hot code paths.
    693696 */
    694697typedef struct VMXVMCSINFO
    695698{
    696     /** @name VMLAUNCH/VMRESUME information.
     699    /** @name Auxiliary information.
    697700     * @{ */
    698701    /** Ring-0 pointer to the hardware-assisted VMX execution function. */
    699702    PFNHMVMXSTARTVM             pfnStartVM;
    700     /** @} */
    701 
    702     /** @name VMCS and related data structures.
    703      *  @{ */
    704     /** Host-physical address of the VMCS. */
    705     RTHCPHYS                    HCPhysVmcs;
    706     /** R0 memory object for the VMCS. */
    707     RTR0MEMOBJ                  hMemObjVmcs;
    708     /** Host-virtual address of the VMCS. */
    709     R0PTRTYPE(void *)           pvVmcs;
    710 
    711     /** Host-physical address of the shadow VMCS. */
    712     RTHCPHYS                    HCPhysShadowVmcs;
    713     /** R0 memory object for the shadow VMCS. */
    714     RTR0MEMOBJ                  hMemObjShadowVmcs;
    715     /** Host-virtual address of the shadow VMCS. */
    716     R0PTRTYPE(void *)           pvShadowVmcs;
    717 
    718     /** Host-physical address of the virtual APIC page. */
    719     RTHCPHYS                    HCPhysVirtApic;
    720     /** Alignment. */
    721     R0PTRTYPE(void *)           pvAlignment0;
    722     /** Host-virtual address of the virtual-APIC page. */
    723     R0PTRTYPE(uint8_t *)        pbVirtApic;
    724 
    725     /** Host-physical address of the MSR bitmap. */
    726     RTHCPHYS                    HCPhysMsrBitmap;
    727     /** R0 memory object for the MSR bitmap. */
    728     RTR0MEMOBJ                  hMemObjMsrBitmap;
    729     /** Host-virtual address of the MSR bitmap. */
    730     R0PTRTYPE(void *)           pvMsrBitmap;
    731 
    732     /** Host-physical address of the VM-entry MSR-load area. */
    733     RTHCPHYS                    HCPhysGuestMsrLoad;
    734     /** R0 memory object of the VM-entry MSR-load area. */
    735     RTR0MEMOBJ                  hMemObjGuestMsrLoad;
    736     /** Host-virtual address of the VM-entry MSR-load area. */
    737     R0PTRTYPE(void *)           pvGuestMsrLoad;
    738 
    739     /** Host-physical address of the VM-exit MSR-store area. */
    740     RTHCPHYS                    HCPhysGuestMsrStore;
    741     /** R0 memory object of the VM-exit MSR-store area. */
    742     RTR0MEMOBJ                  hMemObjGuestMsrStore;
    743     /** Host-virtual address of the VM-exit MSR-store area. */
    744     R0PTRTYPE(void *)           pvGuestMsrStore;
    745 
    746     /** Host-physical address of the VM-exit MSR-load area. */
    747     RTHCPHYS                    HCPhysHostMsrLoad;
    748     /** R0 memory object for the VM-exit MSR-load area. */
    749     RTR0MEMOBJ                  hMemObjHostMsrLoad;
    750     /** Host-virtual address of the VM-exit MSR-load area. */
    751     R0PTRTYPE(void *)           pvHostMsrLoad;
    752 
    753703    /** Host-physical address of the EPTP. */
    754704    RTHCPHYS                    HCPhysEPTP;
     705    /** The VMCS launch state, see VMX_V_VMCS_LAUNCH_STATE_XXX. */
     706    uint32_t                    fVmcsState;
     707    /** The VMCS launch state of the shadow VMCS, see VMX_V_VMCS_LAUNCH_STATE_XXX. */
     708    uint32_t                    fShadowVmcsState;
     709    /** The host CPU for which its state has been exported to this VMCS. */
     710    RTCPUID                     idHostCpuState;
     711    /** The host CPU on which we last executed this VMCS. */
     712    RTCPUID                     idHostCpuExec;
    755713    /** Number of guest MSRs in the VM-entry MSR-load area. */
    756714    uint32_t                    cEntryMsrLoad;
     
    759717    /** Number of host MSRs in the VM-exit MSR-load area. */
    760718    uint32_t                    cExitMsrLoad;
    761     /** Padding. */
    762     uint32_t                    u32Padding0;
    763     /** @} */
    764 
    765     /** @name Auxiliary information.
    766      * @{ */
    767     /** The VMCS launch state, see VMX_V_VMCS_LAUNCH_STATE_XXX. */
    768     uint32_t                    fVmcsState;
    769     /** The VMCS launch state of the shadow VMCS, see VMX_V_VMCS_LAUNCH_STATE_XXX. */
    770     uint32_t                    fShadowVmcsState;
    771     /** Set if guest was executing in real mode (extra checks). */
    772     bool                        fWasInRealMode;
    773     /** Set if the guest switched to 64-bit mode on a 32-bit host. */
    774     bool                        fSwitchedTo64on32Obsolete;
    775     /** Padding. */
    776     bool                        afPadding0[6];
    777     /** The host CPU for which its state has been exported to this VMCS. */
    778     RTCPUID                     idHostCpuState;
    779     /** The host CPU on which we last executed this VMCS. */
    780     RTCPUID                     idHostCpuExec;
    781719    /** @} */
    782720
     
    795733    /** Exception bitmap. */
    796734    uint32_t                    u32XcptBitmap;
     735    /** Page-fault exception error-code mask. */
     736    uint32_t                    u32XcptPFMask;
     737    /** Page-fault exception error-code match. */
     738    uint32_t                    u32XcptPFMatch;
     739    /** Padding. */
     740    uint32_t                    u32Alignment0;
     741    /** TSC offset. */
     742    uint64_t                    u64TscOffset;
     743    /** VMCS link pointer. */
     744    uint64_t                    u64VmcsLinkPtr;
    797745    /** CR0 guest/host mask. */
    798746    uint64_t                    u64Cr0Mask;
    799747    /** CR4 guest/host mask. */
    800748    uint64_t                    u64Cr4Mask;
    801     /** Page-fault exception error-code mask. */
    802     uint32_t                    u32XcptPFMask;
    803     /** Page-fault exception error-code match. */
    804     uint32_t                    u32XcptPFMatch;
    805     /** TSC offset. */
    806     uint64_t                    u64TscOffset;
    807     /** VMCS link pointer. */
    808     uint64_t                    u64VmcsLinkPtr;
     749    /** @} */
     750
     751    /** @name Host-virtual address of VMCS and related data structures.
     752     *  @{ */
     753    /** The VMCS. */
     754    R0PTRTYPE(void *)           pvVmcs;
     755    /** The shadow VMCS. */
     756    R0PTRTYPE(void *)           pvShadowVmcs;
     757    /** The virtual-APIC page. */
     758    R0PTRTYPE(uint8_t *)        pbVirtApic;
     759    /** The MSR bitmap. */
     760    R0PTRTYPE(void *)           pvMsrBitmap;
     761    /** The VM-entry MSR-load area. */
     762    R0PTRTYPE(void *)           pvGuestMsrLoad;
     763    /** The VM-exit MSR-store area. */
     764    R0PTRTYPE(void *)           pvGuestMsrStore;
     765    /** The VM-exit MSR-load area. */
     766    R0PTRTYPE(void *)           pvHostMsrLoad;
    809767    /** @} */
    810768
    811769    /** @name Real-mode emulation state.
    812770     * @{ */
     771    /** Set if guest was executing in real mode (extra checks). */
     772    bool                        fWasInRealMode;
     773    /** Set if the guest switched to 64-bit mode on a 32-bit host. */
     774    bool                        fSwitchedTo64on32Obsolete;
     775    /** Padding. */
     776    bool                        afPadding0[6];
    813777    struct
    814778    {
     
    825789    /** @} */
    826790
     791    /** @name Host-physical address of VMCS and related data structures.
     792     *  @{ */
     793    /** The VMCS. */
     794    RTHCPHYS                    HCPhysVmcs;
     795    /** The shadow VMCS. */
     796    RTHCPHYS                    HCPhysShadowVmcs;
     797    /** The virtual APIC page. */
     798    RTHCPHYS                    HCPhysVirtApic;
     799    /** The MSR bitmap. */
     800    RTHCPHYS                    HCPhysMsrBitmap;
     801    /** The VM-entry MSR-load area. */
     802    RTHCPHYS                    HCPhysGuestMsrLoad;
     803    /** The VM-exit MSR-store area. */
     804    RTHCPHYS                    HCPhysGuestMsrStore;
     805    /** The VM-exit MSR-load area. */
     806    RTHCPHYS                    HCPhysHostMsrLoad;
     807    /** @} */
     808
     809    /** @name R0-memory objects address of VMCS and related data structures.
     810     *  @{ */
     811    /** The VMCS. */
     812    RTR0MEMOBJ                  hMemObjVmcs;
     813    /** R0 memory object for the shadow VMCS. */
     814    RTR0MEMOBJ                  hMemObjShadowVmcs;
     815    /** R0 memory object for the MSR bitmap. */
     816    RTR0MEMOBJ                  hMemObjMsrBitmap;
     817    /** R0 memory object of the VM-entry MSR-load area. */
     818    RTR0MEMOBJ                  hMemObjGuestMsrLoad;
     819    /** R0 memory object of the VM-exit MSR-store area. */
     820    RTR0MEMOBJ                  hMemObjGuestMsrStore;
     821    /** R0 memory object for the VM-exit MSR-load area. */
     822    RTR0MEMOBJ                  hMemObjHostMsrLoad;
     823    /** @} */
     824
    827825    /** Padding. */
    828826    uint64_t                    au64Padding[2];
     
    833831typedef const VMXVMCSINFO *PCVMXVMCSINFO;
    834832AssertCompileSizeAlignment(VMXVMCSINFO, 8);
    835 AssertCompileMemberAlignment(VMXVMCSINFO, fVmcsState, 8);
    836 AssertCompileMemberAlignment(VMXVMCSINFO, u32PinCtls, 8);
     833AssertCompileMemberAlignment(VMXVMCSINFO, pfnStartVM, 8);
     834AssertCompileMemberAlignment(VMXVMCSINFO, u32PinCtls, 4);
    837835AssertCompileMemberAlignment(VMXVMCSINFO, u64VmcsLinkPtr, 8);
     836AssertCompileMemberAlignment(VMXVMCSINFO, pvVmcs, 8);
     837AssertCompileMemberAlignment(VMXVMCSINFO, HCPhysVmcs, 8);
     838AssertCompileMemberAlignment(VMXVMCSINFO, hMemObjVmcs, 8);
    838839
    839840/**
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