VirtualBox

Changeset 15789 in vbox


Ignore:
Timestamp:
Jan 5, 2009 10:00:04 AM (16 years ago)
Author:
vboxsync
Message:

Protect code that relies on not being rescheduled to another cpu. (harmless, but triggers bug checks in Linux)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp

    r15701 r15789  
    798798{
    799799    int             rc;
    800     RTCPUID         idCpu = RTMpCpuId();
    801     PHWACCM_CPUINFO pCpu = &HWACCMR0Globals.aCpuInfo[idCpu];
    802800
    803801    AssertReturn(pVM, VERR_INVALID_PARAMETER);
     
    850848    }
    851849
     850    RTCCUINTREG     fFlags = ASMIntDisableFlags();
     851    RTCPUID         idCpu = RTMpCpuId();
     852    PHWACCM_CPUINFO pCpu = &HWACCMR0Globals.aCpuInfo[idCpu];
     853
    852854    ASMAtomicWriteBool(&pCpu->fInUse, true);
    853855
     
    856858
    857859    ASMAtomicWriteBool(&pCpu->fInUse, false);
     860    ASMSetFlags(fFlags);
    858861
    859862    return rc;
     
    870873{
    871874    int             rc;
    872     RTCPUID         idCpu = RTMpCpuId();
    873     PHWACCM_CPUINFO pCpu = &HWACCMR0Globals.aCpuInfo[idCpu];
    874875
    875876    AssertReturn(pVM, VERR_INVALID_PARAMETER);
     
    882883    AssertReturn(!ASMAtomicReadBool(&HWACCMR0Globals.fSuspended), VERR_HWACCM_SUSPEND_PENDING);
    883884
     885    RTCCUINTREG     fFlags = ASMIntDisableFlags();
     886    RTCPUID         idCpu = RTMpCpuId();
     887    PHWACCM_CPUINFO pCpu = &HWACCMR0Globals.aCpuInfo[idCpu];
     888
    884889    ASMAtomicWriteBool(&pCpu->fInUse, true);
    885890
     
    888893
    889894    ASMAtomicWriteBool(&pCpu->fInUse, false);
     895    ASMSetFlags(fFlags);
    890896    return rc;
    891897}
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