- Timestamp:
- Oct 12, 2018 10:42:58 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/vm.h
r74789 r74790 692 692 693 693 /** @def VM_FF_IS_SET 694 * Checks if a force action flag is set.694 * Checks if single a force action flag is set. 695 695 * 696 696 * @param pVM The cross context VM structure. 697 697 * @param fFlag The flag to check. 698 */ 699 #define VM_FF_IS_SET(pVM, fFlag) (((pVM)->fGlobalForcedActions & (fFlag)) == (fFlag)) 700 698 * @sa VM_FF_IS_ANY_SET 699 */ 700 #if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA) 701 # define VM_FF_IS_SET(pVM, fFlag) (((pVM)->fGlobalForcedActions & (fFlag)) == (fFlag)) 702 #else 703 # define VM_FF_IS_SET(pVM, fFlag) \ 704 ([](PVM a_pVM) -> bool \ 705 { \ 706 AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \ 707 return (a_pVM->fGlobalForcedActions & (fFlag)) == (fFlag); \ 708 }(pVM)) 709 #endif 701 710 702 711 /** @def VMCPU_FF_IS_SET 703 * Checks if a force action flag is set for the given VCPU.712 * Checks if a single force action flag is set for the given VCPU. 704 713 * 705 714 * @param pVCpu The cross context virtual CPU structure. -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r73324 r74790 1080 1080 return rc; 1081 1081 } 1082 if (RT_UNLIKELY(VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY)))1082 if (RT_UNLIKELY(VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY))) 1083 1083 return VINF_EM_NO_MEMORY; 1084 1084 } … … 2162 2162 if ( cPages > 1 2163 2163 && !(uErr & X86_TRAP_PF_P) 2164 && !VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))2164 && !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 2165 2165 { 2166 2166 /* … … 2434 2434 if ( cPages > 1 2435 2435 && !(uErr & X86_TRAP_PF_P) 2436 && !VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))2436 && !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 2437 2437 { 2438 2438 /* … … 2462 2462 SHW_PTE_IS_TRACK_DIRTY(pPTDst->a[iPTDst]) ? " Track-Dirty" : "")); 2463 2463 2464 if (RT_UNLIKELY(VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY)))2464 if (RT_UNLIKELY(VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY))) 2465 2465 break; 2466 2466 } … … 3116 3116 unsigned iPTDst = 0; 3117 3117 while ( iPTDst < RT_ELEMENTS(pPTDst->a) 3118 && !VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))3118 && !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 3119 3119 { 3120 3120 if (pRam && GCPhys >= pRam->GCPhys) … … 3151 3151 rc = pgmPhysPageMakeWritable(pVM, pPage, GCPhys); 3152 3152 AssertRCReturn(rc, rc); 3153 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))3153 if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 3154 3154 break; 3155 3155 } … … 3426 3426 SHW_PTE_IS_TRACK_DIRTY(pPTDst->a[iPTDst]) ? " Track-Dirty" : "")); 3427 3427 3428 if (RT_UNLIKELY(VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY)))3428 if (RT_UNLIKELY(VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY))) 3429 3429 break; 3430 3430 } -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r74789 r74790 4243 4243 { 4244 4244 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchHmToR3FF); 4245 int rc = RT_ UNLIKELY(VM_FF_IS_PENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3;4245 int rc = RT_LIKELY(!VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_RAW_TO_R3 : VINF_EM_NO_MEMORY; 4246 4246 Log4Func(("HM_TO_R3 forcing us back to ring-3. rc=%d\n", rc)); 4247 4247 return rc; … … 4257 4257 4258 4258 /* Pending PGM pool flushes. */ 4259 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_POOL_FLUSH_PENDING))4259 if (VM_FF_IS_SET(pVM, VM_FF_PGM_POOL_FLUSH_PENDING)) 4260 4260 { 4261 4261 Log4Func(("PGM pool flush pending forcing us back to ring-3\n")); … … 4264 4264 4265 4265 /* Pending DMA requests. */ 4266 if (VM_FF_IS_ PENDING(pVM, VM_FF_PDM_DMA))4266 if (VM_FF_IS_SET(pVM, VM_FF_PDM_DMA)) 4267 4267 { 4268 4268 Log4Func(("Pending DMA request forcing us back to ring-3\n")); -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r74789 r74790 6926 6926 { 6927 6927 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchHmToR3FF); 6928 int rc2 = RT_ UNLIKELY(VM_FF_IS_PENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3;6928 int rc2 = RT_LIKELY(!VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_RAW_TO_R3 : VINF_EM_NO_MEMORY; 6929 6929 Log4Func(("HM_TO_R3 forcing us back to ring-3. rc=%d\n", rc2)); 6930 6930 return rc2; … … 6932 6932 6933 6933 /* Pending VM request packets, such as hardware interrupts. */ 6934 if ( VM_FF_IS_ PENDING(pVM, VM_FF_REQUEST)6934 if ( VM_FF_IS_SET(pVM, VM_FF_REQUEST) 6935 6935 || VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_REQUEST)) 6936 6936 { … … 6940 6940 6941 6941 /* Pending PGM pool flushes. */ 6942 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_POOL_FLUSH_PENDING))6942 if (VM_FF_IS_SET(pVM, VM_FF_PGM_POOL_FLUSH_PENDING)) 6943 6943 { 6944 6944 Log4Func(("PGM pool flush pending forcing us back to ring-3\n")); … … 6947 6947 6948 6948 /* Pending DMA requests. */ 6949 if (VM_FF_IS_ PENDING(pVM, VM_FF_PDM_DMA))6949 if (VM_FF_IS_SET(pVM, VM_FF_PDM_DMA)) 6950 6950 { 6951 6951 Log4Func(("Pending DMA request forcing us back to ring-3\n")); -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r74785 r74790 298 298 first. The request processing is a bit crazy, but 299 299 unfortunately required by plugin unloading. */ 300 if ( VM_FF_IS_ PENDING(pVM, VM_FF_REQUEST)300 if ( VM_FF_IS_SET(pVM, VM_FF_REQUEST) 301 301 || VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_REQUEST)) 302 302 { … … 309 309 } 310 310 /* Need to handle rendezvous too, for generic debug event management. */ 311 else if (VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))311 else if (VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 312 312 { 313 313 rc = VMMR3EmtRendezvousFF(pVM, pVCpu); … … 391 391 392 392 /* Process priority stuff. */ 393 if ( VM_FF_IS_ PENDING(pVM, VM_FF_REQUEST)393 if ( VM_FF_IS_SET(pVM, VM_FF_REQUEST) 394 394 || VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_REQUEST)) 395 395 { … … 847 847 } 848 848 849 if (VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))849 if (VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 850 850 { 851 851 rc = VMMR3EmtRendezvousFF(pVM, pVCpu); 852 852 cPollHack = 1; 853 853 } 854 else if ( VM_FF_IS_ PENDING(pVM, VM_FF_REQUEST)854 else if ( VM_FF_IS_SET(pVM, VM_FF_REQUEST) 855 855 || VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_REQUEST)) 856 856 { -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r74789 r74790 1700 1700 #endif 1701 1701 1702 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))1702 if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 1703 1703 { 1704 1704 if ( rc > VINF_EM_NO_MEMORY … … 1869 1869 * EMT Rendezvous (must be serviced before termination). 1870 1870 */ 1871 if (VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))1871 if (VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 1872 1872 { 1873 1873 CPUM_IMPORT_EXTRN_RCSTRICT(pVCpu, ~CPUMCTX_EXTRN_KEEPER_MASK, rc); … … 1890 1890 * State change request (cleared by vmR3SetStateLocked). 1891 1891 */ 1892 if (VM_FF_IS_ PENDING(pVM, VM_FF_CHECK_VM_STATE))1892 if (VM_FF_IS_SET(pVM, VM_FF_CHECK_VM_STATE)) 1893 1893 { 1894 1894 VMSTATE enmState = VMR3GetState(pVM); … … 1952 1952 * Out of memory? Putting this after CSAM as it may in theory cause us to run out of memory. 1953 1953 */ 1954 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))1954 if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 1955 1955 { 1956 1956 rc2 = PGMR3PhysAllocateHandyPages(pVM); … … 1986 1986 * EMT Rendezvous (make sure they are handled before the requests). 1987 1987 */ 1988 if (VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))1988 if (VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 1989 1989 { 1990 1990 CPUM_IMPORT_EXTRN_RCSTRICT(pVCpu, ~CPUMCTX_EXTRN_KEEPER_MASK, rc); … … 2100 2100 * Timers before interrupts. 2101 2101 */ 2102 if ( 2103 && !VM_FF_IS_PENDING(pVM, VM_FF_PGM_NO_MEMORY))2102 if ( VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_TIMER) 2103 && !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 2104 2104 TMR3TimerQueuesDo(pVM); 2105 2105 … … 2122 2122 * you might think. 2123 2123 */ 2124 if ( 2125 && !VM_FF_IS_PENDING(pVM, VM_FF_PGM_NO_MEMORY))2124 if ( VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS) 2125 && !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 2126 2126 { 2127 2127 CPUM_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_RIP); … … 2139 2139 */ 2140 2140 bool fWakeupPending = false; 2141 if ( !VM_FF_IS_PENDING(pVM, VM_FF_PGM_NO_MEMORY)2142 && 2141 if ( !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY) 2142 && (!rc || rc >= VINF_EM_RESCHEDULE_HM)) 2143 2143 { 2144 2144 if ( !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS) … … 2209 2209 * Debugger Facility request. 2210 2210 */ 2211 if ( ( VM_FF_IS_ PENDING(pVM, VM_FF_DBGF)2211 if ( ( VM_FF_IS_SET(pVM, VM_FF_DBGF) 2212 2212 || VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_DBGF) ) 2213 && !VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY) )2213 && !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY) ) 2214 2214 { 2215 2215 CPUM_IMPORT_EXTRN_RCSTRICT(pVCpu, ~CPUMCTX_EXTRN_KEEPER_MASK, rc); … … 2222 2222 */ 2223 2223 if ( !fWakeupPending /* don't miss the wakeup from EMSTATE_HALTED! */ 2224 && VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))2224 && VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 2225 2225 { 2226 2226 CPUM_IMPORT_EXTRN_RCSTRICT(pVCpu, ~CPUMCTX_EXTRN_KEEPER_MASK, rc); … … 2243 2243 */ 2244 2244 if ( !fWakeupPending /* don't miss the wakeup from EMSTATE_HALTED! */ 2245 && VM_FF_IS_ PENDING(pVM, VM_FF_CHECK_VM_STATE))2245 && VM_FF_IS_SET(pVM, VM_FF_CHECK_VM_STATE)) 2246 2246 { 2247 2247 VMSTATE enmState = VMR3GetState(pVM); … … 2272 2272 * than us since we can terminate without allocating more memory. 2273 2273 */ 2274 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))2274 if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 2275 2275 { 2276 2276 rc2 = PGMR3PhysAllocateHandyPages(pVM); … … 2283 2283 * If the virtual sync clock is still stopped, make TM restart it. 2284 2284 */ 2285 if (VM_FF_IS_ PENDING(pVM, VM_FF_TM_VIRTUAL_SYNC))2285 if (VM_FF_IS_SET(pVM, VM_FF_TM_VIRTUAL_SYNC)) 2286 2286 TMR3VirtualSyncFF(pVM, pVCpu); 2287 2287 … … 2290 2290 * Debug, pause the VM. 2291 2291 */ 2292 if (VM_FF_IS_ PENDING(pVM, VM_FF_DEBUG_SUSPEND))2292 if (VM_FF_IS_SET(pVM, VM_FF_DEBUG_SUSPEND)) 2293 2293 { 2294 2294 VM_FF_CLEAR(pVM, VM_FF_DEBUG_SUSPEND); -
trunk/src/VBox/VMM/VMMR3/EMHM.cpp
r74789 r74790 354 354 * this check. 355 355 */ 356 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))356 if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 357 357 return VINF_EM_NO_MEMORY; 358 358 -
trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp
r74789 r74790 330 330 * this check. 331 331 */ 332 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))332 if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 333 333 return VINF_EM_NO_MEMORY; 334 334 -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r74789 r74790 1255 1255 * this check. 1256 1256 */ 1257 if (VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY))1257 if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)) 1258 1258 return VINF_EM_NO_MEMORY; 1259 1259 -
trunk/src/VBox/VMM/VMMR3/FTM.cpp
r69111 r74790 1338 1338 while ((rc = PDMCritSectTryEnter(&pVM->ftm.s.CritSect)) == VERR_SEM_BUSY) 1339 1339 { 1340 if (VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))1340 if (VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 1341 1341 { 1342 1342 rc = VMMR3EmtRendezvousFF(pVM, pVCpu); … … 1344 1344 } 1345 1345 1346 if (VM_FF_IS_ PENDING(pVM, VM_FF_REQUEST))1346 if (VM_FF_IS_SET(pVM, VM_FF_REQUEST)) 1347 1347 { 1348 1348 rc = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY, true /*fPriorityOnly*/); -
trunk/src/VBox/VMM/VMMR3/PDMQueue.cpp
r73097 r74790 663 663 /* We're done if there were no inserts while we were busy. */ 664 664 if ( !ASMBitTest(&pVM->pdm.s.fQueueFlushing, PDM_QUEUE_FLUSH_FLAG_PENDING_BIT) 665 && !VM_FF_IS_ PENDING(pVM, VM_FF_PDM_QUEUES))665 && !VM_FF_IS_SET(pVM, VM_FF_PDM_QUEUES)) 666 666 break; 667 667 VM_FF_CLEAR(pVM, VM_FF_PDM_QUEUES); -
trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
r74789 r74790 165 165 } 166 166 167 if (VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))167 if (VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 168 168 { 169 169 rc = VMMR3EmtRendezvousFF(pVM, &pVM->aCpus[idCpu]); -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r74785 r74790 2361 2361 while (!ASMAtomicCmpXchgU32(&pVM->vmm.s.u32RendezvousLock, 0x77778888, 0)) 2362 2362 { 2363 if (VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS))2363 if (VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)) 2364 2364 { 2365 2365 rc = VMMR3EmtRendezvousFF(pVM, pVCpu); … … 2375 2375 2376 2376 Log(("VMMR3EmtRendezvous: %#x EMT#%u\n", fFlags, pVCpu->idCpu)); 2377 Assert(!VM_FF_IS_ PENDING(pVM, VM_FF_EMT_RENDEZVOUS));2377 Assert(!VM_FF_IS_SET(pVM, VM_FF_EMT_RENDEZVOUS)); 2378 2378 Assert(!pVCpu->vmm.s.fInRendezvous); 2379 2379 pVCpu->vmm.s.fInRendezvous = true; -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r74789 r74790 184 184 TMTimerPollVoid(pVM, pVCpu); 185 185 Log2(("TMTimerPoll at %08RX32 - VM_FF_TM_VIRTUAL_SYNC=%d VM_FF_TM_VIRTUAL_SYNC=%d\n", pRegFrame->eip, 186 VM_FF_IS_ PENDING(pVM, VM_FF_TM_VIRTUAL_SYNC), VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_TIMER)));186 VM_FF_IS_SET(pVM, VM_FF_TM_VIRTUAL_SYNC), VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_TIMER))); 187 187 } 188 188 } … … 223 223 { 224 224 /* The out of memory condition naturally outranks the others. */ 225 if (RT_UNLIKELY(VM_FF_IS_ PENDING(pVM, VM_FF_PGM_NO_MEMORY)))225 if (RT_UNLIKELY(VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY))) 226 226 rc = VINF_EM_NO_MEMORY; 227 227 else … … 244 244 rc = VINF_EM_RAW_TIMER_PENDING; 245 245 /* The Virtual Sync clock has stopped. */ 246 else if (VM_FF_IS_ PENDING(pVM, VM_FF_TM_VIRTUAL_SYNC))246 else if (VM_FF_IS_SET(pVM, VM_FF_TM_VIRTUAL_SYNC)) 247 247 rc = VINF_EM_RAW_TO_R3; 248 248 /* DMA work pending? */ 249 else if (VM_FF_IS_ PENDING(pVM, VM_FF_PDM_DMA))249 else if (VM_FF_IS_SET(pVM, VM_FF_PDM_DMA)) 250 250 rc = VINF_EM_RAW_TO_R3; 251 251 /* Pending request packets might contain actions that need immediate
Note:
See TracChangeset
for help on using the changeset viewer.