Changeset 90573 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 7, 2021 1:32:25 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146179
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp
r90571 r90573 93 93 94 94 95 DECL_NO_INLINE(static, int) pdmCritSectRwCorrupted(PPDMCRITSECTRW pThis )95 DECL_NO_INLINE(static, int) pdmCritSectRwCorrupted(PPDMCRITSECTRW pThis, const char *pszMsg) 96 96 { 97 97 ASMAtomicWriteU32(&pThis->s.Core.u32Magic, PDMCRITSECTRW_MAGIC_CORRUPT); 98 LogRel(("PDMCritSect: %s pCritSect=%p\n", pszMsg, pThis)); 98 99 return VERR_PDM_CRITSECTRW_IPE; 99 100 } … … 333 334 u64OldState = u64State = ASMAtomicReadU64(&pThis->s.Core.u64State); 334 335 c = (u64State & RTCSRW_CNT_RD_MASK) >> RTCSRW_CNT_RD_SHIFT; 335 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis ));336 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis, "Invalid read count on bailout")); 336 337 c--; 337 338 cWait = (u64State & RTCSRW_WAIT_CNT_RD_MASK) >> RTCSRW_WAIT_CNT_RD_SHIFT; 338 AssertReturn(cWait > 0, pdmCritSectRwCorrupted(pThis ));339 AssertReturn(cWait > 0, pdmCritSectRwCorrupted(pThis, "Invalid waiting read count on bailout")); 339 340 cWait--; 340 341 u64State &= ~(RTCSRW_CNT_RD_MASK | RTCSRW_WAIT_CNT_RD_MASK); … … 359 360 360 361 cWait = (u64State & RTCSRW_WAIT_CNT_RD_MASK) >> RTCSRW_WAIT_CNT_RD_SHIFT; 361 AssertReturn(cWait > 0, pdmCritSectRwCorrupted(pThis ));362 AssertReturn(cWait > 0, pdmCritSectRwCorrupted(pThis, "Invalid waiting read count")); 362 363 cWait--; 363 364 u64State &= ~RTCSRW_WAIT_CNT_RD_MASK; … … 657 658 == ((uintptr_t)pThis & PAGE_OFFSET_MASK), 658 659 ("%p vs %p\n", pVCpu->pdm.s.apQueuedCritSectRwShrdLeaves[i], pThis), 659 pdmCritSectRwCorrupted(pThis ));660 pdmCritSectRwCorrupted(pThis, "Invalid self pointer")); 660 661 VMCPU_FF_SET(pVCpu, VMCPU_FF_PDM_CRITSECT); 661 662 VMCPU_FF_SET(pVCpu, VMCPU_FF_TO_R3); … … 693 694 #endif 694 695 uint32_t cDepth = ASMAtomicDecU32(&pThis->s.Core.cWriterReads); 695 AssertReturn(cDepth < PDM_CRITSECTRW_MAX_RECURSIONS, pdmCritSectRwCorrupted(pThis ));696 AssertReturn(cDepth < PDM_CRITSECTRW_MAX_RECURSIONS, pdmCritSectRwCorrupted(pThis, "too many writer-read recursions")); 696 697 } 697 698 … … 923 924 u64OldState = u64State = ASMAtomicReadU64(&pThis->s.Core.u64State); 924 925 uint64_t c = (u64State & RTCSRW_CNT_WR_MASK) >> RTCSRW_CNT_WR_SHIFT; 925 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis ));926 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis, "Invalid write count on bailout")); 926 927 c--; 927 928 u64State &= ~RTCSRW_CNT_WR_MASK; … … 958 959 u64OldState = u64State = ASMAtomicReadU64(&pThis->s.Core.u64State); 959 960 uint64_t c = (u64State & RTCSRW_CNT_WR_MASK) >> RTCSRW_CNT_WR_SHIFT; 960 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis ));961 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis, "Invalid write count on bailout")); 961 962 c--; 962 963 u64State &= ~RTCSRW_CNT_WR_MASK; … … 1208 1209 1209 1210 uint64_t c = (u64State & RTCSRW_CNT_WR_MASK) >> RTCSRW_CNT_WR_SHIFT; 1210 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis ));1211 AssertReturn(c > 0, pdmCritSectRwCorrupted(pThis, "Invalid write count on leave")); 1211 1212 c--; 1212 1213 … … 1268 1269 == ((uintptr_t)pThis & PAGE_OFFSET_MASK), 1269 1270 ("%p vs %p\n", pVCpu->pdm.s.apQueuedCritSectRwExclLeaves[i], pThis), 1270 pdmCritSectRwCorrupted(pThis ));1271 pdmCritSectRwCorrupted(pThis, "Invalid self pointer on queue (excl)")); 1271 1272 VMCPU_FF_SET(pVCpu, VMCPU_FF_PDM_CRITSECT); 1272 1273 VMCPU_FF_SET(pVCpu, VMCPU_FF_TO_R3); … … 1292 1293 #endif 1293 1294 uint32_t const cDepth = ASMAtomicDecU32(&pThis->s.Core.cWriteRecursions); 1294 AssertReturn(cDepth != 0 && cDepth < UINT32_MAX, pdmCritSectRwCorrupted(pThis ));1295 AssertReturn(cDepth != 0 && cDepth < UINT32_MAX, pdmCritSectRwCorrupted(pThis, "Invalid write recursion value on leave")); 1295 1296 } 1296 1297
Note:
See TracChangeset
for help on using the changeset viewer.