VirtualBox

Changeset 10334 in vbox for trunk


Ignore:
Timestamp:
Jul 7, 2008 3:53:51 PM (16 years ago)
Author:
vboxsync
Message:

Stosq case for clearing pages.

File:
1 edited

Legend:

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

    r10324 r10334  
    324324                    && (off & 7) + pgmPoolDisasWriteSize(pCpu) > sizeof(X86PTEPAE))
    325325                {
    326                     AssertFailed();
     326                    const unsigned iShw2 = (off + pgmPoolDisasWriteSize(pCpu) - 1) / sizeof(X86PTEPAE);
     327                    AssertReturnVoid(iShw2 < ELEMENTS(uShw.pPTPae->a));
     328
     329#  ifdef PGMPOOL_WITH_GCPHYS_TRACKING
     330                    PCX86PTEPAE pGstPte = (PCX86PTEPAE)pgmPoolMonitorGCPtr2CCPtr(pPool, pvAddress, GCPhysFault, sizeof(*pGstPte));
     331                    Log4(("pgmPoolMonitorChainChanging pae_32: deref %VHp GCPhys %VGp\n", uShw.pPTPae->a[iShw2].u & X86_PTE_PAE_PG_MASK, pGstPte->u & X86_PTE_PAE_PG_MASK));
     332                    pgmPoolTracDerefGCPhysHint(pPool, pPage,
     333                                               uShw.pPTPae->a[iShw2].u & X86_PTE_PAE_PG_MASK,
     334                                               pGstPte->u & X86_PTE_PAE_PG_MASK);
     335#  endif
     336                    uShw.pPTPae->a[iShw].u = 0;
    327337                }
    328338
     
    342352                else if (   pCpu
    343353                         && (off & 3)
    344                          && (off & 3) + pgmPoolDisasWriteSize(pCpu) > 4)
     354                         && (off & 3) + pgmPoolDisasWriteSize(pCpu) > sizeof(X86PTE))
    345355                {
    346356                    const unsigned iShw2 = (off + pgmPoolDisasWriteSize(pCpu) - 1) / sizeof(X86PTE);
     
    674684
    675685/**
    676  * Determin whether the page is likely to have been reused.
     686 * Determine whether the page is likely to have been reused.
    677687 *
    678688 * @returns true if we consider the page as being reused for a different purpose.
    679689 * @returns false if we consider it to still be a paging page.
    680690 * @param   pPage       The page in question.
     691 * @param   pRegFrame   Trap register frame.
    681692 * @param   pCpu        The disassembly info for the faulting insturction.
    682693 * @param   pvFault     The fault address.
     
    684695 * @remark  The REP prefix check is left to the caller because of STOSD/W.
    685696 */
    686 DECLINLINE(bool) pgmPoolMonitorIsReused(PPGMPOOLPAGE pPage, PDISCPUSTATE pCpu, RTGCPTR pvFault)
     697DECLINLINE(bool) pgmPoolMonitorIsReused(PPGMPOOLPAGE pPage, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu, RTGCPTR pvFault)
    687698{
    688699    switch (pCpu->pCurInstr->opcode)
     
    706717            Log4(("pgmPoolMonitorIsReused: MOVNTDQ\n"));
    707718            return true;
     719        case OP_STOSWD:
     720            if (    pRegFrame
     721                &&  pCpu->prefix == PREFIX_REP
     722                &&  pRegFrame->rcx == 0x200
     723                &&  pCpu->mode == CPUMODE_64BIT
     724               )
     725            {
     726                Log4(("pgmPoolMonitorIsReused: OP_STOSQ\n"));
     727                return true;
     728            }
     729            return false;
    708730    }
    709731    if (    (pCpu->param1.flags & USE_REG_GEN32)
     
    927949    if (    (   pPage->cModifications < 48   /** @todo #define */ /** @todo need to check that it's not mapping EIP. */ /** @todo adjust this! */
    928950             || pPage->fCR3Mix)
    929         &&  !(fReused = pgmPoolMonitorIsReused(pPage, &Cpu, pvFault))
     951        &&  !(fReused = pgmPoolMonitorIsReused(pPage, pRegFrame, &Cpu, pvFault))
    930952        &&  !pgmPoolMonitorIsForking(pPool, &Cpu, GCPhysFault & PAGE_OFFSET_MASK))
    931953    {
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