VirtualBox

Ignore:
Timestamp:
Jun 30, 2011 11:52:19 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72585
Message:

VBoxRecompiler.c: tlb_flush_page may trigger a full tlb flush during invlpg replay in REMR3State if large pages are affected, so we must ignore the CR3 reload notifications as well as the invalidate page ones. Also, skip the replay if a global TLB flush is pending.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxRecompiler.c

    r37702 r37723  
    220220#endif
    221221
    222 /** Prologue code, must be in lower 4G to simplify jumps to/from generated code. */
     222/** Prologue code, must be in lower 4G to simplify jumps to/from generated code.
     223 * @todo huh??? That cannot be the case on the mac... So, this
     224 *       point is probably not valid any longer. */
    223225uint8_t *code_gen_prologue;
    224226
     
    21122114
    21132115    /*
    2114      * Replay invlpg?
    2115      */
     2116     * Replay invlpg?  Only if we're not flushing the TLB.
     2117     */
     2118    fFlags = CPUMR3RemEnter(pVCpu, &uCpl);
     2119    LogFlow(("CPUMR3RemEnter %x %x\n", fFlags, uCpl));
    21162120    if (pVM->rem.s.cInvalidatedPages)
    21172121    {
    2118         RTUINT i;
    2119 
    2120         pVM->rem.s.fIgnoreInvlPg = true;
    2121         for (i = 0; i < pVM->rem.s.cInvalidatedPages; i++)
     2122        if (!(fFlags & CPUM_CHANGED_GLOBAL_TLB_FLUSH))
    21222123        {
    2123             Log2(("REMR3State: invlpg %RGv\n", pVM->rem.s.aGCPtrInvalidatedPages[i]));
    2124             tlb_flush_page(&pVM->rem.s.Env, pVM->rem.s.aGCPtrInvalidatedPages[i]);
     2124            RTUINT i;
     2125
     2126            pVM->rem.s.fIgnoreCR3Load = true;
     2127            pVM->rem.s.fIgnoreInvlPg  = true;
     2128            for (i = 0; i < pVM->rem.s.cInvalidatedPages; i++)
     2129            {
     2130                Log2(("REMR3State: invlpg %RGv\n", pVM->rem.s.aGCPtrInvalidatedPages[i]));
     2131                tlb_flush_page(&pVM->rem.s.Env, pVM->rem.s.aGCPtrInvalidatedPages[i]);
     2132            }
     2133            pVM->rem.s.fIgnoreInvlPg  = false;
     2134            pVM->rem.s.fIgnoreCR3Load = false;
    21252135        }
    2126         pVM->rem.s.fIgnoreInvlPg = false;
    21272136        pVM->rem.s.cInvalidatedPages = 0;
    21282137    }
     
    21512160     * Registers which are rarely changed and require special handling / order when changed.
    21522161     */
    2153     fFlags = CPUMR3RemEnter(pVCpu, &uCpl);
    2154     LogFlow(("CPUMR3RemEnter %x %x\n", fFlags, uCpl));
    21552162    if (fFlags & (  CPUM_CHANGED_GLOBAL_TLB_FLUSH
    21562163                  | CPUM_CHANGED_CR4
Note: See TracChangeset for help on using the changeset viewer.

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