Changeset 104123 in vbox
- Timestamp:
- Mar 30, 2024 1:12:57 AM (8 months ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veExecMem.cpp
r104116 r104123 373 373 AssertReturnVoid(cChunks >= 1); 374 374 375 Assert(!pVCpu->iem.s.pCurTbR3); 376 375 377 /* 376 378 * Decide how much to prune. The chunk is is a multiple of two, so we'll be … … 424 426 PIEMTB const pTb = pHdr->pTb; 425 427 AssertPtr(pTb); 426 Assert((pTb->fFlags & IEMTB_F_TYPE_MASK) == IEMTB_F_TYPE_NATIVE); 427 428 uint32_t const cbBlock = RT_ALIGN_32(pTb->Native.cInstructions * sizeof(IEMNATIVEINSTR) + sizeof(*pHdr), 429 IEMEXECMEM_ALT_SUB_ALLOC_UNIT_SIZE); 430 AssertBreakStmt(offChunk + cbBlock <= cbChunk, offChunk += IEMEXECMEM_ALT_SUB_ALLOC_UNIT_SIZE); /* paranoia */ 431 432 iemTbAllocatorFree(pVCpu, pTb); 433 434 cbPruned += cbBlock; 435 offChunk += cbBlock; 428 429 /* We now have to check that this isn't a old freed header, given 430 that we don't invalidate the header upon free because of darwin 431 restrictions on executable memory (iemExecMemAllocatorFree). 432 This relies upon iemTbAllocatorFreeInner resetting TB members. */ 433 if ( pTb->Native.paInstructions == (PIEMNATIVEINSTR)(pHdr + 1) 434 && (pTb->fFlags & IEMTB_F_TYPE_MASK) == IEMTB_F_TYPE_NATIVE) 435 { 436 uint32_t const cbBlock = RT_ALIGN_32(pTb->Native.cInstructions * sizeof(IEMNATIVEINSTR) + sizeof(*pHdr), 437 IEMEXECMEM_ALT_SUB_ALLOC_UNIT_SIZE); 438 AssertBreakStmt(offChunk + cbBlock <= cbChunk, offChunk += IEMEXECMEM_ALT_SUB_ALLOC_UNIT_SIZE); /* paranoia */ 439 440 iemTbAllocatorFree(pVCpu, pTb); 441 442 cbPruned += cbBlock; 443 offChunk += cbBlock; 444 } 445 else 446 offChunk += IEMEXECMEM_ALT_SUB_ALLOC_UNIT_SIZE; 436 447 } 437 448 else … … 713 724 ASMBitClearRange(pbmAlloc, idxFirst, idxFirst + cReqUnits); 714 725 715 #if def IEMEXECMEM_ALT_SUB_WITH_ALLOC_HEADER726 #if 0 /*def IEMEXECMEM_ALT_SUB_WITH_ALLOC_HEADER - not necessary, we'll validate the header in the pruning code. */ 716 727 # ifdef RT_OS_DARWIN 717 728 int rc = RTMemProtect(pHdr, sizeof(*pHdr), RTMEM_PROT_WRITE | RTMEM_PROT_READ); -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
r104114 r104123 885 885 iemExecMemAllocatorFree(pVCpu, pTb->Native.paInstructions, 886 886 pTb->Native.cInstructions * sizeof(pTb->Native.paInstructions[0])); 887 pVCpu, pTb->Native.paInstructions = NULL; /* required by iemExecMemAllocatorPrune */ 887 888 break; 888 889 #endif
Note:
See TracChangeset
for help on using the changeset viewer.