Changeset 79386 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 27, 2019 11:47:09 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131625
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r79384 r79386 212 212 *********************************************************************************************************************************/ 213 213 /** 214 * VMX transient state.214 * VMX per-VCPU transient state. 215 215 * 216 216 * A state structure for holding miscellaneous information across … … 295 295 /** Pointer to a const VMX transient state. */ 296 296 typedef const VMXTRANSIENT *PCVMXTRANSIENT; 297 298 297 299 298 /** … … 974 973 * 975 974 * @returns @c true if it's different, @c false otherwise. 976 * @param pVmcsInfo 975 * @param pVmcsInfo The VMCS info. object. 977 976 */ 978 977 DECL_FORCE_INLINE(bool) hmR0VmxIsSeparateExitMsrStoreAreaVmcs(PCVMXVMCSINFO pVmcsInfo) … … 1237 1236 * 1238 1237 * @returns VBox status code. 1239 * @param pVmcsInfo 1238 * @param pVmcsInfo The VMCS info. object. 1240 1239 * 1241 1240 * @remarks Can be called with interrupts disabled. … … 1258 1257 * 1259 1258 * @returns VBox status code. 1260 * @param pVmcsInfo 1259 * @param pVmcsInfo The VMCS info. object. 1261 1260 * 1262 1261 * @remarks Can be called with interrupts disabled. … … 1278 1277 * 1279 1278 * @returns VBox status code. 1280 * @param pVmcsInfo 1279 * @param pVmcsInfo The VMCS info. object. 1281 1280 * 1282 1281 * @remarks Can be called with interrupts disabled. … … 1663 1662 * 1664 1663 * @returns IPRT status code. 1665 * @param pMemObj Pointer to the ring-0 memory object. 1666 * @param ppVirt Where to store the virtual address of the 1667 * allocation. 1668 * @param pHCPhys Where to store the physical address of the 1669 * allocation. 1664 * @param pMemObj Pointer to the ring-0 memory object. 1665 * @param ppVirt Where to store the virtual address of the allocation. 1666 * @param pHCPhys Where to store the physical address of the allocation. 1670 1667 */ 1671 1668 static int hmR0VmxPageAllocZ(PRTR0MEMOBJ pMemObj, PRTR0PTR ppVirt, PRTHCPHYS pHCPhys) … … 1687 1684 * Frees and unmaps an allocated, physical page. 1688 1685 * 1689 * @param pMemObj 1690 * @param ppVirt Where to re-initialize the virtual address of1691 * allocation as0.1692 * @param pHCPhys 1693 * 1686 * @param pMemObj Pointer to the ring-0 memory object. 1687 * @param ppVirt Where to re-initialize the virtual address of allocation as 1688 * 0. 1689 * @param pHCPhys Where to re-initialize the physical address of the 1690 * allocation as 0. 1694 1691 */ 1695 1692 static void hmR0VmxPageFree(PRTR0MEMOBJ pMemObj, PRTR0PTR ppVirt, PRTHCPHYS pHCPhys) … … 1863 1860 * 1864 1861 * @returns IPRT status code. 1865 * @param pVM 1862 * @param pVM The cross context VM structure. 1866 1863 */ 1867 1864 static void hmR0VmxStructsFree(PVM pVM) … … 1902 1899 * 1903 1900 * @returns IPRT status code. 1904 * @param pVM 1901 * @param pVM The cross context VM structure. 1905 1902 */ 1906 1903 static int hmR0VmxStructsAlloc(PVM pVM) … … 2191 2188 * 2192 2189 * @returns VBox status code. 2193 * @param pVCpu 2194 * @param pVmxTransient 2195 * @param idMsr 2196 * @param uGuestMsrValue 2197 * @param fSetReadWrite 2198 * 2199 * @param fUpdateHostMsr 2200 * 2190 * @param pVCpu The cross context virtual CPU structure. 2191 * @param pVmxTransient The VMX-transient structure. 2192 * @param idMsr The MSR. 2193 * @param uGuestMsrValue Value of the guest MSR. 2194 * @param fSetReadWrite Whether to set the guest read/write access of this 2195 * MSR (thus not causing a VM-exit). 2196 * @param fUpdateHostMsr Whether to update the value of the host MSR if 2197 * necessary. 2201 2198 */ 2202 2199 static int hmR0VmxAddAutoLoadStoreMsr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t idMsr, uint64_t uGuestMsrValue, … … 2411 2408 * perform lazy restoration of the host MSRs while leaving VT-x. 2412 2409 * 2413 * @param pVCpu 2410 * @param pVCpu The cross context virtual CPU structure. 2414 2411 * 2415 2412 * @remarks No-long-jump zone!!! … … 2444 2441 * 2445 2442 * @returns true if it does, false otherwise. 2446 * @param pVCpu 2447 * @param idMsr 2443 * @param pVCpu The cross context virtual CPU structure. 2444 * @param idMsr The MSR to check. 2448 2445 */ 2449 2446 static bool hmR0VmxIsLazyGuestMsr(PCVMCPU pVCpu, uint32_t idMsr) … … 2477 2474 * MSRs. 2478 2475 * 2479 * @param pVCpu 2476 * @param pVCpu The cross context virtual CPU structure. 2480 2477 * 2481 2478 * @remarks No-long-jump zone!!! … … 2531 2528 * loaded with guest MSR values. 2532 2529 * 2533 * @param pVCpu 2530 * @param pVCpu The cross context virtual CPU structure. 2534 2531 * 2535 2532 * @remarks No-long-jump zone!!! … … 2850 2847 * 2851 2848 * @returns VBox status code. 2852 * @param pVCpu 2853 * @param GCVirt 2849 * @param pVCpu The cross context virtual CPU structure. 2850 * @param GCVirt Guest virtual address of the page to invalidate. 2854 2851 */ 2855 2852 VMMR0DECL(int) VMXR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt) … … 3192 3189 * 3193 3190 * @returns VBox status code. 3194 * @param pVM 3191 * @param pVM The cross context VM structure. 3195 3192 */ 3196 3193 static int hmR0VmxSetupTaggedTlb(PVM pVM) … … 3450 3447 * 3451 3448 * @returns VBox status code. 3452 * @param pVCpu 3449 * @param pVCpu The cross context virtual CPU structure. 3453 3450 */ 3454 3451 DECLINLINE(int) hmR0VmxSetupVmcsApicAccessAddr(PVMCPU pVCpu) … … 3466 3463 * 3467 3464 * @returns VBox status code. 3468 * @param pVCpu 3465 * @param pVCpu The cross context virtual CPU structure. 3469 3466 */ 3470 3467 DECLINLINE(int) hmR0VmxSetupVmcsVmreadBitmapAddr(PVMCPU pVCpu) … … 3481 3478 * 3482 3479 * @returns VBox status code. 3483 * @param pVCpu 3480 * @param pVCpu The cross context virtual CPU structure. 3484 3481 */ 3485 3482 DECLINLINE(int) hmR0VmxSetupVmcsVmwriteBitmapAddr(PVMCPU pVCpu) … … 3592 3589 * 3593 3590 * @returns VBox status code. 3594 * @param pVCpu 3595 * @param pVmcsInfo 3591 * @param pVCpu The cross context virtual CPU structure. 3592 * @param pVmcsInfo The VMCS info. object. 3596 3593 */ 3597 3594 static int hmR0VmxSetupVmcsPinCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo) … … 3645 3642 * 3646 3643 * @returns VBox status code. 3647 * @param pVCpu 3648 * @param pVmcsInfo 3644 * @param pVCpu The cross context virtual CPU structure. 3645 * @param pVmcsInfo The VMCS info. object. 3649 3646 */ 3650 3647 static int hmR0VmxSetupVmcsProcCtls2(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo) … … 3739 3736 * 3740 3737 * @returns VBox status code. 3741 * @param pVCpu 3742 * @param pVmcsInfo 3738 * @param pVCpu The cross context virtual CPU structure. 3739 * @param pVmcsInfo The VMCS info. object. 3743 3740 */ 3744 3741 static int hmR0VmxSetupVmcsProcCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo) … … 3848 3845 * 3849 3846 * @returns VBox status code. 3850 * @param pVCpu 3851 * @param pVmcsInfo 3847 * @param pVCpu The cross context virtual CPU structure. 3848 * @param pVmcsInfo The VMCS info. object. 3852 3849 */ 3853 3850 static int hmR0VmxSetupVmcsMiscCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo) … … 3903 3900 * 3904 3901 * @returns VBox status code. 3905 * @param pVCpu 3906 * @param pVmcsInfo 3902 * @param pVCpu The cross context virtual CPU structure. 3903 * @param pVmcsInfo The VMCS info. object. 3907 3904 */ 3908 3905 static int hmR0VmxSetupVmcsXcptBitmap(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo) … … 3936 3933 * 3937 3934 * @returns VBox status code. 3938 * @param pVCpu 3939 * @param pVmcsInfo 3935 * @param pVCpu The cross context virtual CPU structure. 3936 * @param pVmcsInfo The VMCS info. object. 3940 3937 */ 3941 3938 static int hmR0VmxSetupVmcsCtlsNested(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo) … … 4211 4208 * 4212 4209 * @returns VBox status code. 4213 * @param pVM 4210 * @param pVM The cross context VM structure. 4214 4211 */ 4215 4212 VMMR0DECL(int) VMXR0TermVM(PVM pVM) … … 4235 4232 * 4236 4233 * @returns VBox status code. 4237 * @param pVM 4234 * @param pVM The cross context VM structure. 4238 4235 */ 4239 4236 VMMR0DECL(int) VMXR0SetupVM(PVM pVM) … … 4590 4587 * 4591 4588 * @returns VBox status code. 4592 * @param pVCpu 4589 * @param pVCpu The cross context virtual CPU structure. 4593 4590 */ 4594 4591 static int hmR0VmxExportHostSegmentRegs(PVMCPU pVCpu) … … 4830 4827 * 4831 4828 * @returns VBox status code. 4832 * @param pVCpu 4829 * @param pVCpu The cross context virtual CPU structure. 4833 4830 * 4834 4831 * @remarks No-long-jump zone!!! … … 4884 4881 * 4885 4882 * @returns true if we need to load guest EFER, false otherwise. 4886 * @param pVCpu 4883 * @param pVCpu The cross context virtual CPU structure. 4887 4884 * 4888 4885 * @remarks Requires EFER, CR4. … … 5297 5294 * 5298 5295 * @returns VBox status code. 5299 * @param pVCpu 5296 * @param pVCpu The cross context virtual CPU structure. 5300 5297 * 5301 5298 * @remarks No-long-jump zone!!! … … 5321 5318 * 5322 5319 * @returns VBox status code. 5323 * @param pVCpu 5320 * @param pVCpu The cross context virtual CPU structure. 5324 5321 * 5325 5322 * @remarks No-long-jump zone!!! … … 5521 5518 * Enables VMCS shadowing for the given VMCS info. object. 5522 5519 * 5523 * @param pVCpu 5524 * @param pVmcsInfo 5520 * @param pVCpu The cross context virtual CPU structure. 5521 * @param pVmcsInfo The VMCS info. object. 5525 5522 * 5526 5523 * @remarks No-long-jump zone!!! … … 5549 5546 * Disables VMCS shadowing for the given VMCS info. object. 5550 5547 * 5551 * @param pVCpu 5552 * @param pVmcsInfo 5548 * @param pVCpu The cross context virtual CPU structure. 5549 * @param pVmcsInfo The VMCS info. object. 5553 5550 * 5554 5551 * @remarks No-long-jump zone!!! … … 6439 6436 * 6440 6437 * @returns VBox status code. 6441 * @param pVCpu 6442 * @param pVmcsInfo 6443 * @param iSegReg 6444 * @param pSelReg 6438 * @param pVCpu The cross context virtual CPU structure. 6439 * @param pVmcsInfo The VMCS info. object. 6440 * @param iSegReg The segment register number (X86_SREG_XXX). 6441 * @param pSelReg Pointer to the segment selector. 6445 6442 * 6446 6443 * @remarks No-long-jump zone!!! … … 7257 7254 * (those that have a 32-bit FULL & HIGH part). 7258 7255 * 7259 * @param pVCpu 7256 * @param pVCpu The cross context virtual CPU structure. 7260 7257 */ 7261 7258 static void hmR0VmxInitVmcsReadCache(PVMCPU pVCpu) … … 7344 7341 * 7345 7342 * @returns VBox status code. 7346 * @param pVCpu 7347 * @param idxField 7348 * @param u64Val 7343 * @param pVCpu The cross context virtual CPU structure. 7344 * @param idxField The VMCS field encoding. 7345 * @param u64Val 16, 32 or 64-bit value. 7349 7346 */ 7350 7347 VMMR0DECL(int) VMXWriteVmcs64Ex(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val) … … 7662 7659 * Sets an NMI (\#NMI) exception as pending-for-injection into the VM. 7663 7660 * 7664 * @param pVCpu 7661 * @param pVCpu The cross context virtual CPU structure. 7665 7662 */ 7666 7663 DECLINLINE(void) hmR0VmxSetPendingXcptNmi(PVMCPU pVCpu) … … 7677 7674 * Sets a double-fault (\#DF) exception as pending-for-injection into the VM. 7678 7675 * 7679 * @param pVCpu 7676 * @param pVCpu The cross context virtual CPU structure. 7680 7677 */ 7681 7678 DECLINLINE(void) hmR0VmxSetPendingXcptDF(PVMCPU pVCpu) … … 7692 7689 * Sets an invalid-opcode (\#UD) exception as pending-for-injection into the VM. 7693 7690 * 7694 * @param pVCpu 7691 * @param pVCpu The cross context virtual CPU structure. 7695 7692 */ 7696 7693 DECLINLINE(void) hmR0VmxSetPendingXcptUD(PVMCPU pVCpu) … … 7707 7704 * Sets a debug (\#DB) exception as pending-for-injection into the VM. 7708 7705 * 7709 * @param pVCpu 7706 * @param pVCpu The cross context virtual CPU structure. 7710 7707 */ 7711 7708 DECLINLINE(void) hmR0VmxSetPendingXcptDB(PVMCPU pVCpu) … … 7723 7720 * Sets a general-protection (\#GP) exception as pending-for-injection into the VM. 7724 7721 * 7725 * @param pVCpu 7726 * @param u32ErrCode 7722 * @param pVCpu The cross context virtual CPU structure. 7723 * @param u32ErrCode The error code for the general-protection exception. 7727 7724 */ 7728 7725 DECLINLINE(void) hmR0VmxSetPendingXcptGP(PVMCPU pVCpu, uint32_t u32ErrCode) … … 7739 7736 * Sets a stack (\#SS) exception as pending-for-injection into the VM. 7740 7737 * 7741 * @param pVCpu 7742 * @param u32ErrCode 7738 * @param pVCpu The cross context virtual CPU structure. 7739 * @param u32ErrCode The error code for the stack exception. 7743 7740 */ 7744 7741 DECLINLINE(void) hmR0VmxSetPendingXcptSS(PVMCPU pVCpu, uint32_t u32ErrCode) … … 8101 8098 * 8102 8099 * @returns VBox status code. 8103 * @param pVCpu 8100 * @param pVCpu The cross context virtual CPU structure. 8104 8101 * 8105 8102 * @remarks Called with interrupts and/or preemption disabled, try not to assert and … … 8133 8130 * 8134 8131 * @returns VBox status code. 8135 * @param pVCpu 8132 * @param pVCpu The cross context virtual CPU structure. 8136 8133 * 8137 8134 * @remarks Called with interrupts and/or preemption disabled, try not to assert and … … 8764 8761 * to the EM loop. 8765 8762 * 8766 * @param pVCpu 8767 * @param fStepping 8768 * 8763 * @param pVCpu The cross context virtual CPU structure. 8764 * @param fStepping Whether we are single-stepping the guest using the 8765 * hypervisor debugger. 8769 8766 */ 8770 8767 static VBOXSTRICTRC hmR0VmxCheckForceFlags(PVMCPU pVCpu, bool fStepping) … … 8844 8841 * entering from ring-3 (not longjmp returns). 8845 8842 * 8846 * @param pVCpu 8843 * @param pVCpu The cross context virtual CPU structure. 8847 8844 */ 8848 8845 static void hmR0VmxTrpmTrapToPendingEvent(PVMCPU pVCpu) … … 9186 9183 * 9187 9184 * @returns VBox status code. 9188 * @param pVCpu 9185 * @param pVCpu The cross context virtual CPU structure. 9189 9186 * 9190 9187 * @remarks No-long-jmp zone!!! … … 9230 9227 * 9231 9228 * @returns VBox status code. 9232 * @param pVCpu 9229 * @param pVCpu The cross context virtual CPU structure. 9233 9230 * 9234 9231 * @remarks No-long-jmp zone!!! … … 9249 9246 * 9250 9247 * @returns VBox status code. 9251 * @param pVCpu 9252 * @param rcExit 9253 * 9248 * @param pVCpu The cross context virtual CPU structure. 9249 * @param rcExit The reason for exiting to ring-3. Can be 9250 * VINF_VMM_UNKNOWN_RING3_CALL. 9254 9251 */ 9255 9252 static int hmR0VmxExitToRing3(PVMCPU pVCpu, VBOXSTRICTRC rcExit) … … 9445 9442 * @returns Strict VBox status code (i.e. informational status codes too). 9446 9443 * @retval VINF_EM_RESET if pushing a value to the stack caused a triple-fault. 9447 * @param pVCpu 9448 * @param uValue 9444 * @param pVCpu The cross context virtual CPU structure. 9445 * @param uValue The value to push to the guest stack. 9449 9446 */ 9450 9447 static VBOXSTRICTRC hmR0VmxRealModeGuestStackPush(PVMCPU pVCpu, uint16_t uValue) … … 9473 9470 * @retval VINF_EM_RESET if event injection resulted in a triple-fault. 9474 9471 * 9475 * @param pVCpu The cross context virtual CPU structure. 9476 * @param pVmxTransient The VMX-transient structure. 9477 * @param pEvent The event being injected. 9478 * @param pfIntrState Pointer to the VT-x guest-interruptibility-state. 9479 * This will be updated if necessary. This cannot not 9480 * be NULL. 9481 * @param fStepping Whether we're single-stepping guest execution and 9482 * should return VINF_EM_DBG_STEPPED if the event is 9483 * injected directly (registers modified by us, not by 9484 * hardware on VM-entry). 9472 * @param pVCpu The cross context virtual CPU structure. 9473 * @param pVmxTransient The VMX-transient structure. 9474 * @param pEvent The event being injected. 9475 * @param pfIntrState Pointer to the VT-x guest-interruptibility-state. This 9476 * will be updated if necessary. This cannot not be NULL. 9477 * @param fStepping Whether we're single-stepping guest execution and should 9478 * return VINF_EM_DBG_STEPPED if the event is injected 9479 * directly (registers modified by us, not by hardware on 9480 * VM-entry). 9485 9481 */ 9486 9482 static VBOXSTRICTRC hmR0VmxInjectEventVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PCHMEVENT pEvent, bool fStepping, … … 9928 9924 * 9929 9925 * @returns VBox status code. 9930 * @param pVCpu 9926 * @param pVCpu The cross context virtual CPU structure. 9931 9927 */ 9932 9928 VMMR0DECL(int) VMXR0Enter(PVMCPU pVCpu) … … 10070 10066 * 10071 10067 * @returns VBox status code. 10072 * @param pVCpu 10068 * @param pVCpu The cross context virtual CPU structure. 10073 10069 * 10074 10070 * @remarks No-long-jump zone!!! … … 10100 10096 * 10101 10097 * @returns VBox status code. 10102 * @param pVCpu 10098 * @param pVCpu The cross context virtual CPU structure. 10103 10099 * 10104 10100 * @remarks No-long-jump zone!!! … … 10948 10944 * 10949 10945 * @returns VBox status code. 10950 * @param pVCpu 10946 * @param pVCpu The cross context virtual CPU structure. 10951 10947 */ 10952 10948 static int hmR0VmxMapHCApicAccessPage(PVMCPU pVCpu) … … 11034 11030 * 11035 11031 * @returns VBox status code. 11036 * @param pVCpu 11032 * @param pVCpu The cross context virtual CPU structure. 11037 11033 */ 11038 11034 static int hmR0VmxMergeVmcsNested(PVMCPU pVCpu) … … 13408 13404 * 13409 13405 * @returns Strict VBox status code (i.e. informational status codes too). 13410 * @param pVCpu 13406 * @param pVCpu The cross context virtual CPU structure. 13411 13407 */ 13412 13408 VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPU pVCpu) … … 13759 13755 * Advances the guest RIP by the specified number of bytes. 13760 13756 * 13761 * @param pVCpu 13762 * @param cbInstr 13757 * @param pVCpu The cross context virtual CPU structure. 13758 * @param cbInstr Number of bytes to advance the RIP by. 13763 13759 * 13764 13760 * @remarks No-long-jump zone!!! … … 16988 16984 VMXVEXITINFO ExitInfo; 16989 16985 RT_ZERO(ExitInfo); 16990 ExitInfo.uReason 16991 ExitInfo.cbInstr 16992 ExitInfo.u64Qual 16986 ExitInfo.uReason = pVmxTransient->uExitReason; 16987 ExitInfo.cbInstr = pVmxTransient->cbInstr; 16988 ExitInfo.u64Qual = pVmxTransient->uExitQual; 16993 16989 return IEMExecVmxVmexitInstrWithInfo(pVCpu, &ExitInfo); 16994 16990 }
Note:
See TracChangeset
for help on using the changeset viewer.