VirtualBox

Changeset 92726 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Dec 3, 2021 12:00:52 AM (3 years ago)
Author:
vboxsync
Message:

VMM/DBGF: Breakpoint bitmap addresses & sizes must be multiple of 32-bits, see ASMAtomicBitSet and friends. Assert on 64 bits alignment. bugref:9837

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp

    r90794 r92726  
    417417        && !pUVM->dbgf.s.pbmBpOwnersAllocR3)
    418418    {
    419         pUVM->dbgf.s.pbmBpOwnersAllocR3 = (volatile void *)RTMemAllocZ(DBGF_BP_OWNER_COUNT_MAX / 8);
     419        AssertCompile(!(DBGF_BP_OWNER_COUNT_MAX % 64));
     420        pUVM->dbgf.s.pbmBpOwnersAllocR3 = RTMemAllocZ(DBGF_BP_OWNER_COUNT_MAX / 8);
    420421        if (pUVM->dbgf.s.pbmBpOwnersAllocR3)
    421422        {
     
    572573    {
    573574        /* Allocate the bitmap first so we can skip calling into VMMR0 if it fails. */
    574         AssertCompile(!(DBGF_BP_COUNT_PER_CHUNK % 8));
    575         volatile void *pbmAlloc = RTMemAllocZ(DBGF_BP_COUNT_PER_CHUNK / 8);
     575        AssertCompile(!(DBGF_BP_COUNT_PER_CHUNK % 64));
     576        void *pbmAlloc = RTMemAllocZ(DBGF_BP_COUNT_PER_CHUNK / 8);
    576577        if (RT_LIKELY(pbmAlloc))
    577578        {
     
    586587            {
    587588                pBpChunk->pBpBaseR3 = (PDBGFBPINT)Req.pChunkBaseR3;
    588                 pBpChunk->pbmAlloc   = pbmAlloc;
     589                pBpChunk->pbmAlloc  = (void volatile *)pbmAlloc;
    589590                pBpChunk->cBpsFree  = DBGF_BP_COUNT_PER_CHUNK;
    590591                pBpChunk->idChunk   = idChunk;
     
    592593            }
    593594
    594             RTMemFree((void *)pbmAlloc);
     595            RTMemFree(pbmAlloc);
    595596        }
    596597        else
     
    782783    {
    783784        /* Allocate the bitmap first so we can skip calling into VMMR0 if it fails. */
    784         AssertCompile(!(DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK % 8));
    785         volatile void *pbmAlloc = RTMemAllocZ(DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK / 8);
     785        AssertCompile(!(DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK % 64));
     786        void *pbmAlloc = RTMemAllocZ(DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK / 8);
    786787        if (RT_LIKELY(pbmAlloc))
    787788        {
     
    796797            {
    797798                pL2Chunk->pL2BaseR3 = (PDBGFBPL2ENTRY)Req.pChunkBaseR3;
    798                 pL2Chunk->pbmAlloc  = pbmAlloc;
     799                pL2Chunk->pbmAlloc  = (void volatile *)pbmAlloc;
    799800                pL2Chunk->cFree     = DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK;
    800801                pL2Chunk->idChunk   = idChunk;
     
    802803            }
    803804
    804             RTMemFree((void *)pbmAlloc);
     805            RTMemFree(pbmAlloc);
    805806        }
    806807        else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette