Changeset 62601 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Jul 27, 2016 3:46:22 PM (8 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r62478 r62601 272 272 static void hmR0SvmSetMsrPermission(PVMCPU pVCpu, unsigned uMsr, SVMMSREXITREAD enmRead, SVMMSREXITWRITE enmWrite); 273 273 static void hmR0SvmPendingEventToTrpmTrap(PVMCPU pVCpu); 274 static void hmR0SvmLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);274 static void hmR0SvmLeave(PVMCPU pVCpu); 275 275 276 276 /** @name \#VMEXIT handlers. … … 1759 1759 VMCPU_ASSERT_EMT(pVCpu); 1760 1760 1761 PVM pVM = pVCpu->CTX_SUFF(pVM);1762 PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);1763 1764 1761 /* No longjmps (log-flush, locks) in this fragile context. */ 1765 1762 VMMRZCallRing3Disable(pVCpu); … … 1767 1764 if (!pVCpu->hm.s.fLeaveDone) 1768 1765 { 1769 hmR0SvmLeave(pV M, pVCpu, pCtx);1766 hmR0SvmLeave(pVCpu); 1770 1767 pVCpu->hm.s.fLeaveDone = true; 1771 1768 } … … 2080 2077 * (longjmp, preemption, voluntary exits to ring-3) from AMD-V. 2081 2078 * 2082 * @param pVM The cross context VM structure.2083 2079 * @param pVCpu The cross context virtual CPU structure. 2084 * @param pCtx Pointer to the guest-CPU context.2085 2080 * 2086 2081 * @remarks No-long-jmp zone!!! 2087 2082 */ 2088 static void hmR0SvmLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)2083 static void hmR0SvmLeave(PVMCPU pVCpu) 2089 2084 { 2090 2085 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2132 2127 * 2133 2128 * @returns VBox status code. 2134 * @param pVM The cross context VM structure.2135 2129 * @param pVCpu The cross context virtual CPU structure. 2136 * @param pCtx Pointer to the guest-CPU context. 2137 */ 2138 static int hmR0SvmLeaveSession(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx) 2130 */ 2131 static int hmR0SvmLeaveSession(PVMCPU pVCpu) 2139 2132 { 2140 2133 HM_DISABLE_PREEMPT(); … … 2146 2139 if (!pVCpu->hm.s.fLeaveDone) 2147 2140 { 2148 hmR0SvmLeave(pV M, pVCpu, pCtx);2141 hmR0SvmLeave(pVCpu); 2149 2142 pVCpu->hm.s.fLeaveDone = true; 2150 2143 } … … 2171 2164 * 2172 2165 * @returns VBox status code. 2173 * @param pVM The cross context VM structure.2174 2166 * @param pVCpu The cross context virtual CPU structure. 2175 * @param pCtx Pointer to the guest-CPU context.2176 2167 * 2177 2168 * @remarks No-long-jmp zone!!! 2178 2169 */ 2179 static int hmR0SvmLongJmpToRing3(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)2180 { 2181 return hmR0SvmLeaveSession(pV M, pVCpu, pCtx);2170 static int hmR0SvmLongJmpToRing3(PVMCPU pVCpu) 2171 { 2172 return hmR0SvmLeaveSession(pVCpu); 2182 2173 } 2183 2174 … … 2232 2223 2233 2224 Log4(("hmR0SvmCallRing3Callback->hmR0SvmLongJmpToRing3\n")); 2234 int rc = hmR0SvmLongJmpToRing3(pVCpu ->CTX_SUFF(pVM), pVCpu, (PCPUMCTX)pvUser);2225 int rc = hmR0SvmLongJmpToRing3(pVCpu); 2235 2226 AssertRCReturn(rc, rc); 2236 2227 … … 2277 2268 2278 2269 /* Sync. the necessary state for going back to ring-3. */ 2279 hmR0SvmLeaveSession(pV M, pVCpu, pCtx);2270 hmR0SvmLeaveSession(pVCpu); 2280 2271 STAM_COUNTER_DEC(&pVCpu->hm.s.StatSwitchLongJmpToR3); 2281 2272 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r62478 r62601 7096 7096 * 7097 7097 * @returns VBox status code. 7098 * @param pVM The cross context VM structure.7099 7098 * @param pVCpu The cross context virtual CPU structure. 7100 7099 * @param pMixedCtx Pointer to the guest-CPU context. The data may … … 7105 7104 * @remarks No-long-jmp zone!!! 7106 7105 */ 7107 static int hmR0VmxLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, bool fSaveGuestState)7106 static int hmR0VmxLeave(PVMCPU pVCpu, PCPUMCTX pMixedCtx, bool fSaveGuestState) 7108 7107 { 7109 7108 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 7212 7211 * 7213 7212 * @returns VBox status code. 7214 * @param pVM The cross context VM structure.7215 7213 * @param pVCpu The cross context virtual CPU structure. 7216 7214 * @param pMixedCtx Pointer to the guest-CPU context. The data may be … … 7220 7218 * @remarks No-long-jmp zone!!! 7221 7219 */ 7222 DECLINLINE(int) hmR0VmxLeaveSession(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)7220 DECLINLINE(int) hmR0VmxLeaveSession(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 7223 7221 { 7224 7222 HM_DISABLE_PREEMPT(); … … 7231 7229 if (!pVCpu->hm.s.fLeaveDone) 7232 7230 { 7233 int rc2 = hmR0VmxLeave(pV M, pVCpu, pMixedCtx, true /* fSaveGuestState */);7231 int rc2 = hmR0VmxLeave(pVCpu, pMixedCtx, true /* fSaveGuestState */); 7234 7232 AssertRCReturnStmt(rc2, HM_RESTORE_PREEMPT(), rc2); 7235 7233 pVCpu->hm.s.fLeaveDone = true; … … 7260 7258 * 7261 7259 * @returns VBox status code. 7262 * @param pVM The cross context VM structure.7263 7260 * @param pVCpu The cross context virtual CPU structure. 7264 7261 * @param pMixedCtx Pointer to the guest-CPU context. The data may be … … 7268 7265 * @remarks No-long-jmp zone!!! 7269 7266 */ 7270 DECLINLINE(int) hmR0VmxLongJmpToRing3(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)7271 { 7272 return hmR0VmxLeaveSession(pV M, pVCpu, pMixedCtx);7267 DECLINLINE(int) hmR0VmxLongJmpToRing3(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 7268 { 7269 return hmR0VmxLeaveSession(pVCpu, pMixedCtx); 7273 7270 } 7274 7271 … … 7328 7325 7329 7326 /* Save guest state and restore host state bits. */ 7330 int rc = hmR0VmxLeaveSession(pV M, pVCpu, pMixedCtx);7327 int rc = hmR0VmxLeaveSession(pVCpu, pMixedCtx); 7331 7328 AssertRCReturn(rc, rc); 7332 7329 STAM_COUNTER_DEC(&pVCpu->hm.s.StatSwitchLongJmpToR3); … … 7430 7427 enmOperation)); 7431 7428 7432 int rc = hmR0VmxLongJmpToRing3(pVCpu ->CTX_SUFF(pVM), pVCpu, (PCPUMCTX)pvUser);7429 int rc = hmR0VmxLongJmpToRing3(pVCpu, (PCPUMCTX)pvUser); 7433 7430 AssertRCReturn(rc, rc); 7434 7431 … … 8210 8207 VMCPU_ASSERT_EMT(pVCpu); 8211 8208 8212 PVM pVM = pVCpu->CTX_SUFF(pVM);8213 8209 PCPUMCTX pMixedCtx = CPUMQueryGuestCtxPtr(pVCpu); 8214 8210 … … 8224 8220 /* Do -not- save guest-state here as we might already be in the middle of saving it (esp. bad if we are 8225 8221 holding the PGM lock while saving the guest state (see hmR0VmxSaveGuestControlRegs()). */ 8226 hmR0VmxLeave(pV M, pVCpu, pMixedCtx, false /* fSaveGuestState */);8222 hmR0VmxLeave(pVCpu, pMixedCtx, false /* fSaveGuestState */); 8227 8223 pVCpu->hm.s.fLeaveDone = true; 8228 8224 } … … 13028 13024 static int hmR0VmxExitXcptAC(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient) 13029 13025 { 13026 RT_NOREF_PV(pMixedCtx); 13030 13027 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(); 13031 13028 … … 13485 13482 static int hmR0VmxExitXcptGeneric(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient) 13486 13483 { 13484 RT_NOREF_PV(pMixedCtx); 13487 13485 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(); 13488 13486 #ifndef HMVMX_ALWAYS_TRAP_ALL_XCPTS
Note:
See TracChangeset
for help on using the changeset viewer.