VirtualBox

Changeset 87330 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Jan 20, 2021 7:02:24 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142306
Message:

VMM/HMR0A.asm: Reduced the number of parameters passed to SVMR0VMRun. Required extending HMInternal.mac quite a bit.

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

Legend:

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

    r86183 r87330  
    403403 * non-standard C++), we have a little hack to make them palatable.
    404404 */
     405/** @def HM_NAMELESS_UNION_TAG
     406 * For tagging a nameless union so tstASMStructs.cpp can find check the nested
     407 * structures within the union.
     408 */
    405409#ifdef VBOX_FOR_DTRACE_LIB
    406 # define HM_UNION_NM(a_Nm)  a_Nm
    407 # define HM_STRUCT_NM(a_Nm) a_Nm
     410# define HM_UNION_NM(a_Nm)              a_Nm
     411# define HM_STRUCT_NM(a_Nm)             a_Nm
     412# define HM_NAMELESS_UNION_TAG(a_Tag)
    408413#elif defined(IPRT_WITHOUT_NAMED_UNIONS_AND_STRUCTS)
    409 # define HM_UNION_NM(a_Nm)  a_Nm
    410 # define HM_STRUCT_NM(a_Nm) a_Nm
     414# define HM_UNION_NM(a_Nm)              a_Nm
     415# define HM_STRUCT_NM(a_Nm)             a_Nm
     416# define HM_NAMELESS_UNION_TAG(a_Tag)   a_Tag
    411417#else
    412418# define HM_UNION_NM(a_Nm)
    413419# define HM_STRUCT_NM(a_Nm)
     420# define HM_NAMELESS_UNION_TAG(a_Tag)
    414421#endif
    415422
     
    694701typedef R0PTRTYPE(FNHMVMXSTARTVM *) PFNHMVMXSTARTVM;
    695702
    696 /** SVM VMRun function. */
    697 typedef DECLCALLBACKTYPE(int, FNHMSVMVMRUN,(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu));
     703/** SVM VMRun function, see SVMR0VMRun(). */
     704typedef DECLCALLBACKTYPE(int, FNHMSVMVMRUN,(PVMCC pVM, PVMCPUCC pVCpu, RTHCPHYS HCPhyspVMCB));
    698705/** Pointer to a SVM VMRun function. */
    699706typedef R0PTRTYPE(FNHMSVMVMRUN *) PFNHMSVMVMRUN;
     
    918925    uint64_t                    fCtxChanged;
    919926
    920     union /* no tag! */
     927    union HM_NAMELESS_UNION_TAG(HMCPUUNION) /* no tag! */
    921928    {
    922929        /** VT-x data.   */
    923         struct
     930        struct HM_NAMELESS_UNION_TAG(HMCPUVMX)
    924931        {
    925932            /** @name Guest information.
     
    986993
    987994        /** SVM data. */
    988         struct
     995        struct HM_NAMELESS_UNION_TAG(HMCPUSVM)
    989996        {
    990997            /** Ring 0 handlers for VT-x. */
     
    9951002            /** R0 memory object for the host VMCB which holds additional host-state. */
    9961003            RTR0MEMOBJ                  hMemObjVmcbHost;
    997             /** Padding. */
     1004            /** Padding.
     1005             * @todo remove, pointless now  */
    9981006            R0PTRTYPE(void *)           pvPadding;
    9991007
     
    12251233DECLASM(int)                hmR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVMCC pVM, PVMCPUCC pVCpu,
    12261234                                                  PFNHMVMXSTARTVM pfnStartVM);
    1227 DECLASM(int)                hmR0SVMRunWrapXMM(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu,
    1228                                               PFNHMSVMVMRUN pfnVMRun);
     1235DECLASM(int)                hmR0SVMRunWrapXMM(PVMCC pVM, PVMCPUCC pVCpu, RTHCPHYS HCPhyspVMCB, PFNHMSVMVMRUN pfnVMRun);
    12291236# endif
    12301237DECLASM(void)               hmR0MdsClear(void);
  • trunk/src/VBox/VMM/include/HMInternal.mac

    r82968 r87330  
    1515; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616;
     17
     18%ifndef VMX_VMCS_GUEST_FIELD_ES
     19 %include "VBox/vmm/hm_vmx.mac"  ; For VMXRESTOREHOST
     20%endif
     21
     22
     23struc VMXVMCSINFO
     24    .pfnStartVM                     RTR0PTR_RES  1
     25    .HCPhysEPTP                     RTHCPHYS_RES 1
     26    .fVmcsState                     resd    1
     27    .fShadowVmcsState               resd    1
     28    .idHostCpuState                 resd    1
     29    .idHostCpuExec                  resd    1
     30    .cEntryMsrLoad                  resd    1
     31    .cExitMsrStore                  resd    1
     32    .cExitMsrLoad                   resd    1
     33
     34    .u32PinCtls                     resd    1
     35    .u32ProcCtls                    resd    1
     36    .u32ProcCtls2                   resd    1
     37    .u32EntryCtls                   resd    1
     38    .u32ExitCtls                    resd    1
     39    .u32XcptBitmap                  resd    1
     40    .u32XcptPFMask                  resd    1
     41    .u32XcptPFMatch                 resd    1
     42
     43    alignb 8
     44    .u64TscOffset                   resq    1
     45    .u64VmcsLinkPtr                 resq    1
     46    .u64Cr0Mask                     resq    1
     47    .u64Cr4Mask                     resq    1
     48
     49    .pvVmcs                         RTR0PTR_RES 1
     50    .pvShadowVmcs                   RTR0PTR_RES 1
     51    .pbVirtApic                     RTR0PTR_RES 1
     52    .pvMsrBitmap                    RTR0PTR_RES 1
     53    .pvGuestMsrLoad                 RTR0PTR_RES 1
     54    .pvGuestMsrStore                RTR0PTR_RES 1
     55    .pvHostMsrLoad                  RTR0PTR_RES 1
     56
     57    .fWasInRealMode                 resb    1
     58    .fSwitchedTo64on32Obsolete      resb    1
     59    alignb 8
     60    .RealMode.AttrCS                resd    1
     61    .RealMode.AttrDS                resd    1
     62    .RealMode.AttrES                resd    1
     63    .RealMode.AttrFS                resd    1
     64    .RealMode.AttrGS                resd    1
     65    .RealMode.AttrSS                resd    1
     66    .RealMode.Eflags                resd    1   ; should be EFlags?
     67    .RealMode.fRealOnV86Active      resb    1
     68
     69    alignb 8
     70    .HCPhysVmcs                     RTHCPHYS_RES 1
     71    .HCPhysShadowVmcs               RTHCPHYS_RES 1
     72    .HCPhysVirtApic                 RTHCPHYS_RES 1
     73    .HCPhysMsrBitmap                RTHCPHYS_RES 1
     74    .HCPhysGuestMsrLoad             RTHCPHYS_RES 1
     75    .HCPhysGuestMsrStore            RTHCPHYS_RES 1
     76    .HCPhysHostMsrLoad              RTHCPHYS_RES 1
     77
     78    .hMemObj                        RTR0PTR_RES  1
     79
     80    alignb 8
     81    .au64LbrFromIpMsr               resq    32
     82    .au64LbrToIpMsr                 resq    32
     83    .u64LbrTosMsr                   resq    1
     84endstruc
     85
     86struc HMCPUVMX
     87    .VmcsInfo                       resb    VMXVMCSINFO_size
     88    .VmcsInfoNstGst                 resb    VMXVMCSINFO_size
     89    .fSwitchedToNstGstVmcs          resb    1
     90    .fMergedNstGstCtls              resb    1
     91    .fCopiedNstGstToShadowVmcs      resb    1
     92    .fSwitchedNstGstFlushTlb        resb    1
     93
     94    alignb 8
     95    .u64GstMsrApicBase              resq    1
     96
     97    .u64HostMsrLStar                resq    1
     98    .u64HostMsrStar                 resq    1
     99    .u64HostMsrSfMask               resq    1
     100    .u64HostMsrKernelGsBase         resq    1
     101    .fLazyMsrs                      resd    1
     102    .fUpdatedHostAutoMsrs           resb    1
     103    alignb 4
     104    .fRestoreHostFlags              resd    1
     105    alignb 8
     106    .RestoreHost                    resb    VMXRESTOREHOST_size
     107
     108    .LastError.idCurrentCpu         resd    1
     109    .LastError.idEnteredCpu         resd    1
     110    .LastError.HCPhysCurrentVmcs    resq    1
     111    .LastError.u32VmcsRev           resd    1
     112    .LastError.u32InstrError        resd    1
     113    .LastError.u32ExitReason        resd    1
     114    .LastError.u32GuestIntrState    resd    1
     115endstruc
     116
     117struc HMCPUSVM
     118    .pfnVMRun                       RTR0PTR_RES  1
     119    .HCPhysVmcbHost                 RTHCPHYS_RES 1
     120
     121    .hMemObjVmcbHost                RTR0PTR_RES  1
     122    .pvPadding                      RTR0PTR_RES  1 ; pointless padding
     123
     124    .HCPhysVmcb                     RTHCPHYS_RES 1
     125    .hMemObjVmcb                    RTR0PTR_RES  1
     126    .pVmcb                          RTR0PTR_RES  1
     127
     128    .HCPhysMsrBitmap                RTHCPHYS_RES 1
     129    .hMemObjMsrBitmap               RTR0PTR_RES  1
     130    .pvMsrBitmap                    RTR0PTR_RES  1
     131
     132    .fSyncVTpr                      resb    1
     133    .fEmulateLongModeSysEnterExit   resb    1
     134
     135    alignb 8
     136    .u64HostTscAux                  resq    1
     137
     138    .NstGstVmcbCache                resb    40
     139endstruc
    17140
    18141struc HMCPU
     
    39162    .u32HMError                     resd    1
    40163    .rcLastExitToR3                 resd    1
     164    alignb 8
    41165    .fCtxChanged                    resq    1
    42166
    43     ; incomplete to save unnecessary pain...
     167    alignb 8
     168%if HMCPUVMX_size > HMCPUSVM_size
     169    .u                              resb    HMCPUVMX_size
     170%else
     171    .u                              resb    HMCPUSVM_size
     172%endif
     173
     174    .Event.fPending                 resd    1
     175    .Event.u32ErrCode               resd    1
     176    .Event.cbInstr                  resd    1
     177    alignb 8
     178    .Event.u64IntInfo               resq    1
     179    .Event.GCPtrFaultAddress        RTGCPTR_RES 1
     180
     181    .idEnteredCpu                   resd    1
     182    .enmShadowMode                  resd    1
     183    alignb 8
     184    .aPdpes                         resq    4
     185
     186    ; The remainer is disassembly state and statistics.
    44187endstruc
    45188
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette