VirtualBox

Ignore:
Timestamp:
Jun 30, 2011 10:09:59 AM (13 years ago)
Author:
vboxsync
Message:

REM/VMM: Don't flush the TLB if you don't hold the EM/REM lock, some other EMT may be executing code in the recompiler and could be really surprised by a TLB flush.

File:
1 edited

Legend:

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

    r37689 r37702  
    311311    CPUMGetGuestCpuId(pVCpu, 0x80000001, &u32Dummy, &u32Dummy, &pVM->rem.s.Env.cpuid_ext3_features, &pVM->rem.s.Env.cpuid_ext2_features);
    312312
     313    EMRemLock(pVM);
    313314    cpu_reset(&pVM->rem.s.Env);
     315    EMRemUnlock(pVM);
    314316
    315317    /* allocate code buffer for single instruction emulation. */
     
    607609REMR3DECL(void) REMR3Reset(PVM pVM)
    608610{
     611    EMRemLock(pVM); /* Only pro forma, we're in a rendezvous. */
     612
    609613    /*
    610614     * Reset the REM cpu.
     
    622626    /* Flush the TBs the next time we execute code here. */
    623627    pVM->rem.s.fFlushTBs = true;
     628
     629    EMRemUnlock(pVM);
    624630}
    625631
     
    764770
    765771    /*
    766      * Sync the Load Flush the TLB
    767      */
    768     tlb_flush(&pRem->Env, 1);
    769 
    770     /*
    771772     * Stop ignoring ignorable notifications.
    772773     */
     
    814815     */
    815816    interrupt_request = pVM->rem.s.Env.interrupt_request;
    816     Assert(!(interrupt_request & ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB | CPU_INTERRUPT_TIMER  | CPU_INTERRUPT_EXTERNAL_HARD | CPU_INTERRUPT_EXTERNAL_EXIT | CPU_INTERRUPT_EXTERNAL_TIMER)));
     817    Assert(!(interrupt_request & ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB | CPU_INTERRUPT_TIMER  | CPU_INTERRUPT_EXTERNAL_HARD | CPU_INTERRUPT_EXTERNAL_EXIT | CPU_INTERRUPT_EXTERNAL_FLUSH_TLB | CPU_INTERRUPT_EXTERNAL_TIMER)));
    817818    pVM->rem.s.Env.interrupt_request = 0;
    818819    cpu_single_step(&pVM->rem.s.Env, 1);
     
    954955    {
    955956        int interrupt_request = pVM->rem.s.Env.interrupt_request;
    956         Assert(!(interrupt_request & ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB | CPU_INTERRUPT_TIMER | CPU_INTERRUPT_EXTERNAL_HARD | CPU_INTERRUPT_EXTERNAL_EXIT | CPU_INTERRUPT_EXTERNAL_TIMER)));
     957        Assert(!(interrupt_request & ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB | CPU_INTERRUPT_TIMER | CPU_INTERRUPT_EXTERNAL_HARD | CPU_INTERRUPT_EXTERNAL_EXIT | CPU_INTERRUPT_EXTERNAL_FLUSH_TLB | CPU_INTERRUPT_EXTERNAL_TIMER)));
    957958#ifdef REM_USE_QEMU_SINGLE_STEP_FOR_LOGGING
    958959        cpu_single_step(&pVM->rem.s.Env, 0);
     
    16771678    int rc;
    16781679
     1680    Assert(EMRemIsLockOwner(env->pVM));
     1681
    16791682    /*
    16801683     * When we're replaying invlpg instructions or restoring a saved
     
    17861789void remR3FlushTLB(CPUX86State *env, bool fGlobal)
    17871790{
    1788     PVM pVM = env->pVM;
     1791    PVM      pVM = env->pVM;
    17891792    PCPUMCTX pCtx;
     1793    Assert(EMRemIsLockOwner(pVM));
    17901794
    17911795    /*
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