VirtualBox

Changeset 32040 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Aug 27, 2010 11:24:35 AM (14 years ago)
Author:
vboxsync
Message:

PGMAllPool.cpp: Added assertions to the table flushing code that check that we didn't set any bits we didn't intend to set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r32038 r32040  
    40994099{
    41004100    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++)
     4101    {
     4102        Assert(!(pShwPT->a[i].u & RT_BIT_32(10)));
    41014103        if (pShwPT->a[i].n.u1Present)
    41024104        {
     
    41074109                break;
    41084110        }
     4111    }
    41094112}
    41104113
     
    41214124{
    41224125    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++)
     4126    {
     4127        Assert(   (PGMSHWPTEPAE_GET_U(pShwPT->a[i]) & UINT64_C(0x7ff0000000000400)) == 0
     4128               || (PGMSHWPTEPAE_GET_U(pShwPT->a[i]) & UINT64_C(0x7ff0000000000400)) == UINT64_C(0x7ff0000000000000));
    41234129        if (PGMSHWPTEPAE_IS_P(pShwPT->a[i]))
    41244130        {
     
    41294135                break;
    41304136        }
     4137    }
    41314138}
    41324139
     
    41434150{
    41444151    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++)
     4152    {
     4153        Assert(   (PGMSHWPTEPAE_GET_U(pShwPT->a[i]) & UINT64_C(0x7ff0000000000400)) == 0
     4154               || (PGMSHWPTEPAE_GET_U(pShwPT->a[i]) & UINT64_C(0x7ff0000000000400)) == UINT64_C(0x7ff0000000000000));
    41454155        if (PGMSHWPTEPAE_IS_P(pShwPT->a[i]))
    41464156        {
     
    41514161                break;
    41524162        }
     4163    }
    41534164}
    41544165
     
    41654176    RTGCPHYS GCPhys = pPage->GCPhys + PAGE_SIZE * pPage->iFirstPresent;
    41664177    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)
     4178    {
     4179        Assert(!(pShwPT->a[i].u & RT_BIT_32(10)));
    41674180        if (pShwPT->a[i].n.u1Present)
    41684181        {
     
    41734186                break;
    41744187        }
     4188    }
    41754189}
    41764190
     
    41874201    RTGCPHYS GCPhys = pPage->GCPhys + PAGE_SIZE * pPage->iFirstPresent;
    41884202    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)
     4203    {
     4204        Assert(   (PGMSHWPTEPAE_GET_U(pShwPT->a[i]) & UINT64_C(0x7ff0000000000400)) == 0
     4205               || (PGMSHWPTEPAE_GET_U(pShwPT->a[i]) & UINT64_C(0x7ff0000000000400)) == UINT64_C(0x7ff0000000000000));
    41894206        if (PGMSHWPTEPAE_IS_P(pShwPT->a[i]))
    41904207        {
     
    41954212                break;
    41964213        }
     4214    }
    41974215}
    41984216
     
    42094227    RTGCPHYS GCPhys = pPage->GCPhys + PAGE_SIZE * pPage->iFirstPresent;
    42104228    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)
     4229    {
     4230        Assert((pShwPT->a[i].u & UINT64_C(0xfff0000000000f80)) == 0);
    42114231        if (pShwPT->a[i].n.u1Present)
    42124232        {
     
    42174237                break;
    42184238        }
     4239    }
    42194240}
    42204241
     
    42324253    for (unsigned i = 0; i < RT_ELEMENTS(pShwPD->a); i++)
    42334254    {
     4255        Assert(!(pShwPD->a[i].u & RT_BIT_32(9)));
    42344256        if (    pShwPD->a[i].n.u1Present
    42354257            &&  !(pShwPD->a[i].u & PGM_PDFLAGS_MAPPING)
     
    42564278    for (unsigned i = 0; i < RT_ELEMENTS(pShwPD->a); i++)
    42574279    {
    4258         if (    pShwPD->a[i].n.u1Present
    4259             &&  !(pShwPD->a[i].u & PGM_PDFLAGS_MAPPING)
    4260            )
     4280        Assert((pShwPD->a[i].u & (X86_PDE_PAE_MBZ_MASK_NX | UINT64_C(0x7ff0000000000200))) == 0);
     4281        if (   pShwPD->a[i].n.u1Present
     4282            && !(pShwPD->a[i].u & PGM_PDFLAGS_MAPPING))
    42614283        {
    42624284#ifdef PGM_WITH_LARGE_PAGES
     
    42924314    for (unsigned i = 0; i < X86_PG_PAE_PDPE_ENTRIES; i++)
    42934315    {
     4316        Assert((pShwPDPT->a[i].u & (X86_PDPE_PAE_MBZ_MASK | UINT64_C(0x7ff0000000000200))) == 0);
    42944317        if (    pShwPDPT->a[i].n.u1Present
    42954318            &&  !(pShwPDPT->a[i].u & PGM_PLXFLAGS_MAPPING)
     
    43174340    for (unsigned i = 0; i < RT_ELEMENTS(pShwPDPT->a); i++)
    43184341    {
    4319         Assert(!(pShwPDPT->a[i].u & PGM_PLXFLAGS_MAPPING));
     4342        Assert((pShwPDPT->a[i].u & (X86_PDPE_LM_MBZ_MASK_NX | UINT64_C(0x7ff0000000000200))) == 0);
    43204343        if (pShwPDPT->a[i].n.u1Present)
    43214344        {
     
    43424365    for (unsigned i = 0; i < RT_ELEMENTS(pShwPML4->a); i++)
    43434366    {
     4367        Assert((pShwPML4->a[i].u & (X86_PML4E_MBZ_MASK_NX | UINT64_C(0x7ff0000000000200))) == 0);
    43444368        if (pShwPML4->a[i].n.u1Present)
    43454369        {
     
    43664390    for (unsigned i = 0; i < RT_ELEMENTS(pShwPD->a); i++)
    43674391    {
     4392        Assert((pShwPD->a[i].u & UINT64_C(0xfff0000000000f80)) == 0);
    43684393        if (pShwPD->a[i].n.u1Present)
    43694394        {
     
    44014426    for (unsigned i = 0; i < RT_ELEMENTS(pShwPDPT->a); i++)
    44024427    {
     4428        Assert((pShwPDPT->a[i].u & UINT64_C(0xfff0000000000f80)) == 0);
    44034429        if (pShwPDPT->a[i].n.u1Present)
    44044430        {
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