VirtualBox

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


Ignore:
Timestamp:
Jan 26, 2021 5:51:07 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142449
Message:

VMM/HMVMX: Created special versions of the hmR0VmxStartVm code as with SVM. Fixed messed up host ldtr saving/restoring and stack allocations.

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

Legend:

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

    r87431 r87439  
    706706 * @param   fResume     Whether to use VMRESUME (true) or VMLAUNCH (false).
    707707 */
    708 typedef DECLCALLBACKTYPE(int, FNHMVMXSTARTVM,(PVMCC pVM, PVMCPUCC pVCpu, RTHCUINT fResume));
     708typedef DECLCALLBACKTYPE(int, FNHMVMXSTARTVM,(PVMCC pVM, PVMCPUCC pVCpu, bool fResume));
    709709/** Pointer to a VMX StartVM function. */
    710710typedef R0PTRTYPE(FNHMVMXSTARTVM *) PFNHMVMXSTARTVM;
     
    725725    /** @name Auxiliary information.
    726726     * @{ */
    727     /** Ring-0 pointer to the hardware-assisted VMX execution function. */
    728     PFNHMVMXSTARTVM             pfnStartVM;
    729727    /** Host-physical address of the EPTP. */
    730728    RTHCPHYS                    HCPhysEPTP;
     
    854852typedef const VMXVMCSINFO *PCVMXVMCSINFO;
    855853AssertCompileSizeAlignment(VMXVMCSINFO, 8);
    856 AssertCompileMemberAlignment(VMXVMCSINFO, pfnStartVM,      8);
    857854AssertCompileMemberAlignment(VMXVMCSINFO, u32PinCtls,      4);
    858855AssertCompileMemberAlignment(VMXVMCSINFO, u64VmcsLinkPtr,  8);
     
    1001998            /** @name Guest information.
    1002999             * @{ */
     1000            /** Ring-0 pointer to the hardware-assisted VMX execution function. */
     1001            PFNHMVMXSTARTVM             pfnStartVm;
    10031002            /** Guest VMCS information. */
    10041003            VMXVMCSINFO                 VmcsInfo;
     
    13151314 * Prepares for and executes VMRUN (64-bit register context).
    13161315 *
    1317  * @returns VBox status code.
     1316 * @returns VBox status code (no informational stuff).
    13181317 * @param   pVM             The cross context VM structure. (Not used.)
    13191318 * @param   pVCpu           The cross context virtual CPU structure.
     
    13641363DECLASM(int)                hmR0VMXStartVMWrapXMM(PVMCC pVM, PVMCPUCC pVCpu, RTHCUINT fResume, PFNHMVMXSTARTVM pfnStartVM);
    13651364# endif
    1366 DECLASM(int)                hmR0VMXStartVM(PVMCC pVM, PVMCPUCC pVCpu, RTHCUINT fResume);
    1367 
     1365
     1366/**
     1367 * VMX StartVM functions.
     1368 *
     1369 * @returns VBox status code (no informational stuff).
     1370 * @param   pVM         Pointer to the cross context VM structure.
     1371 * @param   pVCpu       Pointer to the cross context per-CPU structure.
     1372 * @param   fResume     Whether to use VMRESUME (true) or VMLAUNCH (false).
     1373 *
     1374 * @remarks With spectre mitigations and the usual need for speed (/ micro
     1375 *          optimizations), we have a bunch of variations of this code depending
     1376 *          on a few precoditions.  In release builds, the code is entirely
     1377 *          without conditionals.  Debug builds have a couple of assertions that
     1378 *          shouldn't ever be triggered.
     1379 *
     1380 * @{
     1381 */
     1382DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1383DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1384DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1385DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1386DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1387DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1388DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1389DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1390DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1391DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1392DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1393DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1394DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1395DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1396DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1397DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1398DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1399DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1400DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1401DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1402DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1403DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1404DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1405DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1406DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1407DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1408DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1409DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1410DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1411DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1412DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
     1413DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMCC pVM, PVMCPUCC pVCpu, bool fResume);
    13681414/** @} */
    13691415
    13701416/** @} */
    13711417
     1418/** @} */
     1419
    13721420RT_C_DECLS_END
    13731421
  • trunk/src/VBox/VMM/include/HMInternal.mac

    r87431 r87439  
    2222
    2323struc VMXVMCSINFO
    24     .pfnStartVM                     RTR0PTR_RES  1
    2524    .HCPhysEPTP                     RTHCPHYS_RES 1
    2625    .fVmcsState                     resd    1
     
    113112
    114113struc HMCPUVMX
     114    .pfnStartVm                     RTR0PTR_RES  1
    115115    .VmcsInfo                       resb    VMXVMCSINFO_size
    116116    .VmcsInfoNstGst                 resb    VMXVMCSINFO_size
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