VirtualBox

Changeset 52618 in vbox


Ignore:
Timestamp:
Sep 5, 2014 12:07:29 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95899
Message:

HostDrivers, Runtime, Devices, Additions: TSC delta measurement and other changes resulting from bumping supdrv major version. TSC delta measurement currently disabled.

Location:
trunk
Files:
48 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r52424 r52618  
    236236    /** Current CPU Frequency. */
    237237    volatile uint64_t   u64CpuHz;
     238    /** The TSC delta with reference to the master TSC. */
     239    volatile int64_t    i64TSCDelta;
    238240    /** Number of errors during updating.
    239241     * Typical errors are under/overflows. */
     
    250252
    251253    /** Reserved for future per processor data. */
    252     volatile uint32_t   au32Reserved[5+5];
     254    volatile uint32_t   au32Reserved0[5];
     255
     256    /** The TSC value read while doing TSC delta measurements across CPUs. */
     257    volatile uint64_t   u64TSCSample;
     258
     259    /** Reserved for future per processor data. */
     260    volatile uint32_t   au32Reserved1[1];
    253261
    254262    /** @todo Add topology/NUMA info. */
     
    350358 * Upper 16 bits is the major version. Major version is only changed with
    351359 * incompatible changes in the GIP. */
    352 #define SUPGLOBALINFOPAGE_VERSION   0x00030000
     360#define SUPGLOBALINFOPAGE_VERSION   0x00040000
    353361
    354362/**
  • trunk/include/VBox/sup.mac

    r41155 r52618  
    55
    66;
    7 ; Copyright (C) 2006-2012 Oracle Corporation
     7; Copyright (C) 2006-2014 Oracle Corporation
    88;
    99; This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434    .u64TSC                     resq 1
    3535    .u64CpuHz                   resq 1
     36    .i64TSCDelta                resq 1
    3637    .cErrors                    resd 1
    3738    .iTSCHistoryHead            resd 1
    3839    .au32TSCHistory             resd 8
    3940    .u32PrevUpdateIntervalNS    resd 1
    40     .au32Reserved               resd (5+5)
     41    .au32Reserved0              resd (5)
     42    .u64TSCSample               resq 1
     43    .au32Reserved1              resd (1)
    4144    .enmState                   resd 1
    4245    .idCpu                      resd 1
  • trunk/include/iprt/mangling.h

    r52606 r52618  
    1111
    1212/*
    13  * Copyright (C) 2011-2013 Oracle Corporation
     13 * Copyright (C) 2011-2014 Oracle Corporation
    1414 *
    1515 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    967967# define RTMpNotificationRegister                       RT_MANGLER(RTMpNotificationRegister)   /* r0drv */
    968968# define RTMpOnAll                                      RT_MANGLER(RTMpOnAll)                  /* r0drv */
     969# define RTMpOnAllIsConcurrentSafe                      RT_MANGLER(RTMpOnAllIsConcurrentSafe)  /* r0drv */
    969970# define RTMpOnOthers                                   RT_MANGLER(RTMpOnOthers)               /* r0drv */
    970971# define RTMpOnSpecific                                 RT_MANGLER(RTMpOnSpecific)             /* r0drv */
     
    13981399# define RTSpinlockDestroy                              RT_MANGLER(RTSpinlockDestroy)
    13991400# define RTSpinlockRelease                              RT_MANGLER(RTSpinlockRelease)
    1400 # define RTSpinlockReleaseNoInts                        RT_MANGLER(RTSpinlockReleaseNoInts)
    14011401# define RTStrAAppendExNVTag                            RT_MANGLER(RTStrAAppendExNVTag)
    14021402# define RTStrAAppendNTag                               RT_MANGLER(RTStrAAppendNTag)
  • trunk/include/iprt/mp.h

    r50641 r52618  
    44
    55/*
    6  * Copyright (C) 2008-2010 Oracle Corporation
     6 * Copyright (C) 2008-2014 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    247247
    248248/**
     249 * Checks if the RTMpOnAll() is safe with regards to all threads executing
     250 * concurrently.
     251 *
     252 * If for instance, the RTMpOnAll() is implemented in a way where the threads
     253 * might cause a classic deadlock, it is considered -not- concurrent safe.
     254 * Windows currently is one such platform where it isn't safe.
     255 *
     256 * @returns true if RTMpOnAll() is concurrent safe, false otherwise.
     257 */
     258RTDECL(bool) RTMpOnAllIsConcurrentSafe(void);
     259
     260/**
    249261 * Executes a function on each (online) CPU in the system.
    250262 *
  • trunk/include/iprt/spinlock.h

    r45181 r52618  
    44
    55/*
    6  * Copyright (C) 2006-2012 Oracle Corporation
     6 * Copyright (C) 2006-2014 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8484RTDECL(void) RTSpinlockRelease(RTSPINLOCK Spinlock);
    8585
    86 /* Temporarily, only for checking the spinlock creation flags. */
    87 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock);
    88 
    8986
    9087/** @} */
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp

    r51490 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    399399            rc = VERR_GENERAL_FAILURE;
    400400
    401         RTSpinlockReleaseNoInts(g_Spinlock);
     401        RTSpinlockRelease(g_Spinlock);
    402402#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
    403403        kauth_cred_unref(&pCred);
     
    456456    while (pSession && pSession->Process != Process && (/*later: pSession->fUnrestricted != fUnrestricted ||*/  !pSession->fOpened))
    457457        pSession = pSession->pNextHash;
    458     RTSpinlockReleaseNoInts(g_Spinlock);
     458    RTSpinlockRelease(g_Spinlock);
    459459    if (!pSession)
    460460    {
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c

    r49529 r52618  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    319319    g_VBoxGuest->_RTSpinlockRelease(Spinlock);
    320320}
    321 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    322 {
    323     g_VBoxGuest->_RTSpinlockReleaseNoInts(Spinlock);
    324 }
    325321RTDECL(void*) RTMemTmpAllocTag(size_t cb, const char *pszTag)
    326322{
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c

    r43411 r52618  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    174174    RTSpinlockAcquire,
    175175    RTSpinlockRelease,
    176     RTSpinlockReleaseNoInts,
    177176    RTMemTmpAllocTag,
    178177    RTMemTmpFree,
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h

    r43411 r52618  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    177177    void (*_RTSpinlockAcquire)(RTSPINLOCK Spinlock);
    178178    void (*_RTSpinlockRelease)(RTSPINLOCK Spinlock);
    179     void (*_RTSpinlockReleaseNoInts)(RTSPINLOCK Spinlock);
    180179    void* (*_RTMemTmpAllocTag)(size_t cb, const char *pszTag);
    181180    void (*_RTMemTmpFree)(void *pv);
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp

    r48665 r52618  
    55
    66/*
    7  * Copyright (C) 2007-2013 Oracle Corporation
     7 * Copyright (C) 2007-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    373373        pSession->pNextHash = g_apSessionHashTab[iHash];
    374374        g_apSessionHashTab[iHash] = pSession;
    375         RTSpinlockReleaseNoInts(g_Spinlock);
     375        RTSpinlockRelease(g_Spinlock);
    376376    }
    377377
     
    422422        }
    423423    }
    424     RTSpinlockReleaseNoInts(g_Spinlock);
     424    RTSpinlockRelease(g_Spinlock);
    425425    if (!pSession)
    426426    {
     
    455455                     || pSession->Process != Process));
    456456    }
    457     RTSpinlockReleaseNoInts(g_Spinlock);
     457    RTSpinlockRelease(g_Spinlock);
    458458    if (RT_UNLIKELY(!pSession))
    459459    {
     
    546546                     || pSession->Process != Process));
    547547    }
    548     RTSpinlockReleaseNoInts(g_Spinlock);
     548    RTSpinlockRelease(g_Spinlock);
    549549    if (!pSession)
    550550    {
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r51224 r52618  
    117117    }
    118118
    119     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     119    RTSpinlockRelease(pDevExt->EventSpinlock);
    120120
    121121    if (pu32OtherVal)
     
    287287            vboxGuestSetMouseStatus(pStatusReq, fMouseStatus);
    288288    }
    289     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     289    RTSpinlockRelease(pDevExt->SessionSpinlock);
    290290    if (pFilterReq)
    291291        VbglGRFree(&pFilterReq->header);
     
    11811181    RTSpinlockAcquire(pDevExt->SessionSpinlock);
    11821182    RTListAppend(&pDevExt->SessionList, &pSession->ListNode);
    1183     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     1183    RTSpinlockRelease(pDevExt->SessionSpinlock);
    11841184
    11851185    *ppSession = pSession;
     
    12141214    RTSpinlockAcquire(pDevExt->SessionSpinlock);
    12151215    RTListAppend(&pDevExt->SessionList, &pSession->ListNode);
    1216     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     1216    RTSpinlockRelease(pDevExt->SessionSpinlock);
    12171217
    12181218    *ppSession = pSession;
     
    12381238    RTSpinlockAcquire(pDevExt->SessionSpinlock);
    12391239    RTListNodeRemove(&pSession->ListNode);
    1240     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     1240    RTSpinlockRelease(pDevExt->SessionSpinlock);
    12411241    VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, 0, UINT32_MAX, VBOXGUESTCAPSACQUIRE_FLAGS_NONE);
    12421242
     
    12911291            RTListNodeRemove(&pWait->ListNode);
    12921292
    1293         RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1293        RTSpinlockRelease(pDevExt->EventSpinlock);
    12941294    }
    12951295    if (!pWait)
     
    13761376    RTSpinlockAcquire(pDevExt->EventSpinlock);
    13771377    VBoxGuestWaitFreeLocked(pDevExt, pWait);
    1378     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1378    RTSpinlockRelease(pDevExt->EventSpinlock);
    13791379}
    13801380
     
    14011401                break;
    14021402            pWait->fPendingWakeUp = true;
    1403             RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1403            RTSpinlockRelease(pDevExt->EventSpinlock);
    14041404
    14051405            rc = RTSemEventMultiSignal(pWait->Event);
     
    14191419            }
    14201420        }
    1421         RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1421        RTSpinlockRelease(pDevExt->EventSpinlock);
    14221422    }
    14231423}
     
    15121512    RTSpinlockAcquire(pDevExt->EventSpinlock);
    15131513    pDevExt->MouseNotifyCallback = *pNotify;
    1514     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1514    RTSpinlockRelease(pDevExt->EventSpinlock);
    15151515    return VINF_SUCCESS;
    15161516}
     
    15311531    if (fMatches || pSession->fPendingCancelWaitEvents)
    15321532    {
    1533         RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1533        RTSpinlockRelease(pDevExt->EventSpinlock);
    15341534
    15351535        pInfo->u32EventFlagsOut = fMatches;
     
    15431543    }
    15441544
    1545     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1545    RTSpinlockRelease(pDevExt->EventSpinlock);
    15461546    return VERR_TIMEOUT;
    15471547}
     
    16271627    fResEvents = pWait->fResEvents;
    16281628    VBoxGuestWaitFreeLocked(pDevExt, pWait);
    1629     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1629    RTSpinlockRelease(pDevExt->EventSpinlock);
    16301630
    16311631    /*
     
    17061706    if (!fCancelledOne)
    17071707        pSession->fPendingCancelWaitEvents = true;
    1708     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     1708    RTSpinlockRelease(pDevExt->EventSpinlock);
    17091709    Assert(rc == 0);
    17101710    NOREF(rc);
     
    19871987    pSession->fFilterMask |= pInfo->u32OrMask;
    19881988    pSession->fFilterMask &= ~pInfo->u32NotMask;
    1989     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     1989    RTSpinlockRelease(pDevExt->SessionSpinlock);
    19901990    rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_FilterMask);
    19911991    return rc;
     
    20052005    pSession->fCapabilities |= pInfo->u32OrMask;
    20062006    pSession->fCapabilities &= ~pInfo->u32NotMask;
    2007     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     2007    RTSpinlockRelease(pDevExt->SessionSpinlock);
    20082008    rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_Capabilities);
    20092009    return rc;
     
    20342034    RTSpinlockAcquire(pDevExt->SessionSpinlock);
    20352035    pSession->fMouseStatus = fFeatures;
    2036     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     2036    RTSpinlockRelease(pDevExt->SessionSpinlock);
    20372037    rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_MouseStatus);
    20382038    return rc;
     
    20622062        if ((pHdr->fu32Flags & VBOX_HGCM_REQ_DONE) != 0)
    20632063        {
    2064             RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     2064            RTSpinlockRelease(pDevExt->EventSpinlock);
    20652065            return VINF_SUCCESS;
    20662066        }
    2067         RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     2067        RTSpinlockRelease(pDevExt->EventSpinlock);
    20682068
    20692069        pWait = VBoxGuestWaitAlloc(pDevExt, NULL);
     
    20872087    {
    20882088        VBoxGuestWaitFreeLocked(pDevExt, pWait);
    2089         RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     2089        RTSpinlockRelease(pDevExt->EventSpinlock);
    20902090        return VINF_SUCCESS;
    20912091    }
    2092     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     2092    RTSpinlockRelease(pDevExt->EventSpinlock);
    20932093
    20942094    if (fInterruptible)
     
    21802180                    break;
    21812181                }
    2182             RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     2182            RTSpinlockRelease(pDevExt->SessionSpinlock);
    21832183            if (i >= RT_ELEMENTS(pSession->aHGCMClientIds))
    21842184            {
     
    22182218            break;
    22192219        }
    2220     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     2220    RTSpinlockRelease(pDevExt->SessionSpinlock);
    22212221    if (i >= RT_ELEMENTS(pSession->aHGCMClientIds))
    22222222    {
     
    22452245    if (pSession->aHGCMClientIds[i] == UINT32_MAX)
    22462246        pSession->aHGCMClientIds[i] = RT_SUCCESS(rc) && RT_SUCCESS(pInfo->result) ? 0 : u32ClientId;
    2247     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     2247    RTSpinlockRelease(pDevExt->SessionSpinlock);
    22482248
    22492249    return rc;
     
    22932293        if (pSession->aHGCMClientIds[i] == u32ClientId)
    22942294            break;
    2295     RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
     2295    RTSpinlockRelease(pDevExt->SessionSpinlock);
    22962296    if (RT_UNLIKELY(i >= RT_ELEMENTS(pSession->aHGCMClientIds)))
    22972297    {
     
    25792579    ASMAtomicWriteU32(&pDevExt->f32PendingEvents, fEvents);
    25802580
    2581     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     2581    RTSpinlockRelease(pDevExt->EventSpinlock);
    25822582
    25832583#ifdef VBOXGUEST_USE_DEFERRED_WAKE_UP
     
    26552655    }
    26562656
    2657     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     2657    RTSpinlockRelease(pDevExt->EventSpinlock);
    26582658
    26592659    if (fOtherConflictingCaps)
     
    30733073#endif
    30743074
    3075     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     3075    RTSpinlockRelease(pDevExt->EventSpinlock);
    30763076
    30773077#if defined(VBOXGUEST_USE_DEFERRED_WAKE_UP) && !defined(RT_OS_DARWIN) && !defined(RT_OS_WINDOWS)
  • trunk/src/VBox/Devices/Bus/SrvPciRawR0.cpp

    r44529 r52618  
    55
    66/*
    7  * Copyright (C) 2011-2012 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    115115    RTSpinlockAcquire(pThis->hSpinlock);
    116116    pThis->iPendingIrq = iHostIrq;
    117     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     117    RTSpinlockRelease(pThis->hSpinlock);
    118118
    119119    /**
     
    872872    pDev->iPendingIrq = 0;
    873873    fTerminate = pDev->fTerminate;
    874     RTSpinlockReleaseNoInts(pDev->hSpinlock);
     874    RTSpinlockRelease(pDev->hSpinlock);
    875875
    876876    /* Block until new IRQs arrives */
     
    888888                    iPendingIrq = pDev->iPendingIrq;
    889889                    pDev->iPendingIrq = 0;
    890                     RTSpinlockReleaseNoInts(pDev->hSpinlock);
     890                    RTSpinlockRelease(pDev->hSpinlock);
    891891                }
    892892                else
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r52592 r52618  
    44 *
    55 * @remarks No lazy code changes.  If you don't understand exactly what you're
    6  *          doing, get an understand or forget it.
     6 *          doing, get an understanding or forget it.
    77 *          All changes shall be reviewed by bird before commit.  If not around,
    88 *          email and let Frank and/or Klaus OK the changes before committing.
     
    11821182    }
    11831183
    1184     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1184    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    11851185}
    11861186
     
    12151215    }
    12161216
    1217     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1217    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    12181218}
    12191219
     
    12421242        {
    12431243            intnetR0BusyIncIf(pIf);
    1244             RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1244            RTSpinlockRelease(pNetwork->hAddrSpinlock);
    12451245            return pIf;
    12461246        }
    12471247    }
    12481248
    1249     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1249    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    12501250    return NULL;
    12511251}
     
    12721272    {
    12731273        /* This shouldn't happen*/
    1274         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1274        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    12751275        return;
    12761276    }
     
    13131313    Assert(pCache->cEntries <= pCache->cEntriesAlloc);
    13141314
    1315     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1315    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    13161316}
    13171317
     
    15701570    }
    15711571
    1572     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1572    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    15731573    return pDstTab->cIfs
    15741574         ? (!pDstTab->fTrunkDst ? INTNETSWDECISION_INTNET : INTNETSWDECISION_BROADCAST)
     
    16311631    }
    16321632
    1633     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1633    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    16341634    return enmSwDecision;
    16351635}
     
    17441744    }
    17451745
    1746     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1746    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    17471747    return pDstTab->cIfs
    17481748         ? (!pDstTab->fTrunkDst ? INTNETSWDECISION_INTNET : INTNETSWDECISION_BROADCAST)
     
    18061806    }
    18071807
    1808     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1808    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    18091809    return INTNETSWDECISION_BROADCAST;
    18101810}
     
    18671867    }
    18681868
    1869     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1869    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    18701870    return !pDstTab->cIfs
    18711871        ? (!pDstTab->fTrunkDst ? INTNETSWDECISION_DROP   : INTNETSWDECISION_TRUNK)
     
    19091909    }
    19101910
    1911     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     1911    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    19121912    return pDstTab->fTrunkDst ? INTNETSWDECISION_TRUNK : INTNETSWDECISION_DROP;
    19131913}
     
    20032003                        if (pvOld)
    20042004                            *ppDstTab = pNew;
    2005                         RTSpinlockReleaseNoInts(pTrunk->hDstTabSpinlock);
     2005                        RTSpinlockRelease(pTrunk->hDstTabSpinlock);
    20062006                        if (pvOld)
    20072007                        {
     
    20372037                    pTab->cEntriesAllocated = cAllocated;
    20382038
    2039                     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     2039                    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    20402040
    20412041                    RTMemFree(paOld);
     
    21502150                }
    21512151
    2152                 RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     2152                RTSpinlockRelease(pNetwork->hAddrSpinlock);
    21532153
    21542154                if (pMatchingIf)
     
    21832183            }
    21842184
    2185             RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     2185            RTSpinlockRelease(pNetwork->hAddrSpinlock);
    21862186            break;
    21872187        }
     
    26462646    RTSpinlockAcquire(pIf->hRecvInSpinlock);
    26472647    int rc = intnetR0RingWriteFrame(&pIf->pIntBuf->Recv, pSG, pNewDstMac);
    2648     RTSpinlockReleaseNoInts(pIf->hRecvInSpinlock);
     2648    RTSpinlockRelease(pIf->hRecvInSpinlock);
    26492649    if (RT_SUCCESS(rc))
    26502650    {
     
    26732673            RTSpinlockAcquire(pIf->hRecvInSpinlock);
    26742674            rc = intnetR0RingWriteFrame(&pIf->pIntBuf->Recv, pSG, pNewDstMac);
    2675             RTSpinlockReleaseNoInts(pIf->hRecvInSpinlock);
     2675            RTSpinlockRelease(pIf->hRecvInSpinlock);
    26762676            if (RT_SUCCESS(rc))
    26772677            {
     
    32233223    else
    32243224        memset(&MacAddrTrunk, 0, sizeof(MacAddrTrunk));
    3225     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     3225    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    32263226    if (    ar_oper == RTNET_ARPOP_REPLY
    32273227        &&  !memcmp(&pArpIPv4->ar_tha, &MacAddrTrunk, sizeof(RTMAC)))
     
    34413441                && (!pNetwork->MacTab.fWireActive || (pTrunk->fNoPreemptDsts & INTNETTRUNKDIR_WIRE) ) );
    34423442
    3443     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     3443    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    34443444
    34453445    return fRc;
     
    37833783        pIfSender->MacAddr    = EthHdr.SrcMac;
    37843784
    3785         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     3785        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    37863786    }
    37873787
     
    41544154        }
    41554155
    4156         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     4156        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    41574157    }
    41584158    else
     
    42384238        }
    42394239
    4240         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     4240        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    42414241
    42424242        if (pTrunk)
     
    43374337    }
    43384338
    4339     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     4339    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    43404340
    43414341    /*
     
    47424742        PINTNETTRUNKIF pTrunk = pNetwork->MacTab.pTrunk;
    47434743
    4744         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     4744        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    47454745
    47464746        /* Notify the trunk about the interface being destroyed. */
     
    47544754        RTSpinlockAcquire(pNetwork->hAddrSpinlock);
    47554755        pIf->pNetwork = NULL;
    4756         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     4756        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    47574757
    47584758        SUPR0ObjRelease(pNetwork->pvObj, pIf->pSession);
     
    49684968                        intnetR0BusyIncTrunk(pTrunk);
    49694969
    4970                     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     4970                    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    49714971
    49724972                    if (pTrunk)
     
    50415041        pThis->MacAddr           = *pMacAddr;
    50425042
    5043         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     5043        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    50445044    }
    50455045    else
     
    50695069                                             && (pNetwork->fFlags & INTNET_OPEN_FLAGS_PROMISC_ALLOW_TRUNK_HOST);
    50705070
    5071         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     5071        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    50725072    }
    50735073    intnetR0BusyDecTrunk(pThis);
     
    51485148            RTSpinlockAcquire(pNetwork->hAddrSpinlock);
    51495149            pNetwork->MacTab.pTrunk = NULL;
    5150             RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     5150            RTSpinlockRelease(pNetwork->hAddrSpinlock);
    51515151
    51525152            intnetR0TrunkIfDestroy(pThis, pNetwork);
     
    52525252                }
    52535253            }
    5254             RTSpinlockReleaseNoInts(pThis->hDstTabSpinlock);
     5254            RTSpinlockRelease(pThis->hDstTabSpinlock);
    52555255            Assert(!pDstTab || iDstTab < pThis->cIntDstTabs);
    52565256        }
     
    52655265            {
    52665266                pThis->apIntDstTabs[iDstTab] = NULL;
    5267                 RTSpinlockReleaseNoInts(pThis->hDstTabSpinlock);
     5267                RTSpinlockRelease(pThis->hDstTabSpinlock);
    52685268                Assert(iDstTab < RT_ELEMENTS(pThis->apTaskDstTabs));
    52695269            }
    52705270            else
    52715271            {
    5272                 RTSpinlockReleaseNoInts(pThis->hDstTabSpinlock);
     5272                RTSpinlockRelease(pThis->hDstTabSpinlock);
    52735273                intnetR0AllocDstTab(pNetwork->MacTab.cEntriesAllocated, &pDstTab);
    52745274                iDstTab = 65535;
     
    53095309                        }
    53105310                }
    5311                 RTSpinlockReleaseNoInts(pThis->hDstTabSpinlock);
     5311                RTSpinlockRelease(pThis->hDstTabSpinlock);
    53125312                Assert(iDstTab < RT_MAX(RT_ELEMENTS(pThis->apTaskDstTabs), pThis->cIntDstTabs));
    53135313            }
     
    56635663    pNetwork->MacTab.fWireActive = false;
    56645664
    5665     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     5665    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    56665666
    56675667    /* Wait for all the interfaces to quiesce.  (Interfaces cannot be
     
    56995699    pNetwork->MacTab.pTrunk = NULL;
    57005700
    5701     RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     5701    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    57025702
    57035703    if (pTrunk)
     
    58915891        }
    58925892
    5893         RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock);
     5893        RTSpinlockRelease(pNetwork->hAddrSpinlock);
    58945894    }
    58955895
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r52575 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9393 * u32UpdateIntervalNS GIP members. The value must be a power of 2. */
    9494#define GIP_UPDATEHZ_RECALC_FREQ            0x800
     95
     96/** A reserved TSC value used for synchronization as well as measurement of
     97 *  TSC deltas. */
     98#define GIP_TSC_DELTA_RSVD                  UINT64_MAX
     99/** The number of TSC delta measurement loops in total (includes primer and
     100 *  read-time loops). */
     101#define GIP_TSC_DELTA_LOOPS                 96
     102/** The number of cache primer loops. */
     103#define GIP_TSC_DELTA_PRIMER_LOOPS          4
     104/** The number of loops until we keep computing the minumum read time. */
     105#define GIP_TSC_DELTA_READ_TIME_LOOPS       24
     106/** Stop measurement of TSC delta. */
     107#define GIP_TSC_DELTA_SYNC_STOP             0
     108/** Start measurement of TSC delta. */
     109#define GIP_TSC_DELTA_SYNC_START            1
     110/** Worker thread is ready for reading the TSC. */
     111#define GIP_TSC_DELTA_SYNC_WORKER_READY     2
     112/** Worker thread is done updating TSC delta info. */
     113#define GIP_TSC_DELTA_SYNC_WORKER_DONE      3
     114/** When IPRT is isn't concurrent safe: Master is ready and will wait for slave
     115 *  with a timeout. */
     116#define GIP_TSC_DELTA_SYNC_PRESTART_MASTER  4
     117/** When IPRT is isn't concurrent safe: Worker is ready after waiting for
     118 *  master with a timeout. */
     119#define GIP_TSC_DELTA_SYNC_PRESTART_WORKER  5
     120
     121AssertCompile(GIP_TSC_DELTA_PRIMER_LOOPS < GIP_TSC_DELTA_READ_TIME_LOOPS);
     122AssertCompile(GIP_TSC_DELTA_PRIMER_LOOPS + GIP_TSC_DELTA_READ_TIME_LOOPS < GIP_TSC_DELTA_LOOPS);
    95123
    96124/** @def VBOX_SVN_REV
     
    139167                                                  RTCPUID idCpu, uint8_t idApic, uint64_t iTick);
    140168static void                 supdrvGipInitCpu(PSUPGLOBALINFOPAGE pGip, PSUPGIPCPU pCpu, uint64_t u64NanoTS);
     169static int                  supdrvMeasureTscDeltas(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip, uint32_t *pidxMaster);
    141170static int                  supdrvIOCtl_ResumeSuspendedKbds(void);
    142171
     
    146175*******************************************************************************/
    147176DECLEXPORT(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPage = NULL;
     177
     178/**
     179 * The TSC delta synchronization struct. rounded to cache line size.
     180 */
     181typedef union SUPTSCDELTASYNC
     182{
     183    /** The synchronization variable, holds values GIP_TSC_DELTA_SYNC_*. */
     184    volatile uint32_t   u;
     185    /** Padding to cache line size. */
     186    uint8_t             u8Padding[64];
     187} SUPTSCDELTASYNC;
     188AssertCompileSize(SUPTSCDELTASYNC, 64);
     189typedef SUPTSCDELTASYNC *PSUPTSCDELTASYNC;
     190
     191/** Pointer to the TSC delta sync. struct. */
     192static void                *g_pvTscDeltaSync;
     193/** Aligned pointer to the TSC delta sync. struct. */
     194static PSUPTSCDELTASYNC     g_pTscDeltaSync;
     195/** The TSC delta measurement initiator Cpu Id. */
     196static volatile RTCPUID     g_idTscDeltaInitiator = NIL_RTCPUID;
     197/** Number of online/offline events, incremented each time a CPU goes online
     198 *  or offline. */
     199static volatile uint32_t    g_cMpOnOffEvents;
    148200
    149201/**
     
    354406    { "RTSpinlockDestroy",                      (void *)RTSpinlockDestroy },
    355407    { "RTSpinlockRelease",                      (void *)RTSpinlockRelease },
    356     { "RTSpinlockReleaseNoInts",                (void *)RTSpinlockReleaseNoInts },
    357408    { "RTStrCopy",                              (void *)RTStrCopy },
    358409    { "RTStrDupTag",                            (void *)RTStrDupTag },
     
    39574008                if (pGipR0->aCPUs[0].u32TransactionId != 2 /* not the first time */)
    39584009                {
    3959                     for (i = 0; i < RT_ELEMENTS(pGipR0->aCPUs); i++)
     4010                    for (i = 0; i < pGipR0->cCpus; i++)
    39604011                        ASMAtomicUoWriteU32(&pGipR0->aCPUs[i].u32TransactionId,
    39614012                                            (pGipR0->aCPUs[i].u32TransactionId + GIP_UPDATEHZ_RECALC_FREQ * 2)
     
    55815632    supdrvGipInit(pDevExt, pGip, HCPhysGip, RTTimeSystemNanoTS(), 1000000000 / u32Interval /*=Hz*/, cCpus);
    55825633
    5583     /*
    5584      * Create the timer.
    5585      * If CPU_ALL isn't supported we'll have to fall back to synchronous mode.
    5586      */
    5587     if (pGip->u32Mode == SUPGIPMODE_ASYNC_TSC)
    5588     {
    5589         rc = RTTimerCreateEx(&pDevExt->pGipTimer, u32Interval, RTTIMER_FLAGS_CPU_ALL, supdrvGipAsyncTimer, pDevExt);
    5590         if (rc == VERR_NOT_SUPPORTED)
    5591         {
    5592             OSDBGPRINT(("supdrvGipCreate: omni timer not supported, falling back to synchronous mode\n"));
    5593             pGip->u32Mode = SUPGIPMODE_SYNC_TSC;
    5594         }
    5595     }
    5596     if (pGip->u32Mode != SUPGIPMODE_ASYNC_TSC)
    5597         rc = RTTimerCreateEx(&pDevExt->pGipTimer, u32Interval, 0 /* fFlags */, supdrvGipSyncTimer, pDevExt);
     5634    rc = RTMpNotificationRegister(supdrvGipMpEvent, pDevExt);
    55985635    if (RT_SUCCESS(rc))
    55995636    {
    5600         rc = RTMpNotificationRegister(supdrvGipMpEvent, pDevExt);
     5637        rc = RTMpOnAll(supdrvGipInitOnCpu, pDevExt, pGip);
    56015638        if (RT_SUCCESS(rc))
    56025639        {
    5603             rc = RTMpOnAll(supdrvGipInitOnCpu, pDevExt, pGip);
     5640            /*
     5641             * Measure the TSC deltas now that we have MP notifications.
     5642             */
     5643            unsigned cTries = 5;
     5644#if 0
     5645            do
     5646            {
     5647                rc = supdrvMeasureTscDeltas(pDevExt, pGip, NULL /* pidxMaster */);
     5648                if (rc == VERR_TRY_AGAIN)
     5649                {
     5650                    --cTries;
     5651                    continue;
     5652                }
     5653                else
     5654                    break;
     5655            } while (cTries > 0);
     5656#endif
     5657
    56045658            if (RT_SUCCESS(rc))
    56055659            {
     5660#if 0
     5661                unsigned iCpu;
     5662                SUPR0Printf("cTries=%u\n", cTries);
     5663                for (iCpu = 0; iCpu < pGip->cCpus; iCpu++)
     5664                    SUPR0Printf("Cpu[%3u].delta=%ld\n", iCpu, pGip->aCPUs[iCpu].i64TSCDelta);
     5665#endif
     5666
    56065667                /*
    5607                  * We're good.
     5668                 * Create the timer.
     5669                 * If CPU_ALL isn't supported we'll have to fall back to synchronous mode.
    56085670                 */
    5609                 Log(("supdrvGipCreate: %u ns interval.\n", u32Interval));
    5610                 g_pSUPGlobalInfoPage = pGip;
    5611                 return VINF_SUCCESS;
    5612             }
    5613 
     5671                if (pGip->u32Mode == SUPGIPMODE_ASYNC_TSC)
     5672                {
     5673                    rc = RTTimerCreateEx(&pDevExt->pGipTimer, u32Interval, RTTIMER_FLAGS_CPU_ALL, supdrvGipAsyncTimer, pDevExt);
     5674                    if (rc == VERR_NOT_SUPPORTED)
     5675                    {
     5676                        OSDBGPRINT(("supdrvGipCreate: omni timer not supported, falling back to synchronous mode\n"));
     5677                        pGip->u32Mode = SUPGIPMODE_SYNC_TSC;
     5678                    }
     5679                }
     5680                if (pGip->u32Mode != SUPGIPMODE_ASYNC_TSC)
     5681                    rc = RTTimerCreateEx(&pDevExt->pGipTimer, u32Interval, 0 /* fFlags */, supdrvGipSyncTimer, pDevExt);
     5682                if (RT_SUCCESS(rc))
     5683                {
     5684                    /*
     5685                     * We're good.
     5686                     */
     5687                    Log(("supdrvGipCreate: %u ns interval.\n", u32Interval));
     5688                    g_pSUPGlobalInfoPage = pGip;
     5689                    return VINF_SUCCESS;
     5690                }
     5691                else
     5692                {
     5693                    OSDBGPRINT(("supdrvGipCreate: failed create GIP timer at %u ns interval. rc=%Rrc\n", u32Interval, rc));
     5694                    Assert(!pDevExt->pGipTimer);
     5695                }
     5696            }
     5697            else
     5698                OSDBGPRINT(("supdrvGipCreate: supdrvMeasureTscDeltas() failed with rc=%Rrc after %u tries!\n", rc, cTries));
     5699        }
     5700        else
    56145701            OSDBGPRINT(("supdrvGipCreate: RTMpOnAll failed with rc=%Rrc\n", rc));
    5615             RTMpNotificationDeregister(supdrvGipMpEvent, pDevExt);
    5616 
    5617         }
    5618         else
    5619             OSDBGPRINT(("supdrvGipCreate: failed to register MP event notfication. rc=%Rrc\n", rc));
     5702
     5703        RTMpNotificationDeregister(supdrvGipMpEvent, pDevExt);
    56205704    }
    56215705    else
    5622     {
    5623         OSDBGPRINT(("supdrvGipCreate: failed create GIP timer at %u ns interval. rc=%Rrc\n", u32Interval, rc));
    5624         Assert(!pDevExt->pGipTimer);
    5625     }
     5706        OSDBGPRINT(("supdrvGipCreate: failed to register MP event notfication. rc=%Rrc\n", rc));
     5707
    56265708    supdrvGipDestroy(pDevExt);
    56275709    return rc;
     
    58115893    ASMAtomicWriteU16(&pGip->aiCpuFromCpuSetIdx[iCpuSet], i);
    58125894
     5895    /* Update the Mp online/offline counter. */
     5896    ASMAtomicIncU32(&g_cMpOnOffEvents);
     5897
    58135898    /* commit it */
    58145899    ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_ONLINE);
    58155900
    5816     RTSpinlockReleaseNoInts(pDevExt->hGipSpinlock);
     5901    RTSpinlockRelease(pDevExt->hGipSpinlock);
    58175902}
    58185903
     
    58465931    RTCpuSetDelByIndex(&pGip->OnlineCpuSet, iCpuSet);
    58475932
     5933    /* Update the Mp online/offline counter. */
     5934    ASMAtomicIncU32(&g_cMpOnOffEvents);
     5935
     5936    /* If we are the initiator going offline while measuring the TSC delta, unspin other waiting CPUs! */
     5937    if (ASMAtomicReadU32(&g_idTscDeltaInitiator) == idCpu)
     5938    {
     5939        ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_START);
     5940        ASMAtomicWriteU64(&pGip->aCPUs[i].u64TSCSample, ~GIP_TSC_DELTA_RSVD);
     5941    }
     5942
    58485943    /* commit it */
    58495944    ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_OFFLINE);
    58505945
    5851     RTSpinlockReleaseNoInts(pDevExt->hGipSpinlock);
     5946    RTSpinlockRelease(pDevExt->hGipSpinlock);
    58525947}
    58535948
     
    59296024
    59306025/**
     6026 * Callback used by supdrvMeasureTscDeltas() to read the TSC on two CPUs and
     6027 * compute the delta between them.
     6028 *
     6029 * @param   idCpu       The CPU we are current scheduled on.
     6030 * @param   pvUser1     Opaque pointer to the GIP.
     6031 * @param   pvUser2     Opaque pointer to the worker Cpu Id.
     6032 *
     6033 * @remarks Measuring TSC deltas between the CPUs is tricky because we need to
     6034 *     read the TSC at exactly the same time on both the master and the worker
     6035 *     CPUs. Due to DMA, bus arbitration, cache locality, contention etc. there
     6036 *     is no guaranteed way of doing this on x86 CPUs. We try to minimize the
     6037 *     measurement error by computing the minimum read time of the compare
     6038 *     statement in the slave by taking TSC measurements across it. We also
     6039 *     ignore the first few runs of the loop in order to prime the cache.
     6040 *
     6041 *     It must be noted that the computed minimum read time is mostly to
     6042 *     eliminate huge deltas when the slave is too early and doesn't by itself
     6043 *     help produce more accurate deltas. We allow two times the computed
     6044 *     minimum as an arbibtrary acceptable threshold. Therefore, it is still
     6045 *     possible to get negative deltas where there are none when the slave is
     6046 *     earlier.
     6047 */
     6048static DECLCALLBACK(void) supdrvDetermineTscDeltaCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2)
     6049{
     6050    PSUPGLOBALINFOPAGE pGip      = (PSUPGLOBALINFOPAGE)pvUser1;
     6051    uint32_t          *pidWorker = (uint32_t *)pvUser2;
     6052    RTCPUID            idMaster  = ASMAtomicUoReadU32(&g_idTscDeltaInitiator);
     6053    unsigned           idxMaster = supdrvGipCpuIndexFromCpuId(pGip, idMaster);
     6054    unsigned           idxWorker = supdrvGipCpuIndexFromCpuId(pGip, *pidWorker);
     6055    PSUPGIPCPU         pGipCpuMaster = &pGip->aCPUs[idxMaster];
     6056    PSUPGIPCPU         pGipCpuWorker = &pGip->aCPUs[idxWorker];
     6057    uint64_t           uMinCmpReadTime = UINT64_MAX;
     6058    int                cTriesLeft = 8;
     6059
     6060    if (   idCpu != idMaster
     6061        && idCpu != *pidWorker)
     6062        return;
     6063
     6064    /* If the IPRT API isn't concurrent safe, the master and worker wait for each other
     6065       with a timeout to avoid deadlocking the entire system. */
     6066    if (!RTMpOnAllIsConcurrentSafe())
     6067    {
     6068        uint64_t       uTscNow;
     6069        uint64_t       uTscStart;
     6070        uint64_t const cWaitTicks = 130000;  /* Arbitrary value, can be tweaked later. */
     6071
     6072        ASMSerializeInstruction();
     6073        uTscStart = ASMReadTSC();
     6074        if (idCpu == idMaster)
     6075        {
     6076            ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_PRESTART_MASTER);
     6077            while (ASMAtomicReadU32(&g_pTscDeltaSync->u) != GIP_TSC_DELTA_SYNC_PRESTART_WORKER)
     6078            {
     6079                ASMSerializeInstruction();
     6080                uTscNow = ASMReadTSC();
     6081                if (uTscNow - uTscStart > cWaitTicks)
     6082                {
     6083                    /* Set the worker delta to indicate failure, not the master. */
     6084                    ASMAtomicWriteS64(&pGipCpuWorker->i64TSCDelta, INT64_MAX);
     6085                    return;
     6086                }
     6087
     6088                ASMNopPause();
     6089            }
     6090        }
     6091        else
     6092        {
     6093            while (ASMAtomicReadU32(&g_pTscDeltaSync->u) != GIP_TSC_DELTA_SYNC_PRESTART_MASTER)
     6094            {
     6095                ASMSerializeInstruction();
     6096                uTscNow = ASMReadTSC();
     6097                if (uTscNow - uTscStart > cWaitTicks)
     6098                {
     6099                    ASMAtomicWriteS64(&pGipCpuWorker->i64TSCDelta, INT64_MAX);
     6100                    return;
     6101                }
     6102
     6103                ASMNopPause();
     6104            }
     6105            ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_PRESTART_WORKER);
     6106        }
     6107    }
     6108
     6109    Assert(pGipCpuWorker->i64TSCDelta == INT64_MAX);
     6110    while (cTriesLeft-- > 0)
     6111    {
     6112        unsigned i;
     6113        RTCCUINTREG uFlags = ASMIntDisableFlags();          /* Disable interrupts for the duration of a try. */
     6114        for (i = 0; i < GIP_TSC_DELTA_LOOPS; i++)
     6115        {
     6116            if (idCpu == idMaster)
     6117            {
     6118                /*
     6119                 * The master.
     6120                 */
     6121                Assert(pGipCpuMaster->u64TSCSample == GIP_TSC_DELTA_RSVD);
     6122                ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_START);
     6123                while (ASMAtomicReadU32(&g_pTscDeltaSync->u) == GIP_TSC_DELTA_SYNC_START)
     6124                    ;
     6125
     6126                do
     6127                {
     6128                    ASMSerializeInstruction();
     6129                    ASMAtomicWriteU64(&pGipCpuMaster->u64TSCSample, ASMReadTSC());
     6130                } while (pGipCpuMaster->u64TSCSample == GIP_TSC_DELTA_RSVD);
     6131
     6132                while (ASMAtomicReadU32(&g_pTscDeltaSync->u) != GIP_TSC_DELTA_SYNC_WORKER_DONE)
     6133                    ;
     6134
     6135                if (i > GIP_TSC_DELTA_PRIMER_LOOPS + GIP_TSC_DELTA_READ_TIME_LOOPS)
     6136                {
     6137                    if (pGipCpuWorker->u64TSCSample != GIP_TSC_DELTA_RSVD)
     6138                    {
     6139                        int64_t iDelta = pGipCpuWorker->u64TSCSample - pGipCpuMaster->u64TSCSample;
     6140                        if (iDelta < pGipCpuWorker->i64TSCDelta)
     6141                            pGipCpuWorker->i64TSCDelta = iDelta;
     6142                    }
     6143                }
     6144
     6145                ASMAtomicWriteU64(&pGipCpuMaster->u64TSCSample, GIP_TSC_DELTA_RSVD);
     6146                ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_STOP);
     6147            }
     6148            else
     6149            {
     6150                /*
     6151                 * The worker.
     6152                 */
     6153                uint64_t uTscWorker;
     6154                uint64_t uTscWorkerFlushed;
     6155                uint64_t uCmpReadTime;
     6156
     6157                ASMAtomicReadU64(&pGipCpuMaster->u64TSCSample);     /* Warm the cache line. */
     6158                while (ASMAtomicReadU32(&g_pTscDeltaSync->u) != GIP_TSC_DELTA_SYNC_START)
     6159                    ;
     6160                ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_WORKER_READY);
     6161
     6162                /*
     6163                 * Keep reading the TSC until we notice that the master has read his. Reading
     6164                 * the TSC -after- the master has updated the memory is way too late. We thus
     6165                 * compensate by trying to measure how long it took for the slave to notice
     6166                 * the memory flushed from the master.
     6167                 */
     6168                do
     6169                {
     6170                    ASMSerializeInstruction();
     6171                    uTscWorker = ASMReadTSC();
     6172                } while (pGipCpuMaster->u64TSCSample == GIP_TSC_DELTA_RSVD);
     6173                ASMSerializeInstruction();
     6174                uTscWorkerFlushed = ASMReadTSC();
     6175
     6176                uCmpReadTime = uTscWorkerFlushed - uTscWorker;
     6177                if (i > GIP_TSC_DELTA_PRIMER_LOOPS + GIP_TSC_DELTA_READ_TIME_LOOPS)
     6178                {
     6179                    /* This is totally arbitrary a.k.a I don't like it but I have no better ideas for now. */
     6180                    if (uCmpReadTime < (uMinCmpReadTime << 1))
     6181                    {
     6182                        ASMAtomicWriteU64(&pGipCpuWorker->u64TSCSample, uTscWorker);
     6183                        if (uCmpReadTime < uMinCmpReadTime)
     6184                            uMinCmpReadTime = uCmpReadTime;
     6185                    }
     6186                    else
     6187                        ASMAtomicWriteU64(&pGipCpuWorker->u64TSCSample, GIP_TSC_DELTA_RSVD);
     6188                }
     6189                else if (i > GIP_TSC_DELTA_PRIMER_LOOPS)
     6190                {
     6191                    if (uCmpReadTime < uMinCmpReadTime)
     6192                        uMinCmpReadTime = uCmpReadTime;
     6193                }
     6194
     6195                ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_WORKER_DONE);
     6196                while (ASMAtomicReadU32(&g_pTscDeltaSync->u) == GIP_TSC_DELTA_SYNC_WORKER_DONE)
     6197                    ASMNopPause();
     6198            }
     6199        }
     6200        ASMSetFlags(uFlags);
     6201
     6202        if (pGipCpuWorker->i64TSCDelta != INT64_MAX)
     6203            break;
     6204    }
     6205}
     6206
     6207
     6208/**
     6209 * Clears all TSCs on the per-CPUs GIP struct. as well as the delta
     6210 * synchronization variable. Optionally also clears the deltas on the per-CPU
     6211 * GIP struct. as well.
     6212 *
     6213 * @param   pGip            Pointer to the GIP.
     6214 * @param   fClearDeltas    Whether the deltas are also to be cleared.
     6215 */
     6216DECLINLINE(void) supdrvClearTscSamples(PSUPGLOBALINFOPAGE pGip, bool fClearDeltas)
     6217{
     6218    unsigned iCpu;
     6219    for (iCpu = 0; iCpu < pGip->cCpus; iCpu++)
     6220    {
     6221        PSUPGIPCPU pGipCpu = &pGip->aCPUs[iCpu];
     6222        ASMAtomicWriteU64(&pGipCpu->u64TSCSample, GIP_TSC_DELTA_RSVD);
     6223        if (fClearDeltas)
     6224            ASMAtomicWriteS64(&pGipCpu->i64TSCDelta, INT64_MAX);
     6225    }
     6226    ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_STOP);
     6227}
     6228
     6229
     6230/**
     6231 * Measures the TSC deltas between CPUs.
     6232 *
     6233 * @param   pDevExt     Pointer to the device instance data.
     6234 * @param   pGip        Pointer to the GIP.
     6235 * @param   pidxMaster  Where to store the index of the chosen master TSC if we
     6236 *                      managed to determine the TSC deltas successfully.
     6237 *                      Optional, can be NULL.
     6238 *
     6239 * @returns VBox status code.
     6240 * @remarks Must be called only after supdrvGipInitOnCpu() as this function uses
     6241 *          idCpu, GIP's online CPU set which are populated in
     6242 *          supdrvGipInitOnCpu().
     6243 */
     6244static int supdrvMeasureTscDeltas(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip, uint32_t *pidxMaster)
     6245{
     6246    PSUPGIPCPU pGipCpuMaster;
     6247    unsigned   iCpu;
     6248    uint32_t   cMpOnOffEvents = ASMAtomicReadU32(&g_cMpOnOffEvents);
     6249    uint32_t   cOnlineCpus    = pGip->cOnlineCpus;
     6250
     6251    /* Pick the first CPU which is online as the master TSC. */
     6252    uint32_t idxMaster = UINT32_MAX;
     6253    supdrvClearTscSamples(pGip, true /* fClearDeltas */);
     6254    for (iCpu = 0; iCpu < pGip->cCpus; iCpu++)
     6255    {
     6256        PSUPGIPCPU pGipCpu = &pGip->aCPUs[iCpu];
     6257        if (RTCpuSetIsMember(&pGip->OnlineCpuSet, pGipCpu->idCpu))
     6258        {
     6259            idxMaster = iCpu;
     6260            pGipCpu->i64TSCDelta = 0;
     6261            break;
     6262        }
     6263    }
     6264    AssertReturn(cOnlineCpus > 0, VERR_INTERNAL_ERROR_5);
     6265    AssertReturn(idxMaster != UINT32_MAX, VERR_CPU_NOT_FOUND);
     6266
     6267    if (pGip->cOnlineCpus <= 1)
     6268    {
     6269        if (pidxMaster)
     6270            *pidxMaster = idxMaster;
     6271        return VINF_SUCCESS;
     6272    }
     6273
     6274    /* Pick the master TSC as the initiator. */
     6275    pGipCpuMaster = &pGip->aCPUs[idxMaster];
     6276    ASMAtomicWriteU32(&g_idTscDeltaInitiator, pGipCpuMaster->idCpu);
     6277
     6278    for (iCpu = 0; iCpu < pGip->cCpus; iCpu++)
     6279    {
     6280        PSUPGIPCPU pGipCpuWorker = &pGip->aCPUs[iCpu];
     6281        if (   iCpu != idxMaster
     6282            && RTCpuSetIsMember(&pGip->OnlineCpuSet, pGipCpuWorker->idCpu))
     6283        {
     6284            int rc;
     6285
     6286            /* Fire TSC-read workers on all CPUs but only synchronize between master and one worker to memory contention. */
     6287            ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_STOP);
     6288            rc = RTMpOnAll(supdrvDetermineTscDeltaCallback, pGip, &pGipCpuWorker->idCpu);
     6289            if (RT_FAILURE(rc))
     6290            {
     6291                SUPR0Printf("supdrvMeasureTscDeltas: RTMpOnAll failed. rc=%d\n", rc);
     6292                return rc;
     6293            }
     6294
     6295            if (RT_UNLIKELY(pGipCpuWorker->i64TSCDelta == INT64_MAX))
     6296            {
     6297                SUPR0Printf("Failed to measure TSC deltas for CPU[%u] idCpu=%u\n", iCpu, pGipCpuWorker->idCpu);
     6298                return VERR_UNRESOLVED_ERROR;
     6299            }
     6300
     6301            if (ASMAtomicReadU32(&g_cMpOnOffEvents) != cMpOnOffEvents)
     6302            {
     6303                SUPR0Printf("One or more CPUs transitioned between online & offline states. I are confused, retrying...\n");
     6304                return VERR_TRY_AGAIN;
     6305            }
     6306        }
     6307    }
     6308
     6309    ASMAtomicWriteU32(&g_idTscDeltaInitiator, NIL_RTCPUID);
     6310
     6311    if (RT_LIKELY(!pGipCpuMaster->i64TSCDelta))
     6312    {
     6313        if (pidxMaster)
     6314            *pidxMaster = idxMaster;
     6315        return VINF_SUCCESS;
     6316    }
     6317    return VERR_INTERNAL_ERROR_4;
     6318}
     6319
     6320
     6321/**
    59316322 * Callback used by supdrvDetermineAsyncTSC to read the TSC on a CPU.
    59326323 *
     
    59376328static DECLCALLBACK(void) supdrvDetermineAsyncTscWorker(RTCPUID idCpu, void *pvUser1, void *pvUser2)
    59386329{
    5939 #if 1
    59406330    ASMAtomicWriteU64((uint64_t volatile *)pvUser1, ASMReadTSC());
    5941 #else
    5942     *(uint64_t *)pvUser1 = ASMReadTSC();
    5943 #endif
    59446331}
    59456332
     
    60926479    pCpu->u64NanoTS          = u64NanoTS;
    60936480    pCpu->u64TSC             = ASMReadTSC();
     6481    pCpu->u64TSCSample       = GIP_TSC_DELTA_RSVD;
     6482    pCpu->i64TSCDelta        = INT64_MAX;
    60946483
    60956484    ASMAtomicWriteSize(&pCpu->enmState, SUPGIPCPUSTATE_INVALID);
     
    61716560    pDevExt->HCPhysGip = HCPhys;
    61726561    pDevExt->cGipUsers = 0;
     6562
     6563    /*
     6564     * Allocate the TSC delta sync. struct. on a separate cache line.
     6565     */
     6566    g_pvTscDeltaSync = RTMemAllocZ(sizeof(SUPTSCDELTASYNC) + 63);
     6567    g_pTscDeltaSync  = RT_ALIGN_PT(g_pvTscDeltaSync, 64, PSUPTSCDELTASYNC);
     6568    Assert(RT_ALIGN_PT(g_pTscDeltaSync, 64, PSUPTSCDELTASYNC) == g_pTscDeltaSync);
    61736569}
    61746570
     
    61986594    unsigned i;
    61996595    pGip->u32Magic = 0;
    6200     for (i = 0; i < RT_ELEMENTS(pGip->aCPUs); i++)
     6596    for (i = 0; i < pGip->cCpus; i++)
    62016597    {
    62026598        pGip->aCPUs[i].u64NanoTS = 0;
    62036599        pGip->aCPUs[i].u64TSC = 0;
    62046600        pGip->aCPUs[i].iTSCHistoryHead = 0;
     6601        pGip->aCPUs[i].u64TSCSample = 0;
     6602        pGip->aCPUs[i].i64TSCDelta = INT64_MAX;
     6603    }
     6604
     6605    if (g_pvTscDeltaSync)
     6606    {
     6607        RTMemFree(g_pvTscDeltaSync);
     6608        g_pTscDeltaSync  = NULL;
     6609        g_pvTscDeltaSync = NULL;
    62056610    }
    62066611}
  • trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h

    r51907 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    200200 *
    201201 * @todo Pending work on next major version change:
    202  *          - Remove RTSpinlockReleaseNoInts.
    203  */
    204 #define SUPDRV_IOC_VERSION                              0x001a0007
     202 *          - (none).
     203 */
     204#define SUPDRV_IOC_VERSION                              0x001b0000
    205205
    206206/** SUP_IOCTL_COOKIE. */
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r51978 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    474474        { "RTSpinlockRelease",                      0xefef0031 },
    475475        { "RTSpinlockAcquireNoInts",                0xefef0032 },
    476         { "RTSpinlockReleaseNoInts",                0xefef0033 },
    477476        { "RTTimeNanoTS",                           0xefef0034 },
    478477        { "RTTimeMillieTS",                         0xefef0035 },
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r52576 r52618  
    505505            rc = VERR_GENERAL_FAILURE;
    506506
    507         RTSpinlockReleaseNoInts(g_Spinlock);
     507        RTSpinlockRelease(g_Spinlock);
    508508#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
    509509        kauth_cred_unref(&pCred);
     
    571571        supdrvSessionRetain(pSession);
    572572
    573     RTSpinlockReleaseNoInts(g_Spinlock);
     573    RTSpinlockRelease(g_Spinlock);
    574574    if (RT_UNLIKELY(!pSession))
    575575    {
     
    14781478                    rc = VERR_ALREADY_LOADED;
    14791479
    1480                 RTSpinlockReleaseNoInts(g_Spinlock);
     1480                RTSpinlockRelease(g_Spinlock);
    14811481                if (RT_SUCCESS(rc))
    14821482                {
     
    15411541        }
    15421542    }
    1543     RTSpinlockReleaseNoInts(g_Spinlock);
     1543    RTSpinlockRelease(g_Spinlock);
    15441544    if (!pSession)
    15451545    {
  • trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp

    r52575 r52618  
    163163        pSession->pNextHash = g_apSessionHashTab[iHash];
    164164        g_apSessionHashTab[iHash] = pSession;
    165         RTSpinlockReleaseNoInts(g_Spinlock);
     165        RTSpinlockRelease(g_Spinlock);
    166166    }
    167167
     
    212212        }
    213213    }
    214     RTSpinlockReleaseNoInts(g_Spinlock);
     214    RTSpinlockRelease(g_Spinlock);
    215215    if (!pSession)
    216216    {
     
    248248            supdrvSessionRetain(pSession);
    249249    }
    250     RTSpinlockReleaseNoInts(g_Spinlock);
     250    RTSpinlockRelease(g_Spinlock);
    251251    if (RT_UNLIKELY(!pSession))
    252252    {
     
    285285            supdrvSessionRetain(pSession);
    286286    }
    287     RTSpinlockReleaseNoInts(g_Spinlock);
     287    RTSpinlockRelease(g_Spinlock);
    288288    if (!pSession)
    289289    {
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c

    r52575 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    543543        pSession->pNextHash = g_apSessionHashTab[iHash];
    544544        g_apSessionHashTab[iHash] = pSession;
    545         RTSpinlockReleaseNoInts(g_Spinlock);
     545        RTSpinlockRelease(g_Spinlock);
    546546        LogFlow(("VBoxDrvSolarisOpen success\n"));
    547547    }
     
    631631        }
    632632    }
    633     RTSpinlockReleaseNoInts(g_Spinlock);
     633    RTSpinlockRelease(g_Spinlock);
    634634    if (!pSession)
    635635    {
     
    705705    while (pSession && pSession->Process != Process && pSession->fUnrestricted == fUnrestricted);
    706706        pSession = pSession->pNextHash;
    707     RTSpinlockReleaseNoInts(g_Spinlock);
     707    RTSpinlockRelease(g_Spinlock);
    708708    if (!pSession)
    709709    {
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp

    r45399 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    108108                     g_pSUPGlobalInfoPage->u32Version);
    109109            RTPrintf(fHex
    110                      ? "tstGIP-2:     it: u64NanoTS        delta     u64TSC           UpIntTSC H  TransId           CpuHz TSC Interval History...\n"
    111                      : "tstGIP-2:     it: u64NanoTS        delta     u64TSC             UpIntTSC H    TransId           CpuHz TSC Interval History...\n");
     110                     ? "tstGIP-2:     it: u64NanoTS        delta     u64TSC           UpIntTSC H  TransId           CpuHz         TSCDelta TSC Interval History...\n"
     111                     : "tstGIP-2:     it: u64NanoTS        delta     u64TSC             UpIntTSC H    TransId           CpuHz         TSCDelta TSC Interval History...\n");
    112112            static SUPGIPCPU s_aaCPUs[2][256];
    113113            for (uint32_t i = 0; i < cIterations; i++)
     
    126126                        PSUPGIPCPU pCpu = &s_aaCPUs[i & 1][iCpu];
    127127                        RTPrintf(fHex
    128                                  ? "tstGIP-2: %4d/%d: %016llx %09llx %016llx %08x %d %08x %15llu %08x %08x %08x %08x %08x %08x %08x %08x (%d)\n"
    129                                  : "tstGIP-2: %4d/%d: %016llu %09llu %016llu %010u %d %010u %15llu %08x %08x %08x %08x %08x %08x %08x %08x (%d)\n",
     128                                 ? "tstGIP-2: %4d/%d: %016llx %09llx %016llx %08x %d %08x %15llu %016lld %08x %08x %08x %08x %08x %08x %08x %08x (%d)\n"
     129                                 : "tstGIP-2: %4d/%d: %016llu %09llu %016llu %010u %d %010u %15llu %016lld %08x %08x %08x %08x %08x %08x %08x %08x (%d)\n",
    130130                                 i, iCpu,
    131131                                 pCpu->u64NanoTS,
     
    136136                                 pCpu->u32TransactionId,
    137137                                 pCpu->u64CpuHz,
     138                                 pCpu->i64TSCDelta,
    138139                                 pCpu->au32TSCHistory[0],
    139140                                 pCpu->au32TSCHistory[1],
     
    159160                        /* nop */;
    160161            }
     162
     163            /* Display TSC deltas. */
     164            RTPrintf("tstGIP-2: TSC deltas:\n");
     165            for (unsigned iCpu = 0; iCpu < g_pSUPGlobalInfoPage->cCpus; iCpu++)
     166                RTPrintf("tstGIP-2: %6d: %016lld\n", iCpu, g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta);
    161167        }
    162168        else
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c

    r44528 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    109109    RTSpinlockAcquire(pThis->hSpinlock);
    110110    vboxNetAdpSetState(pThis, enmNewState);
    111     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     111    RTSpinlockRelease(pThis->hSpinlock);
    112112}
    113113
     
    126126    RTSpinlockAcquire(pThis->hSpinlock);
    127127    enmState = vboxNetAdpGetState(pThis);
    128     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     128    RTSpinlockRelease(pThis->hSpinlock);
    129129    Log(("vboxNetAdpGetStateWithLock: pThis=%p, state=%d.\n", pThis, enmState));
    130130    return enmState;
     
    152152    else
    153153        fRc = false;
    154     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     154    RTSpinlockRelease(pThis->hSpinlock);
    155155
    156156    if (fRc)
     
    180180            &&  !strcmp(pThis->szName, pszName))
    181181        {
    182             RTSpinlockReleaseNoInts(pThis->hSpinlock);
     182            RTSpinlockRelease(pThis->hSpinlock);
    183183            return pThis;
    184184        }
    185         RTSpinlockReleaseNoInts(pThis->hSpinlock);
     185        RTSpinlockRelease(pThis->hSpinlock);
    186186    }
    187187    return NULL;
     
    349349        vboxNetAdpBusy(pThis);
    350350    }
    351     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     351    RTSpinlockRelease(pThis->hSpinlock);
    352352    Log(("vboxNetAdpPrepareToReceive: fCanReceive=%d.\n", fCanReceive));
    353353
     
    413413    if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Active)
    414414    {
    415         RTSpinlockReleaseNoInts(pThis->hSpinlock);
     415        RTSpinlockRelease(pThis->hSpinlock);
    416416        Log(("vboxNetAdpReceive: Dropping incoming packet for inactive interface %s.\n",
    417417             pThis->szName));
     
    420420    vboxNetAdpRetain(pThis);
    421421    vboxNetAdpBusy(pThis);
    422     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     422    RTSpinlockRelease(pThis->hSpinlock);
    423423
    424424    rc = vboxNetAdpPortOsXmit(pThis, pSG, fDst);
     
    515515    }
    516516
    517     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     517    RTSpinlockRelease(pThis->hSpinlock);
    518518    Log(("vboxNetAdpPortSetActive: state after: %RTbool.\n", vboxNetAdpGetState(pThis)));
    519519    return fPreviouslyActive;
     
    546546    Assert(!pThis->cBusy);
    547547    vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional);
    548     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     548    RTSpinlockRelease(pThis->hSpinlock);
    549549
    550550    vboxNetAdpOsDisconnectIt(pThis);
     
    553553    RTSpinlockAcquire(pThis->hSpinlock);
    554554    vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available);
    555     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     555    RTSpinlockRelease(pThis->hSpinlock);
    556556
    557557    vboxNetAdpRelease(pThis);
     
    601601            RTSpinlockAcquire(pThis->hSpinlock);
    602602            vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available);
    603             RTSpinlockReleaseNoInts(pThis->hSpinlock);
     603            RTSpinlockRelease(pThis->hSpinlock);
    604604            return rc;
    605605        }
     
    617617    if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Available || pThis->cBusy)
    618618    {
    619         RTSpinlockReleaseNoInts(pThis->hSpinlock);
     619        RTSpinlockRelease(pThis->hSpinlock);
    620620        return VERR_INTNET_FLT_IF_BUSY;
    621621    }
    622622    vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional);
    623     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     623    RTSpinlockRelease(pThis->hSpinlock);
    624624    vboxNetAdpRelease(pThis);
    625625
     
    628628    RTSpinlockAcquire(pThis->hSpinlock);
    629629    vboxNetAdpSetState(pThis, kVBoxNetAdpState_Invalid);
    630     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     630    RTSpinlockRelease(pThis->hSpinlock);
    631631
    632632    return rc;
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c

    r52394 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    404404        ASMAtomicWriteBool(&pThis->fRediscoveryPending, true);
    405405
    406     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     406    RTSpinlockRelease(pThis->hSpinlock);
    407407
    408408    /*
     
    517517    if (enmOldTrunkState != enmState)
    518518        ASMAtomicWriteU32((uint32_t volatile *)&pThis->enmTrunkState, enmState);
    519     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     519    RTSpinlockRelease(pThis->hSpinlock);
    520520
    521521    /*
     
    622622    RTSpinlockAcquire(pThis->hSpinlock);
    623623    vboxNetFltSetState(pThis, kVBoxNetFltInsState_Disconnecting);
    624     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     624    RTSpinlockRelease(pThis->hSpinlock);
    625625
    626626    vboxNetFltOsDisconnectIt(pThis);
     
    630630    RTSpinlockAcquire(pThis->hSpinlock);
    631631    vboxNetFltSetState(pThis, kVBoxNetFltInsState_Unconnected);
    632     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     632    RTSpinlockRelease(pThis->hSpinlock);
    633633#endif
    634634
     
    850850        AssertMsg(cRefs >= 1 && cRefs < UINT32_MAX / 2, ("%d\n", cRefs)); NOREF(cRefs);
    851851    }
    852     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     852    RTSpinlockRelease(pThis->hSpinlock);
    853853
    854854    return fRc;
     
    897897        AssertMsg(cRefs >= 1 && cRefs < UINT32_MAX / 2, ("%d\n", cRefs)); NOREF(cRefs);
    898898    }
    899     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     899    RTSpinlockRelease(pThis->hSpinlock);
    900900
    901901    return fRc;
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp

    r50762 r52618  
    319319            ifnet_reference(pIfNet);
    320320    }
    321     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     321    RTSpinlockRelease(pThis->hSpinlock);
    322322
    323323    return pIfNet;
     
    749749    ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true);
    750750
    751     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     751    RTSpinlockRelease(pThis->hSpinlock);
    752752
    753753    if (pIfNet)
     
    10311031    RTSpinlockAcquire(pThis->hSpinlock);
    10321032    ASMAtomicUoWritePtr(&pThis->u.s.pIfNet, pIfNet);
    1033     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1033    RTSpinlockRelease(pThis->hSpinlock);
    10341034
    10351035    /* Adjust g_offIfNetPCount as it varies for different versions of xnu. */
     
    10691069            pIfNet = NULL; /* don't dereference it */
    10701070        }
    1071         RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1071        RTSpinlockRelease(pThis->hSpinlock);
    10721072
    10731073        /* Report capabilities. */
     
    12901290    if (pIfFilter)
    12911291        ASMAtomicUoWriteNullPtr(&pThis->u.s.pIfFilter);
    1292     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1292    RTSpinlockRelease(pThis->hSpinlock);
    12931293
    12941294    if (pIfFilter)
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c

    r40912 r52618  
    609609    TASK_INIT(&pThis->u.s.tskout, 0, vboxNetFltFreeBSDoutput, pThis);
    610610
    611     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     611    RTSpinlockRelease(pThis->hSpinlock);
    612612
    613613    NG_NODE_SET_PRIVATE(node, pThis);
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c

    r47484 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    406406    ASMAtomicXchgPtr((void * volatile *)&pDev->hard_start_xmit, vboxNetFltLinuxStartXmitFilter);
    407407# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
    408     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     408    RTSpinlockRelease(pThis->hSpinlock);
    409409}
    410410
     
    442442    else
    443443        pOverride = NULL;
    444     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     444    RTSpinlockRelease(pThis->hSpinlock);
    445445
    446446    if (pOverride)
     
    14651465            fFeatures = 0;
    14661466
    1467         RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1467        RTSpinlockRelease(pThis->hSpinlock);
    14681468
    14691469        if (pThis->pSwitchPort)
     
    15791579    RTSpinlockAcquire(pThis->hSpinlock);
    15801580    ASMAtomicUoWritePtr(&pThis->u.s.pDev, pDev);
    1581     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1581    RTSpinlockRelease(pThis->hSpinlock);
    15821582
    15831583    Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) retained. ref=%d\n",
     
    16291629        pDev = NULL; /* don't dereference it */
    16301630    }
    1631     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1631    RTSpinlockRelease(pThis->hSpinlock);
    16321632
    16331633    /*
     
    16541654        RTSpinlockAcquire(pThis->hSpinlock);
    16551655        ASMAtomicUoWriteNullPtr(&pThis->u.s.pDev);
    1656         RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1656        RTSpinlockRelease(pThis->hSpinlock);
    16571657        dev_put(pDev);
    16581658        Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) released. ref=%d\n",
     
    16931693        ASMAtomicUoWriteNullPtr(&pThis->u.s.pDev);
    16941694    }
    1695     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1695    RTSpinlockRelease(pThis->hSpinlock);
    16961696
    16971697    if (fRegistered)
     
    20282028    pDev = ASMAtomicUoReadPtrT(&pThis->u.s.pDev, struct net_device *);
    20292029    fRegistered = ASMAtomicXchgBool(&pThis->u.s.fRegistered, false);
    2030     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     2030    RTSpinlockRelease(pThis->hSpinlock);
    20312031
    20322032    if (fRegistered)
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c

    r50664 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    11101110            const bool fActive = pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE;
    11111111            vboxNetFltRetain(pThis, true /* fBusy */);
    1112             RTSpinlockReleaseNoInts(pThis->hSpinlock);
     1112            RTSpinlockRelease(pThis->hSpinlock);
    11131113
    11141114            vboxnetflt_promisc_stream_t *pPromiscStream = (vboxnetflt_promisc_stream_t *)pStream;
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltM-win.cpp

    r44529 r52618  
    55 */
    66/*
    7  * Copyright (C) 2011-2012 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    143143    vboxNetFltWinSetOpState(&pNetFlt->u.s.WinIf.MpState, kVBoxNetDevOpState_Deinitializing);
    144144
    145     RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     145    RTSpinlockRelease(pNetFlt->hSpinlock);
    146146
    147147    vboxNetFltWinWaitDereference(&pNetFlt->u.s.WinIf.MpState);
     
    518518            || vboxNetFltWinGetPowerState(&pNetFlt->u.s.WinIf.MpState) > NdisDeviceStateD0)
    519519    {
    520         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     520        RTSpinlockRelease(pNetFlt->hSpinlock);
    521521        *pStatus = NDIS_STATUS_FAILURE;
    522522        return 0;
     
    527527    {
    528528        pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS | VBOXNDISREQUEST_QUEUED;
    529         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     529        RTSpinlockRelease(pNetFlt->hSpinlock);
    530530        *pStatus = NDIS_STATUS_PENDING;
    531531        return VBOXNDISREQUEST_INPROGRESS | VBOXNDISREQUEST_QUEUED;
     
    534534    if (pNetFlt->u.s.WinIf.StateFlags.fStandBy)
    535535    {
    536         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     536        RTSpinlockRelease(pNetFlt->hSpinlock);
    537537        *pStatus = NDIS_STATUS_FAILURE;
    538538        return 0;
     
    541541    pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS;
    542542
    543     RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     543    RTSpinlockRelease(pNetFlt->hSpinlock);
    544544
    545545    *pStatus = NDIS_STATUS_SUCCESS;
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltP-win.cpp

    r44529 r52618  
    55 */
    66/*
    7  * Copyright (C) 2011-2012 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    176176        /* mark the request as InProgress before posting it to RequestComplete */
    177177        pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS;
    178         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     178        RTSpinlockRelease(pNetFlt->hSpinlock);
    179179        vboxNetFltWinPtRequestComplete(pNetFlt, &pNetFlt->u.s.WinIf.PassDownRequest, NDIS_STATUS_FAILURE);
    180180    }
    181181    else
    182182    {
    183         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     183        RTSpinlockRelease(pNetFlt->hSpinlock);
    184184    }
    185185}
     
    209209    }
    210210
    211     RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     211    RTSpinlockRelease(pNetFlt->hSpinlock);
    212212
    213213    vboxNetFltWinPtRequestsWaitComplete(pNetFlt);
     
    14011401    if (pNetFlt->u.s.WinIf.StateFlags.fInterfaceClosing)
    14021402    {
    1403         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     1403        RTSpinlockRelease(pNetFlt->hSpinlock);
    14041404        Assert(0);
    14051405        return false;
     
    14071407    if (pNetFlt->u.s.WinIf.hBinding == NULL)
    14081408    {
    1409         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     1409        RTSpinlockRelease(pNetFlt->hSpinlock);
    14101410        Assert(0);
    14111411        return false;
     
    14131413
    14141414    pNetFlt->u.s.WinIf.StateFlags.fInterfaceClosing = TRUE;
    1415     RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     1415    RTSpinlockRelease(pNetFlt->hSpinlock);
    14161416
    14171417    NdisResetEvent(&pNetFlt->u.s.WinIf.OpenCloseEvent);
     
    14441444            pNetFlt->u.s.WinIf.StateFlags.fStandBy = TRUE;
    14451445        }
    1446         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     1446        RTSpinlockRelease(pNetFlt->hSpinlock);
    14471447        vboxNetFltWinPtRequestsWaitComplete(pNetFlt);
    14481448        vboxNetFltWinWaitDereference(&pNetFlt->u.s.WinIf.MpState);
     
    14691469        {
    14701470            pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS;
    1471             RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     1471            RTSpinlockRelease(pNetFlt->hSpinlock);
    14721472
    14731473            vboxNetFltWinMpRequestPost(pNetFlt);
     
    14751475        else
    14761476        {
    1477             RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     1477            RTSpinlockRelease(pNetFlt->hSpinlock);
    14781478        }
    14791479    }
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltRt-win.cpp

    r44529 r52618  
    55 */
    66/*
    7  * Copyright (C) 2011-2012 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    10691069        pSG = pWorker->pSG;
    10701070        pWorker->pSG = NULL;
    1071         RTSpinlockReleaseNoInts((pInstance)->hSpinlock);
     1071        RTSpinlockRelease((pInstance)->hSpinlock);
    10721072        KeSetEvent(&pWorker->KillEvent, 0, FALSE);
    10731073
     
    10831083    else
    10841084    {
    1085         RTSpinlockReleaseNoInts((pInstance)->hSpinlock);
     1085        RTSpinlockRelease((pInstance)->hSpinlock);
    10861086    }
    10871087}
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltRt-win.h

    r49137 r52618  
    55 */
    66/*
    7  * Copyright (C) 2011-2012 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    594594#endif
    595595    {
    596         RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock);
     596        RTSpinlockRelease((pNetFlt)->hSpinlock);
    597597        *pbNetFltActive = false;
    598598        return false;
     
    602602    {
    603603        vboxNetFltWinReferenceModePassThru(pNetFlt);
    604         RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock);
     604        RTSpinlockRelease((pNetFlt)->hSpinlock);
    605605        *pbNetFltActive = false;
    606606        return true;
     
    609609    vboxNetFltRetain((pNetFlt), true /* fBusy */);
    610610    vboxNetFltWinReferenceModeNetFlt(pNetFlt);
    611     RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock);
     611    RTSpinlockRelease((pNetFlt)->hSpinlock);
    612612
    613613    *pbNetFltActive = true;
     
    633633#endif
    634634    {
    635         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     635        RTSpinlockRelease(pNetFlt->hSpinlock);
    636636        *pbNetFltActive = false;
    637637        return false;
     
    642642        vboxNetFltWinIncReferenceModePassThru(pNetFlt, v);
    643643
    644         RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock);
     644        RTSpinlockRelease((pNetFlt)->hSpinlock);
    645645        *pbNetFltActive = false;
    646646        return true;
     
    651651    vboxNetFltWinIncReferenceModeNetFlt(pNetFlt, v);
    652652
    653     RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     653    RTSpinlockRelease(pNetFlt->hSpinlock);
    654654
    655655    /* we have marked it as busy, so can do the res references outside the lock */
     
    715715#endif
    716716    {
    717         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     717        RTSpinlockRelease(pNetFlt->hSpinlock);
    718718        return true;
    719719    }
    720720
    721     RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     721    RTSpinlockRelease(pNetFlt->hSpinlock);
    722722    return false;
    723723}
     
    732732#endif
    733733    {
    734         RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     734        RTSpinlockRelease(pNetFlt->hSpinlock);
    735735        return true;
    736736    }
    737737
    738     RTSpinlockReleaseNoInts(pNetFlt->hSpinlock);
     738    RTSpinlockRelease(pNetFlt->hSpinlock);
    739739    return false;
    740740}
  • trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c

    r44529 r52618  
    55
    66/*
    7  * Copyright (C) 2011-2012 Oracle Corporation
     7 * Copyright (C) 2011-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9090{
    9191#ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS
    92     RTSpinlockReleaseNoInts(pThis->hSpinlock);
     92    RTSpinlockRelease(pThis->hSpinlock);
    9393#else
    9494    RTSemFastMutexRelease(pThis->hFastMtx);
  • trunk/src/VBox/Runtime/generic/spinlock-generic.cpp

    r51571 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    225225RT_EXPORT_SYMBOL(RTSpinlockRelease);
    226226
    227 
    228 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    229 {
    230 #if 1
    231     if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))
    232         RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    233 #else
    234     AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);
    235 #endif
    236     RTSpinlockRelease(Spinlock);
    237 }
    238 RT_EXPORT_SYMBOL(RTSpinlockReleaseNoInts);
    239 
  • trunk/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp

    r44529 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2011 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    271271}
    272272
     273
     274RTDECL(bool) RTMpOnAllIsConcurrentSafe(void)
     275{
     276    return true;
     277}
     278
  • trunk/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp

    r48935 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    161161}
    162162
    163 
    164 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    165 {
    166 #if 1
    167     if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))
    168         RTAssertMsg2("RTSpinlockReleaseNoInts: %p (%s)\n", Spinlock, Spinlock->pszName);
    169 #else
    170     AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);
    171 #endif
    172     RTSpinlockRelease(Spinlock);
    173 }
    174 
  • trunk/src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c

    r49718 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2011 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    289289#endif /* < 7.0 */
    290290
     291
     292RTDECL(bool) RTMpOnAllIsConcurrentSafe(void)
     293{
     294    return true;
     295}
     296
  • trunk/src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c

    r42496 r52618  
    208208}
    209209
    210 
    211 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    212 {
    213 #if 1
    214     if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))
    215         RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    216 #else
    217     AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);
    218 #endif
    219     RTSpinlockRelease(Spinlock);
    220 }
    221 
  • trunk/src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c

    r43373 r52618  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    217217}
    218218
     219
     220RTDECL(bool) RTMpOnAllIsConcurrentSafe(void)
     221{
     222    return true;
     223}
     224
  • trunk/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c

    r43403 r52618  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    137137}
    138138
    139 
    140 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    141 {
    142     if (!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE))
    143         RTAssertMsg2("RTSpinlockReleaseNoInts: p=%p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    144     RTSpinlockRelease(Spinlock);
    145 }
    146 
  • trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c

    r52581 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2011 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    412412RT_EXPORT_SYMBOL(RTMpPokeCpu);
    413413
     414
     415RTDECL(bool) RTMpOnAllIsConcurrentSafe(void)
     416{
     417    return true;
     418}
     419RT_EXPORT_SYMBOL(RTMpOnAllIsConcurrentSafe);
     420
  • trunk/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c

    r50811 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    178178RT_EXPORT_SYMBOL(RTSpinlockRelease);
    179179
    180 
    181 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    182 {
    183 #if 1
    184     if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))
    185         RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    186 #else
    187     AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);
    188 #endif
    189     RTSpinlockRelease(Spinlock);
    190 }
    191 RT_EXPORT_SYMBOL(RTSpinlockReleaseNoInts);
    192 
  • trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c

    r44528 r52618  
    14411441
    14421442        if (pTimer->cCpus > 1)
    1443             RTSpinlockReleaseNoInts(pTimer->hSpinlock);
     1443            RTSpinlockRelease(pTimer->hSpinlock);
    14441444    }
    14451445
  • trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp

    r44529 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2011 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    416416    return (bRet == TRUE) ? VINF_SUCCESS : VERR_ACCESS_DENIED /* already queued */;
    417417}
     418
     419
     420RTDECL(bool) RTMpOnAllIsConcurrentSafe(void)
     421{
     422    return false;
     423}
     424
  • trunk/src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp

    r48935 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    196196}
    197197
    198 
    199 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    200 {
    201 #if 1
    202     if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))
    203         RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    204 #else
    205     AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);
    206 #endif
    207     RTSpinlockRelease(Spinlock);
    208 }
    209 
  • trunk/src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp

    r48935 r52618  
    128128}
    129129
    130 
    131 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    132 {
    133 #if 1
    134     if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))
    135         RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    136 #else
    137     AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);
    138 #endif
    139     RTSpinlockRelease(Spinlock);
    140 }
    141 
  • trunk/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp

    r48935 r52618  
    157157    g_pTimerHead = pTimer;
    158158    g_cTimers++;
    159     RTSpinlockReleaseNoInts(g_Spinlock);
     159    RTSpinlockRelease(g_Spinlock);
    160160
    161161    *ppTimer = pTimer;
     
    201201            if (RT_UNLIKELY(!pPrev))
    202202            {
    203                 RTSpinlockReleaseNoInts(g_Spinlock);
     203                RTSpinlockRelease(g_Spinlock);
    204204                return VERR_INVALID_HANDLE;
    205205            }
     
    216216            rtTimerOs2Dearm();
    217217    }
    218     RTSpinlockReleaseNoInts(g_Spinlock);
     218    RTSpinlockRelease(g_Spinlock);
    219219
    220220    /*
     
    246246        if (RT_FAILURE(rc))
    247247        {
    248             RTSpinlockReleaseNoInts(g_Spinlock);
     248            RTSpinlockRelease(g_Spinlock);
    249249            return rc;
    250250        }
     
    256256    pTimer->u64StartTS = u64First;
    257257    pTimer->u64NextTS = u64First;
    258     RTSpinlockReleaseNoInts(g_Spinlock);
     258    RTSpinlockRelease(g_Spinlock);
    259259
    260260    return VINF_SUCCESS;
     
    279279    if (!g_cActiveTimers)
    280280        rtTimerOs2Dearm();
    281     RTSpinlockReleaseNoInts(g_Spinlock);
     281    RTSpinlockRelease(g_Spinlock);
    282282
    283283    return VINF_SUCCESS;
     
    338338            PFNRTTIMER  pfnTimer = pTimer->pfnTimer;
    339339            void       *pvUser   = pTimer->pvUser;
    340             RTSpinlockReleaseNoInts(g_Spinlock);
     340            RTSpinlockRelease(g_Spinlock);
    341341            pfnTimer(pTimer, pvUser, pTimer->iTick);
    342342
     
    355355    }
    356356
    357     RTSpinlockReleaseNoInts(g_Spinlock);
     357    RTSpinlockRelease(g_Spinlock);
    358358}
    359359
  • trunk/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c

    r44529 r52618  
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    345345}
    346346
     347
     348RTDECL(bool) RTMpOnAllIsConcurrentSafe(void)
     349{
     350    return true;
     351}
     352
  • trunk/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c

    r44528 r52618  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    203203}
    204204
    205 
    206 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
    207 {
    208 #if 1
    209     if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))
    210         RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    211 #else
    212     AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);
    213 #endif
    214     RTSpinlockRelease(Spinlock);
    215 }
    216 
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r48395 r52618  
    55
    66/*
    7  * Copyright (C) 2007-2012 Oracle Corporation
     7 * Copyright (C) 2007-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    22072207                uHistMaxHz = pCpu->Ppt.aHzHistory[i];
    22082208        if (uHistMaxHz == pCpu->Ppt.uTimerHz)
    2209             RTSpinlockReleaseNoInts(pCpu->Ppt.hSpinlock);
     2209            RTSpinlockRelease(pCpu->Ppt.hSpinlock);
    22102210        else if (uHistMaxHz)
    22112211        {
     
    22242224            else
    22252225                pCpu->Ppt.cTicksHistoriziationInterval = 1;
    2226             RTSpinlockReleaseNoInts(pCpu->Ppt.hSpinlock);
     2226            RTSpinlockRelease(pCpu->Ppt.hSpinlock);
    22272227
    22282228            /*SUPR0Printf("Cpu%u: change to %u Hz / %u ns\n", pCpu->idxCpuSet, uHistMaxHz, cNsInterval);*/
     
    22372237            pCpu->Ppt.uTimerHz    = 0;
    22382238            pCpu->Ppt.cNsInterval = 0;
    2239             RTSpinlockReleaseNoInts(pCpu->Ppt.hSpinlock);
     2239            RTSpinlockRelease(pCpu->Ppt.hSpinlock);
    22402240
    22412241            /*SUPR0Printf("Cpu%u: stopping (%u Hz)\n", pCpu->idxCpuSet, uHistMaxHz);*/
     
    22442244    }
    22452245    else
    2246         RTSpinlockReleaseNoInts(pCpu->Ppt.hSpinlock);
     2246        RTSpinlockRelease(pCpu->Ppt.hSpinlock);
    22472247}
    22482248#endif /* GVMM_SCHED_WITH_PPT */
     
    23112311        }
    23122312
    2313         RTSpinlockReleaseNoInts(pCpu->Ppt.hSpinlock);
     2313        RTSpinlockRelease(pCpu->Ppt.hSpinlock);
    23142314
    23152315        if (cNsInterval)
     
    23232323                pCpu->Ppt.fStarted = false;
    23242324            pCpu->Ppt.fStarting = false;
    2325             RTSpinlockReleaseNoInts(pCpu->Ppt.hSpinlock);
     2325            RTSpinlockRelease(pCpu->Ppt.hSpinlock);
    23262326        }
    23272327    }
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