Changeset 52618 in vbox
- Timestamp:
- Sep 5, 2014 12:07:29 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 95899
- Location:
- trunk
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r52424 r52618 236 236 /** Current CPU Frequency. */ 237 237 volatile uint64_t u64CpuHz; 238 /** The TSC delta with reference to the master TSC. */ 239 volatile int64_t i64TSCDelta; 238 240 /** Number of errors during updating. 239 241 * Typical errors are under/overflows. */ … … 250 252 251 253 /** 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]; 253 261 254 262 /** @todo Add topology/NUMA info. */ … … 350 358 * Upper 16 bits is the major version. Major version is only changed with 351 359 * incompatible changes in the GIP. */ 352 #define SUPGLOBALINFOPAGE_VERSION 0x000 30000360 #define SUPGLOBALINFOPAGE_VERSION 0x00040000 353 361 354 362 /** -
trunk/include/VBox/sup.mac
r41155 r52618 5 5 6 6 ; 7 ; Copyright (C) 2006-201 2Oracle Corporation7 ; Copyright (C) 2006-2014 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 34 34 .u64TSC resq 1 35 35 .u64CpuHz resq 1 36 .i64TSCDelta resq 1 36 37 .cErrors resd 1 37 38 .iTSCHistoryHead resd 1 38 39 .au32TSCHistory resd 8 39 40 .u32PrevUpdateIntervalNS resd 1 40 .au32Reserved resd (5+5) 41 .au32Reserved0 resd (5) 42 .u64TSCSample resq 1 43 .au32Reserved1 resd (1) 41 44 .enmState resd 1 42 45 .idCpu resd 1 -
trunk/include/iprt/mangling.h
r52606 r52618 11 11 12 12 /* 13 * Copyright (C) 2011-201 3Oracle Corporation13 * Copyright (C) 2011-2014 Oracle Corporation 14 14 * 15 15 * This file is part of VirtualBox Open Source Edition (OSE), as … … 967 967 # define RTMpNotificationRegister RT_MANGLER(RTMpNotificationRegister) /* r0drv */ 968 968 # define RTMpOnAll RT_MANGLER(RTMpOnAll) /* r0drv */ 969 # define RTMpOnAllIsConcurrentSafe RT_MANGLER(RTMpOnAllIsConcurrentSafe) /* r0drv */ 969 970 # define RTMpOnOthers RT_MANGLER(RTMpOnOthers) /* r0drv */ 970 971 # define RTMpOnSpecific RT_MANGLER(RTMpOnSpecific) /* r0drv */ … … 1398 1399 # define RTSpinlockDestroy RT_MANGLER(RTSpinlockDestroy) 1399 1400 # define RTSpinlockRelease RT_MANGLER(RTSpinlockRelease) 1400 # define RTSpinlockReleaseNoInts RT_MANGLER(RTSpinlockReleaseNoInts)1401 1401 # define RTStrAAppendExNVTag RT_MANGLER(RTStrAAppendExNVTag) 1402 1402 # define RTStrAAppendNTag RT_MANGLER(RTStrAAppendNTag) -
trunk/include/iprt/mp.h
r50641 r52618 4 4 5 5 /* 6 * Copyright (C) 2008-201 0Oracle Corporation6 * Copyright (C) 2008-2014 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 247 247 248 248 /** 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 */ 258 RTDECL(bool) RTMpOnAllIsConcurrentSafe(void); 259 260 /** 249 261 * Executes a function on each (online) CPU in the system. 250 262 * -
trunk/include/iprt/spinlock.h
r45181 r52618 4 4 5 5 /* 6 * Copyright (C) 2006-201 2Oracle Corporation6 * Copyright (C) 2006-2014 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 84 84 RTDECL(void) RTSpinlockRelease(RTSPINLOCK Spinlock); 85 85 86 /* Temporarily, only for checking the spinlock creation flags. */87 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock);88 89 86 90 87 /** @} */ -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp
r51490 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 399 399 rc = VERR_GENERAL_FAILURE; 400 400 401 RTSpinlockRelease NoInts(g_Spinlock);401 RTSpinlockRelease(g_Spinlock); 402 402 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 403 403 kauth_cred_unref(&pCred); … … 456 456 while (pSession && pSession->Process != Process && (/*later: pSession->fUnrestricted != fUnrestricted ||*/ !pSession->fOpened)) 457 457 pSession = pSession->pNextHash; 458 RTSpinlockRelease NoInts(g_Spinlock);458 RTSpinlockRelease(g_Spinlock); 459 459 if (!pSession) 460 460 { -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c
r49529 r52618 5 5 6 6 /* 7 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 319 319 g_VBoxGuest->_RTSpinlockRelease(Spinlock); 320 320 } 321 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)322 {323 g_VBoxGuest->_RTSpinlockReleaseNoInts(Spinlock);324 }325 321 RTDECL(void*) RTMemTmpAllocTag(size_t cb, const char *pszTag) 326 322 { -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
r43411 r52618 5 5 6 6 /* 7 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 174 174 RTSpinlockAcquire, 175 175 RTSpinlockRelease, 176 RTSpinlockReleaseNoInts,177 176 RTMemTmpAllocTag, 178 177 RTMemTmpFree, -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h
r43411 r52618 5 5 6 6 /* 7 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 177 177 void (*_RTSpinlockAcquire)(RTSPINLOCK Spinlock); 178 178 void (*_RTSpinlockRelease)(RTSPINLOCK Spinlock); 179 void (*_RTSpinlockReleaseNoInts)(RTSPINLOCK Spinlock);180 179 void* (*_RTMemTmpAllocTag)(size_t cb, const char *pszTag); 181 180 void (*_RTMemTmpFree)(void *pv); -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
r48665 r52618 5 5 6 6 /* 7 * Copyright (C) 2007-201 3Oracle Corporation7 * Copyright (C) 2007-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 373 373 pSession->pNextHash = g_apSessionHashTab[iHash]; 374 374 g_apSessionHashTab[iHash] = pSession; 375 RTSpinlockRelease NoInts(g_Spinlock);375 RTSpinlockRelease(g_Spinlock); 376 376 } 377 377 … … 422 422 } 423 423 } 424 RTSpinlockRelease NoInts(g_Spinlock);424 RTSpinlockRelease(g_Spinlock); 425 425 if (!pSession) 426 426 { … … 455 455 || pSession->Process != Process)); 456 456 } 457 RTSpinlockRelease NoInts(g_Spinlock);457 RTSpinlockRelease(g_Spinlock); 458 458 if (RT_UNLIKELY(!pSession)) 459 459 { … … 546 546 || pSession->Process != Process)); 547 547 } 548 RTSpinlockRelease NoInts(g_Spinlock);548 RTSpinlockRelease(g_Spinlock); 549 549 if (!pSession) 550 550 { -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r51224 r52618 117 117 } 118 118 119 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);119 RTSpinlockRelease(pDevExt->EventSpinlock); 120 120 121 121 if (pu32OtherVal) … … 287 287 vboxGuestSetMouseStatus(pStatusReq, fMouseStatus); 288 288 } 289 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);289 RTSpinlockRelease(pDevExt->SessionSpinlock); 290 290 if (pFilterReq) 291 291 VbglGRFree(&pFilterReq->header); … … 1181 1181 RTSpinlockAcquire(pDevExt->SessionSpinlock); 1182 1182 RTListAppend(&pDevExt->SessionList, &pSession->ListNode); 1183 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);1183 RTSpinlockRelease(pDevExt->SessionSpinlock); 1184 1184 1185 1185 *ppSession = pSession; … … 1214 1214 RTSpinlockAcquire(pDevExt->SessionSpinlock); 1215 1215 RTListAppend(&pDevExt->SessionList, &pSession->ListNode); 1216 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);1216 RTSpinlockRelease(pDevExt->SessionSpinlock); 1217 1217 1218 1218 *ppSession = pSession; … … 1238 1238 RTSpinlockAcquire(pDevExt->SessionSpinlock); 1239 1239 RTListNodeRemove(&pSession->ListNode); 1240 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);1240 RTSpinlockRelease(pDevExt->SessionSpinlock); 1241 1241 VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, 0, UINT32_MAX, VBOXGUESTCAPSACQUIRE_FLAGS_NONE); 1242 1242 … … 1291 1291 RTListNodeRemove(&pWait->ListNode); 1292 1292 1293 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1293 RTSpinlockRelease(pDevExt->EventSpinlock); 1294 1294 } 1295 1295 if (!pWait) … … 1376 1376 RTSpinlockAcquire(pDevExt->EventSpinlock); 1377 1377 VBoxGuestWaitFreeLocked(pDevExt, pWait); 1378 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1378 RTSpinlockRelease(pDevExt->EventSpinlock); 1379 1379 } 1380 1380 … … 1401 1401 break; 1402 1402 pWait->fPendingWakeUp = true; 1403 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1403 RTSpinlockRelease(pDevExt->EventSpinlock); 1404 1404 1405 1405 rc = RTSemEventMultiSignal(pWait->Event); … … 1419 1419 } 1420 1420 } 1421 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1421 RTSpinlockRelease(pDevExt->EventSpinlock); 1422 1422 } 1423 1423 } … … 1512 1512 RTSpinlockAcquire(pDevExt->EventSpinlock); 1513 1513 pDevExt->MouseNotifyCallback = *pNotify; 1514 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1514 RTSpinlockRelease(pDevExt->EventSpinlock); 1515 1515 return VINF_SUCCESS; 1516 1516 } … … 1531 1531 if (fMatches || pSession->fPendingCancelWaitEvents) 1532 1532 { 1533 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1533 RTSpinlockRelease(pDevExt->EventSpinlock); 1534 1534 1535 1535 pInfo->u32EventFlagsOut = fMatches; … … 1543 1543 } 1544 1544 1545 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1545 RTSpinlockRelease(pDevExt->EventSpinlock); 1546 1546 return VERR_TIMEOUT; 1547 1547 } … … 1627 1627 fResEvents = pWait->fResEvents; 1628 1628 VBoxGuestWaitFreeLocked(pDevExt, pWait); 1629 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1629 RTSpinlockRelease(pDevExt->EventSpinlock); 1630 1630 1631 1631 /* … … 1706 1706 if (!fCancelledOne) 1707 1707 pSession->fPendingCancelWaitEvents = true; 1708 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);1708 RTSpinlockRelease(pDevExt->EventSpinlock); 1709 1709 Assert(rc == 0); 1710 1710 NOREF(rc); … … 1987 1987 pSession->fFilterMask |= pInfo->u32OrMask; 1988 1988 pSession->fFilterMask &= ~pInfo->u32NotMask; 1989 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);1989 RTSpinlockRelease(pDevExt->SessionSpinlock); 1990 1990 rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_FilterMask); 1991 1991 return rc; … … 2005 2005 pSession->fCapabilities |= pInfo->u32OrMask; 2006 2006 pSession->fCapabilities &= ~pInfo->u32NotMask; 2007 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);2007 RTSpinlockRelease(pDevExt->SessionSpinlock); 2008 2008 rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_Capabilities); 2009 2009 return rc; … … 2034 2034 RTSpinlockAcquire(pDevExt->SessionSpinlock); 2035 2035 pSession->fMouseStatus = fFeatures; 2036 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);2036 RTSpinlockRelease(pDevExt->SessionSpinlock); 2037 2037 rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_MouseStatus); 2038 2038 return rc; … … 2062 2062 if ((pHdr->fu32Flags & VBOX_HGCM_REQ_DONE) != 0) 2063 2063 { 2064 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);2064 RTSpinlockRelease(pDevExt->EventSpinlock); 2065 2065 return VINF_SUCCESS; 2066 2066 } 2067 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);2067 RTSpinlockRelease(pDevExt->EventSpinlock); 2068 2068 2069 2069 pWait = VBoxGuestWaitAlloc(pDevExt, NULL); … … 2087 2087 { 2088 2088 VBoxGuestWaitFreeLocked(pDevExt, pWait); 2089 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);2089 RTSpinlockRelease(pDevExt->EventSpinlock); 2090 2090 return VINF_SUCCESS; 2091 2091 } 2092 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);2092 RTSpinlockRelease(pDevExt->EventSpinlock); 2093 2093 2094 2094 if (fInterruptible) … … 2180 2180 break; 2181 2181 } 2182 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);2182 RTSpinlockRelease(pDevExt->SessionSpinlock); 2183 2183 if (i >= RT_ELEMENTS(pSession->aHGCMClientIds)) 2184 2184 { … … 2218 2218 break; 2219 2219 } 2220 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);2220 RTSpinlockRelease(pDevExt->SessionSpinlock); 2221 2221 if (i >= RT_ELEMENTS(pSession->aHGCMClientIds)) 2222 2222 { … … 2245 2245 if (pSession->aHGCMClientIds[i] == UINT32_MAX) 2246 2246 pSession->aHGCMClientIds[i] = RT_SUCCESS(rc) && RT_SUCCESS(pInfo->result) ? 0 : u32ClientId; 2247 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);2247 RTSpinlockRelease(pDevExt->SessionSpinlock); 2248 2248 2249 2249 return rc; … … 2293 2293 if (pSession->aHGCMClientIds[i] == u32ClientId) 2294 2294 break; 2295 RTSpinlockRelease NoInts(pDevExt->SessionSpinlock);2295 RTSpinlockRelease(pDevExt->SessionSpinlock); 2296 2296 if (RT_UNLIKELY(i >= RT_ELEMENTS(pSession->aHGCMClientIds))) 2297 2297 { … … 2579 2579 ASMAtomicWriteU32(&pDevExt->f32PendingEvents, fEvents); 2580 2580 2581 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);2581 RTSpinlockRelease(pDevExt->EventSpinlock); 2582 2582 2583 2583 #ifdef VBOXGUEST_USE_DEFERRED_WAKE_UP … … 2655 2655 } 2656 2656 2657 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);2657 RTSpinlockRelease(pDevExt->EventSpinlock); 2658 2658 2659 2659 if (fOtherConflictingCaps) … … 3073 3073 #endif 3074 3074 3075 RTSpinlockRelease NoInts(pDevExt->EventSpinlock);3075 RTSpinlockRelease(pDevExt->EventSpinlock); 3076 3076 3077 3077 #if defined(VBOXGUEST_USE_DEFERRED_WAKE_UP) && !defined(RT_OS_DARWIN) && !defined(RT_OS_WINDOWS) -
trunk/src/VBox/Devices/Bus/SrvPciRawR0.cpp
r44529 r52618 5 5 6 6 /* 7 * Copyright (C) 2011-201 2Oracle Corporation7 * Copyright (C) 2011-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 115 115 RTSpinlockAcquire(pThis->hSpinlock); 116 116 pThis->iPendingIrq = iHostIrq; 117 RTSpinlockRelease NoInts(pThis->hSpinlock);117 RTSpinlockRelease(pThis->hSpinlock); 118 118 119 119 /** … … 872 872 pDev->iPendingIrq = 0; 873 873 fTerminate = pDev->fTerminate; 874 RTSpinlockRelease NoInts(pDev->hSpinlock);874 RTSpinlockRelease(pDev->hSpinlock); 875 875 876 876 /* Block until new IRQs arrives */ … … 888 888 iPendingIrq = pDev->iPendingIrq; 889 889 pDev->iPendingIrq = 0; 890 RTSpinlockRelease NoInts(pDev->hSpinlock);890 RTSpinlockRelease(pDev->hSpinlock); 891 891 } 892 892 else -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r52592 r52618 4 4 * 5 5 * @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. 7 7 * All changes shall be reviewed by bird before commit. If not around, 8 8 * email and let Frank and/or Klaus OK the changes before committing. … … 1182 1182 } 1183 1183 1184 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1184 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1185 1185 } 1186 1186 … … 1215 1215 } 1216 1216 1217 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1217 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1218 1218 } 1219 1219 … … 1242 1242 { 1243 1243 intnetR0BusyIncIf(pIf); 1244 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1244 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1245 1245 return pIf; 1246 1246 } 1247 1247 } 1248 1248 1249 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1249 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1250 1250 return NULL; 1251 1251 } … … 1272 1272 { 1273 1273 /* This shouldn't happen*/ 1274 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1274 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1275 1275 return; 1276 1276 } … … 1313 1313 Assert(pCache->cEntries <= pCache->cEntriesAlloc); 1314 1314 1315 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1315 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1316 1316 } 1317 1317 … … 1570 1570 } 1571 1571 1572 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1572 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1573 1573 return pDstTab->cIfs 1574 1574 ? (!pDstTab->fTrunkDst ? INTNETSWDECISION_INTNET : INTNETSWDECISION_BROADCAST) … … 1631 1631 } 1632 1632 1633 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1633 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1634 1634 return enmSwDecision; 1635 1635 } … … 1744 1744 } 1745 1745 1746 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1746 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1747 1747 return pDstTab->cIfs 1748 1748 ? (!pDstTab->fTrunkDst ? INTNETSWDECISION_INTNET : INTNETSWDECISION_BROADCAST) … … 1806 1806 } 1807 1807 1808 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1808 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1809 1809 return INTNETSWDECISION_BROADCAST; 1810 1810 } … … 1867 1867 } 1868 1868 1869 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1869 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1870 1870 return !pDstTab->cIfs 1871 1871 ? (!pDstTab->fTrunkDst ? INTNETSWDECISION_DROP : INTNETSWDECISION_TRUNK) … … 1909 1909 } 1910 1910 1911 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);1911 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1912 1912 return pDstTab->fTrunkDst ? INTNETSWDECISION_TRUNK : INTNETSWDECISION_DROP; 1913 1913 } … … 2003 2003 if (pvOld) 2004 2004 *ppDstTab = pNew; 2005 RTSpinlockRelease NoInts(pTrunk->hDstTabSpinlock);2005 RTSpinlockRelease(pTrunk->hDstTabSpinlock); 2006 2006 if (pvOld) 2007 2007 { … … 2037 2037 pTab->cEntriesAllocated = cAllocated; 2038 2038 2039 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);2039 RTSpinlockRelease(pNetwork->hAddrSpinlock); 2040 2040 2041 2041 RTMemFree(paOld); … … 2150 2150 } 2151 2151 2152 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);2152 RTSpinlockRelease(pNetwork->hAddrSpinlock); 2153 2153 2154 2154 if (pMatchingIf) … … 2183 2183 } 2184 2184 2185 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);2185 RTSpinlockRelease(pNetwork->hAddrSpinlock); 2186 2186 break; 2187 2187 } … … 2646 2646 RTSpinlockAcquire(pIf->hRecvInSpinlock); 2647 2647 int rc = intnetR0RingWriteFrame(&pIf->pIntBuf->Recv, pSG, pNewDstMac); 2648 RTSpinlockRelease NoInts(pIf->hRecvInSpinlock);2648 RTSpinlockRelease(pIf->hRecvInSpinlock); 2649 2649 if (RT_SUCCESS(rc)) 2650 2650 { … … 2673 2673 RTSpinlockAcquire(pIf->hRecvInSpinlock); 2674 2674 rc = intnetR0RingWriteFrame(&pIf->pIntBuf->Recv, pSG, pNewDstMac); 2675 RTSpinlockRelease NoInts(pIf->hRecvInSpinlock);2675 RTSpinlockRelease(pIf->hRecvInSpinlock); 2676 2676 if (RT_SUCCESS(rc)) 2677 2677 { … … 3223 3223 else 3224 3224 memset(&MacAddrTrunk, 0, sizeof(MacAddrTrunk)); 3225 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);3225 RTSpinlockRelease(pNetwork->hAddrSpinlock); 3226 3226 if ( ar_oper == RTNET_ARPOP_REPLY 3227 3227 && !memcmp(&pArpIPv4->ar_tha, &MacAddrTrunk, sizeof(RTMAC))) … … 3441 3441 && (!pNetwork->MacTab.fWireActive || (pTrunk->fNoPreemptDsts & INTNETTRUNKDIR_WIRE) ) ); 3442 3442 3443 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);3443 RTSpinlockRelease(pNetwork->hAddrSpinlock); 3444 3444 3445 3445 return fRc; … … 3783 3783 pIfSender->MacAddr = EthHdr.SrcMac; 3784 3784 3785 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);3785 RTSpinlockRelease(pNetwork->hAddrSpinlock); 3786 3786 } 3787 3787 … … 4154 4154 } 4155 4155 4156 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);4156 RTSpinlockRelease(pNetwork->hAddrSpinlock); 4157 4157 } 4158 4158 else … … 4238 4238 } 4239 4239 4240 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);4240 RTSpinlockRelease(pNetwork->hAddrSpinlock); 4241 4241 4242 4242 if (pTrunk) … … 4337 4337 } 4338 4338 4339 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);4339 RTSpinlockRelease(pNetwork->hAddrSpinlock); 4340 4340 4341 4341 /* … … 4742 4742 PINTNETTRUNKIF pTrunk = pNetwork->MacTab.pTrunk; 4743 4743 4744 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);4744 RTSpinlockRelease(pNetwork->hAddrSpinlock); 4745 4745 4746 4746 /* Notify the trunk about the interface being destroyed. */ … … 4754 4754 RTSpinlockAcquire(pNetwork->hAddrSpinlock); 4755 4755 pIf->pNetwork = NULL; 4756 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);4756 RTSpinlockRelease(pNetwork->hAddrSpinlock); 4757 4757 4758 4758 SUPR0ObjRelease(pNetwork->pvObj, pIf->pSession); … … 4968 4968 intnetR0BusyIncTrunk(pTrunk); 4969 4969 4970 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);4970 RTSpinlockRelease(pNetwork->hAddrSpinlock); 4971 4971 4972 4972 if (pTrunk) … … 5041 5041 pThis->MacAddr = *pMacAddr; 5042 5042 5043 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);5043 RTSpinlockRelease(pNetwork->hAddrSpinlock); 5044 5044 } 5045 5045 else … … 5069 5069 && (pNetwork->fFlags & INTNET_OPEN_FLAGS_PROMISC_ALLOW_TRUNK_HOST); 5070 5070 5071 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);5071 RTSpinlockRelease(pNetwork->hAddrSpinlock); 5072 5072 } 5073 5073 intnetR0BusyDecTrunk(pThis); … … 5148 5148 RTSpinlockAcquire(pNetwork->hAddrSpinlock); 5149 5149 pNetwork->MacTab.pTrunk = NULL; 5150 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);5150 RTSpinlockRelease(pNetwork->hAddrSpinlock); 5151 5151 5152 5152 intnetR0TrunkIfDestroy(pThis, pNetwork); … … 5252 5252 } 5253 5253 } 5254 RTSpinlockRelease NoInts(pThis->hDstTabSpinlock);5254 RTSpinlockRelease(pThis->hDstTabSpinlock); 5255 5255 Assert(!pDstTab || iDstTab < pThis->cIntDstTabs); 5256 5256 } … … 5265 5265 { 5266 5266 pThis->apIntDstTabs[iDstTab] = NULL; 5267 RTSpinlockRelease NoInts(pThis->hDstTabSpinlock);5267 RTSpinlockRelease(pThis->hDstTabSpinlock); 5268 5268 Assert(iDstTab < RT_ELEMENTS(pThis->apTaskDstTabs)); 5269 5269 } 5270 5270 else 5271 5271 { 5272 RTSpinlockRelease NoInts(pThis->hDstTabSpinlock);5272 RTSpinlockRelease(pThis->hDstTabSpinlock); 5273 5273 intnetR0AllocDstTab(pNetwork->MacTab.cEntriesAllocated, &pDstTab); 5274 5274 iDstTab = 65535; … … 5309 5309 } 5310 5310 } 5311 RTSpinlockRelease NoInts(pThis->hDstTabSpinlock);5311 RTSpinlockRelease(pThis->hDstTabSpinlock); 5312 5312 Assert(iDstTab < RT_MAX(RT_ELEMENTS(pThis->apTaskDstTabs), pThis->cIntDstTabs)); 5313 5313 } … … 5663 5663 pNetwork->MacTab.fWireActive = false; 5664 5664 5665 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);5665 RTSpinlockRelease(pNetwork->hAddrSpinlock); 5666 5666 5667 5667 /* Wait for all the interfaces to quiesce. (Interfaces cannot be … … 5699 5699 pNetwork->MacTab.pTrunk = NULL; 5700 5700 5701 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);5701 RTSpinlockRelease(pNetwork->hAddrSpinlock); 5702 5702 5703 5703 if (pTrunk) … … 5891 5891 } 5892 5892 5893 RTSpinlockRelease NoInts(pNetwork->hAddrSpinlock);5893 RTSpinlockRelease(pNetwork->hAddrSpinlock); 5894 5894 } 5895 5895 -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r52575 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 93 93 * u32UpdateIntervalNS GIP members. The value must be a power of 2. */ 94 94 #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 121 AssertCompile(GIP_TSC_DELTA_PRIMER_LOOPS < GIP_TSC_DELTA_READ_TIME_LOOPS); 122 AssertCompile(GIP_TSC_DELTA_PRIMER_LOOPS + GIP_TSC_DELTA_READ_TIME_LOOPS < GIP_TSC_DELTA_LOOPS); 95 123 96 124 /** @def VBOX_SVN_REV … … 139 167 RTCPUID idCpu, uint8_t idApic, uint64_t iTick); 140 168 static void supdrvGipInitCpu(PSUPGLOBALINFOPAGE pGip, PSUPGIPCPU pCpu, uint64_t u64NanoTS); 169 static int supdrvMeasureTscDeltas(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip, uint32_t *pidxMaster); 141 170 static int supdrvIOCtl_ResumeSuspendedKbds(void); 142 171 … … 146 175 *******************************************************************************/ 147 176 DECLEXPORT(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPage = NULL; 177 178 /** 179 * The TSC delta synchronization struct. rounded to cache line size. 180 */ 181 typedef 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; 188 AssertCompileSize(SUPTSCDELTASYNC, 64); 189 typedef SUPTSCDELTASYNC *PSUPTSCDELTASYNC; 190 191 /** Pointer to the TSC delta sync. struct. */ 192 static void *g_pvTscDeltaSync; 193 /** Aligned pointer to the TSC delta sync. struct. */ 194 static PSUPTSCDELTASYNC g_pTscDeltaSync; 195 /** The TSC delta measurement initiator Cpu Id. */ 196 static volatile RTCPUID g_idTscDeltaInitiator = NIL_RTCPUID; 197 /** Number of online/offline events, incremented each time a CPU goes online 198 * or offline. */ 199 static volatile uint32_t g_cMpOnOffEvents; 148 200 149 201 /** … … 354 406 { "RTSpinlockDestroy", (void *)RTSpinlockDestroy }, 355 407 { "RTSpinlockRelease", (void *)RTSpinlockRelease }, 356 { "RTSpinlockReleaseNoInts", (void *)RTSpinlockReleaseNoInts },357 408 { "RTStrCopy", (void *)RTStrCopy }, 358 409 { "RTStrDupTag", (void *)RTStrDupTag }, … … 3957 4008 if (pGipR0->aCPUs[0].u32TransactionId != 2 /* not the first time */) 3958 4009 { 3959 for (i = 0; i < RT_ELEMENTS(pGipR0->aCPUs); i++)4010 for (i = 0; i < pGipR0->cCpus; i++) 3960 4011 ASMAtomicUoWriteU32(&pGipR0->aCPUs[i].u32TransactionId, 3961 4012 (pGipR0->aCPUs[i].u32TransactionId + GIP_UPDATEHZ_RECALC_FREQ * 2) … … 5581 5632 supdrvGipInit(pDevExt, pGip, HCPhysGip, RTTimeSystemNanoTS(), 1000000000 / u32Interval /*=Hz*/, cCpus); 5582 5633 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); 5598 5635 if (RT_SUCCESS(rc)) 5599 5636 { 5600 rc = RTMp NotificationRegister(supdrvGipMpEvent, pDevExt);5637 rc = RTMpOnAll(supdrvGipInitOnCpu, pDevExt, pGip); 5601 5638 if (RT_SUCCESS(rc)) 5602 5639 { 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 5604 5658 if (RT_SUCCESS(rc)) 5605 5659 { 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 5606 5667 /* 5607 * We're good. 5668 * Create the timer. 5669 * If CPU_ALL isn't supported we'll have to fall back to synchronous mode. 5608 5670 */ 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 5614 5701 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); 5620 5704 } 5621 5705 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 5626 5708 supdrvGipDestroy(pDevExt); 5627 5709 return rc; … … 5811 5893 ASMAtomicWriteU16(&pGip->aiCpuFromCpuSetIdx[iCpuSet], i); 5812 5894 5895 /* Update the Mp online/offline counter. */ 5896 ASMAtomicIncU32(&g_cMpOnOffEvents); 5897 5813 5898 /* commit it */ 5814 5899 ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_ONLINE); 5815 5900 5816 RTSpinlockRelease NoInts(pDevExt->hGipSpinlock);5901 RTSpinlockRelease(pDevExt->hGipSpinlock); 5817 5902 } 5818 5903 … … 5846 5931 RTCpuSetDelByIndex(&pGip->OnlineCpuSet, iCpuSet); 5847 5932 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 5848 5943 /* commit it */ 5849 5944 ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_OFFLINE); 5850 5945 5851 RTSpinlockRelease NoInts(pDevExt->hGipSpinlock);5946 RTSpinlockRelease(pDevExt->hGipSpinlock); 5852 5947 } 5853 5948 … … 5929 6024 5930 6025 /** 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 */ 6048 static 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 */ 6216 DECLINLINE(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 */ 6244 static 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 /** 5931 6322 * Callback used by supdrvDetermineAsyncTSC to read the TSC on a CPU. 5932 6323 * … … 5937 6328 static DECLCALLBACK(void) supdrvDetermineAsyncTscWorker(RTCPUID idCpu, void *pvUser1, void *pvUser2) 5938 6329 { 5939 #if 15940 6330 ASMAtomicWriteU64((uint64_t volatile *)pvUser1, ASMReadTSC()); 5941 #else5942 *(uint64_t *)pvUser1 = ASMReadTSC();5943 #endif5944 6331 } 5945 6332 … … 6092 6479 pCpu->u64NanoTS = u64NanoTS; 6093 6480 pCpu->u64TSC = ASMReadTSC(); 6481 pCpu->u64TSCSample = GIP_TSC_DELTA_RSVD; 6482 pCpu->i64TSCDelta = INT64_MAX; 6094 6483 6095 6484 ASMAtomicWriteSize(&pCpu->enmState, SUPGIPCPUSTATE_INVALID); … … 6171 6560 pDevExt->HCPhysGip = HCPhys; 6172 6561 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); 6173 6569 } 6174 6570 … … 6198 6594 unsigned i; 6199 6595 pGip->u32Magic = 0; 6200 for (i = 0; i < RT_ELEMENTS(pGip->aCPUs); i++)6596 for (i = 0; i < pGip->cCpus; i++) 6201 6597 { 6202 6598 pGip->aCPUs[i].u64NanoTS = 0; 6203 6599 pGip->aCPUs[i].u64TSC = 0; 6204 6600 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; 6205 6610 } 6206 6611 } -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r51907 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 200 200 * 201 201 * @todo Pending work on next major version change: 202 * - Remove RTSpinlockReleaseNoInts.203 */ 204 #define SUPDRV_IOC_VERSION 0x001 a0007202 * - (none). 203 */ 204 #define SUPDRV_IOC_VERSION 0x001b0000 205 205 206 206 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r51978 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 474 474 { "RTSpinlockRelease", 0xefef0031 }, 475 475 { "RTSpinlockAcquireNoInts", 0xefef0032 }, 476 { "RTSpinlockReleaseNoInts", 0xefef0033 },477 476 { "RTTimeNanoTS", 0xefef0034 }, 478 477 { "RTTimeMillieTS", 0xefef0035 }, -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r52576 r52618 505 505 rc = VERR_GENERAL_FAILURE; 506 506 507 RTSpinlockRelease NoInts(g_Spinlock);507 RTSpinlockRelease(g_Spinlock); 508 508 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 509 509 kauth_cred_unref(&pCred); … … 571 571 supdrvSessionRetain(pSession); 572 572 573 RTSpinlockRelease NoInts(g_Spinlock);573 RTSpinlockRelease(g_Spinlock); 574 574 if (RT_UNLIKELY(!pSession)) 575 575 { … … 1478 1478 rc = VERR_ALREADY_LOADED; 1479 1479 1480 RTSpinlockRelease NoInts(g_Spinlock);1480 RTSpinlockRelease(g_Spinlock); 1481 1481 if (RT_SUCCESS(rc)) 1482 1482 { … … 1541 1541 } 1542 1542 } 1543 RTSpinlockRelease NoInts(g_Spinlock);1543 RTSpinlockRelease(g_Spinlock); 1544 1544 if (!pSession) 1545 1545 { -
trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
r52575 r52618 163 163 pSession->pNextHash = g_apSessionHashTab[iHash]; 164 164 g_apSessionHashTab[iHash] = pSession; 165 RTSpinlockRelease NoInts(g_Spinlock);165 RTSpinlockRelease(g_Spinlock); 166 166 } 167 167 … … 212 212 } 213 213 } 214 RTSpinlockRelease NoInts(g_Spinlock);214 RTSpinlockRelease(g_Spinlock); 215 215 if (!pSession) 216 216 { … … 248 248 supdrvSessionRetain(pSession); 249 249 } 250 RTSpinlockRelease NoInts(g_Spinlock);250 RTSpinlockRelease(g_Spinlock); 251 251 if (RT_UNLIKELY(!pSession)) 252 252 { … … 285 285 supdrvSessionRetain(pSession); 286 286 } 287 RTSpinlockRelease NoInts(g_Spinlock);287 RTSpinlockRelease(g_Spinlock); 288 288 if (!pSession) 289 289 { -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r52575 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 543 543 pSession->pNextHash = g_apSessionHashTab[iHash]; 544 544 g_apSessionHashTab[iHash] = pSession; 545 RTSpinlockRelease NoInts(g_Spinlock);545 RTSpinlockRelease(g_Spinlock); 546 546 LogFlow(("VBoxDrvSolarisOpen success\n")); 547 547 } … … 631 631 } 632 632 } 633 RTSpinlockRelease NoInts(g_Spinlock);633 RTSpinlockRelease(g_Spinlock); 634 634 if (!pSession) 635 635 { … … 705 705 while (pSession && pSession->Process != Process && pSession->fUnrestricted == fUnrestricted); 706 706 pSession = pSession->pNextHash; 707 RTSpinlockRelease NoInts(g_Spinlock);707 RTSpinlockRelease(g_Spinlock); 708 708 if (!pSession) 709 709 { -
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r45399 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 108 108 g_pSUPGlobalInfoPage->u32Version); 109 109 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"); 112 112 static SUPGIPCPU s_aaCPUs[2][256]; 113 113 for (uint32_t i = 0; i < cIterations; i++) … … 126 126 PSUPGIPCPU pCpu = &s_aaCPUs[i & 1][iCpu]; 127 127 RTPrintf(fHex 128 ? "tstGIP-2: %4d/%d: %016llx %09llx %016llx %08x %d %08x %15llu %0 8x %08x %08x %08x %08x %08x %08x %08x (%d)\n"129 : "tstGIP-2: %4d/%d: %016llu %09llu %016llu %010u %d %010u %15llu %0 8x %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", 130 130 i, iCpu, 131 131 pCpu->u64NanoTS, … … 136 136 pCpu->u32TransactionId, 137 137 pCpu->u64CpuHz, 138 pCpu->i64TSCDelta, 138 139 pCpu->au32TSCHistory[0], 139 140 pCpu->au32TSCHistory[1], … … 159 160 /* nop */; 160 161 } 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); 161 167 } 162 168 else -
trunk/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c
r44528 r52618 5 5 6 6 /* 7 * Copyright (C) 2008-201 2Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 109 109 RTSpinlockAcquire(pThis->hSpinlock); 110 110 vboxNetAdpSetState(pThis, enmNewState); 111 RTSpinlockRelease NoInts(pThis->hSpinlock);111 RTSpinlockRelease(pThis->hSpinlock); 112 112 } 113 113 … … 126 126 RTSpinlockAcquire(pThis->hSpinlock); 127 127 enmState = vboxNetAdpGetState(pThis); 128 RTSpinlockRelease NoInts(pThis->hSpinlock);128 RTSpinlockRelease(pThis->hSpinlock); 129 129 Log(("vboxNetAdpGetStateWithLock: pThis=%p, state=%d.\n", pThis, enmState)); 130 130 return enmState; … … 152 152 else 153 153 fRc = false; 154 RTSpinlockRelease NoInts(pThis->hSpinlock);154 RTSpinlockRelease(pThis->hSpinlock); 155 155 156 156 if (fRc) … … 180 180 && !strcmp(pThis->szName, pszName)) 181 181 { 182 RTSpinlockRelease NoInts(pThis->hSpinlock);182 RTSpinlockRelease(pThis->hSpinlock); 183 183 return pThis; 184 184 } 185 RTSpinlockRelease NoInts(pThis->hSpinlock);185 RTSpinlockRelease(pThis->hSpinlock); 186 186 } 187 187 return NULL; … … 349 349 vboxNetAdpBusy(pThis); 350 350 } 351 RTSpinlockRelease NoInts(pThis->hSpinlock);351 RTSpinlockRelease(pThis->hSpinlock); 352 352 Log(("vboxNetAdpPrepareToReceive: fCanReceive=%d.\n", fCanReceive)); 353 353 … … 413 413 if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Active) 414 414 { 415 RTSpinlockRelease NoInts(pThis->hSpinlock);415 RTSpinlockRelease(pThis->hSpinlock); 416 416 Log(("vboxNetAdpReceive: Dropping incoming packet for inactive interface %s.\n", 417 417 pThis->szName)); … … 420 420 vboxNetAdpRetain(pThis); 421 421 vboxNetAdpBusy(pThis); 422 RTSpinlockRelease NoInts(pThis->hSpinlock);422 RTSpinlockRelease(pThis->hSpinlock); 423 423 424 424 rc = vboxNetAdpPortOsXmit(pThis, pSG, fDst); … … 515 515 } 516 516 517 RTSpinlockRelease NoInts(pThis->hSpinlock);517 RTSpinlockRelease(pThis->hSpinlock); 518 518 Log(("vboxNetAdpPortSetActive: state after: %RTbool.\n", vboxNetAdpGetState(pThis))); 519 519 return fPreviouslyActive; … … 546 546 Assert(!pThis->cBusy); 547 547 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); 548 RTSpinlockRelease NoInts(pThis->hSpinlock);548 RTSpinlockRelease(pThis->hSpinlock); 549 549 550 550 vboxNetAdpOsDisconnectIt(pThis); … … 553 553 RTSpinlockAcquire(pThis->hSpinlock); 554 554 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); 555 RTSpinlockRelease NoInts(pThis->hSpinlock);555 RTSpinlockRelease(pThis->hSpinlock); 556 556 557 557 vboxNetAdpRelease(pThis); … … 601 601 RTSpinlockAcquire(pThis->hSpinlock); 602 602 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); 603 RTSpinlockRelease NoInts(pThis->hSpinlock);603 RTSpinlockRelease(pThis->hSpinlock); 604 604 return rc; 605 605 } … … 617 617 if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Available || pThis->cBusy) 618 618 { 619 RTSpinlockRelease NoInts(pThis->hSpinlock);619 RTSpinlockRelease(pThis->hSpinlock); 620 620 return VERR_INTNET_FLT_IF_BUSY; 621 621 } 622 622 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); 623 RTSpinlockRelease NoInts(pThis->hSpinlock);623 RTSpinlockRelease(pThis->hSpinlock); 624 624 vboxNetAdpRelease(pThis); 625 625 … … 628 628 RTSpinlockAcquire(pThis->hSpinlock); 629 629 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Invalid); 630 RTSpinlockRelease NoInts(pThis->hSpinlock);630 RTSpinlockRelease(pThis->hSpinlock); 631 631 632 632 return rc; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
r52394 r52618 5 5 6 6 /* 7 * Copyright (C) 2008-201 2Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 404 404 ASMAtomicWriteBool(&pThis->fRediscoveryPending, true); 405 405 406 RTSpinlockRelease NoInts(pThis->hSpinlock);406 RTSpinlockRelease(pThis->hSpinlock); 407 407 408 408 /* … … 517 517 if (enmOldTrunkState != enmState) 518 518 ASMAtomicWriteU32((uint32_t volatile *)&pThis->enmTrunkState, enmState); 519 RTSpinlockRelease NoInts(pThis->hSpinlock);519 RTSpinlockRelease(pThis->hSpinlock); 520 520 521 521 /* … … 622 622 RTSpinlockAcquire(pThis->hSpinlock); 623 623 vboxNetFltSetState(pThis, kVBoxNetFltInsState_Disconnecting); 624 RTSpinlockRelease NoInts(pThis->hSpinlock);624 RTSpinlockRelease(pThis->hSpinlock); 625 625 626 626 vboxNetFltOsDisconnectIt(pThis); … … 630 630 RTSpinlockAcquire(pThis->hSpinlock); 631 631 vboxNetFltSetState(pThis, kVBoxNetFltInsState_Unconnected); 632 RTSpinlockRelease NoInts(pThis->hSpinlock);632 RTSpinlockRelease(pThis->hSpinlock); 633 633 #endif 634 634 … … 850 850 AssertMsg(cRefs >= 1 && cRefs < UINT32_MAX / 2, ("%d\n", cRefs)); NOREF(cRefs); 851 851 } 852 RTSpinlockRelease NoInts(pThis->hSpinlock);852 RTSpinlockRelease(pThis->hSpinlock); 853 853 854 854 return fRc; … … 897 897 AssertMsg(cRefs >= 1 && cRefs < UINT32_MAX / 2, ("%d\n", cRefs)); NOREF(cRefs); 898 898 } 899 RTSpinlockRelease NoInts(pThis->hSpinlock);899 RTSpinlockRelease(pThis->hSpinlock); 900 900 901 901 return fRc; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r50762 r52618 319 319 ifnet_reference(pIfNet); 320 320 } 321 RTSpinlockRelease NoInts(pThis->hSpinlock);321 RTSpinlockRelease(pThis->hSpinlock); 322 322 323 323 return pIfNet; … … 749 749 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 750 750 751 RTSpinlockRelease NoInts(pThis->hSpinlock);751 RTSpinlockRelease(pThis->hSpinlock); 752 752 753 753 if (pIfNet) … … 1031 1031 RTSpinlockAcquire(pThis->hSpinlock); 1032 1032 ASMAtomicUoWritePtr(&pThis->u.s.pIfNet, pIfNet); 1033 RTSpinlockRelease NoInts(pThis->hSpinlock);1033 RTSpinlockRelease(pThis->hSpinlock); 1034 1034 1035 1035 /* Adjust g_offIfNetPCount as it varies for different versions of xnu. */ … … 1069 1069 pIfNet = NULL; /* don't dereference it */ 1070 1070 } 1071 RTSpinlockRelease NoInts(pThis->hSpinlock);1071 RTSpinlockRelease(pThis->hSpinlock); 1072 1072 1073 1073 /* Report capabilities. */ … … 1290 1290 if (pIfFilter) 1291 1291 ASMAtomicUoWriteNullPtr(&pThis->u.s.pIfFilter); 1292 RTSpinlockRelease NoInts(pThis->hSpinlock);1292 RTSpinlockRelease(pThis->hSpinlock); 1293 1293 1294 1294 if (pIfFilter) -
trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
r40912 r52618 609 609 TASK_INIT(&pThis->u.s.tskout, 0, vboxNetFltFreeBSDoutput, pThis); 610 610 611 RTSpinlockRelease NoInts(pThis->hSpinlock);611 RTSpinlockRelease(pThis->hSpinlock); 612 612 613 613 NG_NODE_SET_PRIVATE(node, pThis); -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r47484 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 406 406 ASMAtomicXchgPtr((void * volatile *)&pDev->hard_start_xmit, vboxNetFltLinuxStartXmitFilter); 407 407 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */ 408 RTSpinlockRelease NoInts(pThis->hSpinlock);408 RTSpinlockRelease(pThis->hSpinlock); 409 409 } 410 410 … … 442 442 else 443 443 pOverride = NULL; 444 RTSpinlockRelease NoInts(pThis->hSpinlock);444 RTSpinlockRelease(pThis->hSpinlock); 445 445 446 446 if (pOverride) … … 1465 1465 fFeatures = 0; 1466 1466 1467 RTSpinlockRelease NoInts(pThis->hSpinlock);1467 RTSpinlockRelease(pThis->hSpinlock); 1468 1468 1469 1469 if (pThis->pSwitchPort) … … 1579 1579 RTSpinlockAcquire(pThis->hSpinlock); 1580 1580 ASMAtomicUoWritePtr(&pThis->u.s.pDev, pDev); 1581 RTSpinlockRelease NoInts(pThis->hSpinlock);1581 RTSpinlockRelease(pThis->hSpinlock); 1582 1582 1583 1583 Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) retained. ref=%d\n", … … 1629 1629 pDev = NULL; /* don't dereference it */ 1630 1630 } 1631 RTSpinlockRelease NoInts(pThis->hSpinlock);1631 RTSpinlockRelease(pThis->hSpinlock); 1632 1632 1633 1633 /* … … 1654 1654 RTSpinlockAcquire(pThis->hSpinlock); 1655 1655 ASMAtomicUoWriteNullPtr(&pThis->u.s.pDev); 1656 RTSpinlockRelease NoInts(pThis->hSpinlock);1656 RTSpinlockRelease(pThis->hSpinlock); 1657 1657 dev_put(pDev); 1658 1658 Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) released. ref=%d\n", … … 1693 1693 ASMAtomicUoWriteNullPtr(&pThis->u.s.pDev); 1694 1694 } 1695 RTSpinlockRelease NoInts(pThis->hSpinlock);1695 RTSpinlockRelease(pThis->hSpinlock); 1696 1696 1697 1697 if (fRegistered) … … 2028 2028 pDev = ASMAtomicUoReadPtrT(&pThis->u.s.pDev, struct net_device *); 2029 2029 fRegistered = ASMAtomicXchgBool(&pThis->u.s.fRegistered, false); 2030 RTSpinlockRelease NoInts(pThis->hSpinlock);2030 RTSpinlockRelease(pThis->hSpinlock); 2031 2031 2032 2032 if (fRegistered) -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r50664 r52618 5 5 6 6 /* 7 * Copyright (C) 2008-201 2Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1110 1110 const bool fActive = pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE; 1111 1111 vboxNetFltRetain(pThis, true /* fBusy */); 1112 RTSpinlockRelease NoInts(pThis->hSpinlock);1112 RTSpinlockRelease(pThis->hSpinlock); 1113 1113 1114 1114 vboxnetflt_promisc_stream_t *pPromiscStream = (vboxnetflt_promisc_stream_t *)pStream; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltM-win.cpp
r44529 r52618 5 5 */ 6 6 /* 7 * Copyright (C) 2011-201 2Oracle Corporation7 * Copyright (C) 2011-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 143 143 vboxNetFltWinSetOpState(&pNetFlt->u.s.WinIf.MpState, kVBoxNetDevOpState_Deinitializing); 144 144 145 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);145 RTSpinlockRelease(pNetFlt->hSpinlock); 146 146 147 147 vboxNetFltWinWaitDereference(&pNetFlt->u.s.WinIf.MpState); … … 518 518 || vboxNetFltWinGetPowerState(&pNetFlt->u.s.WinIf.MpState) > NdisDeviceStateD0) 519 519 { 520 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);520 RTSpinlockRelease(pNetFlt->hSpinlock); 521 521 *pStatus = NDIS_STATUS_FAILURE; 522 522 return 0; … … 527 527 { 528 528 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS | VBOXNDISREQUEST_QUEUED; 529 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);529 RTSpinlockRelease(pNetFlt->hSpinlock); 530 530 *pStatus = NDIS_STATUS_PENDING; 531 531 return VBOXNDISREQUEST_INPROGRESS | VBOXNDISREQUEST_QUEUED; … … 534 534 if (pNetFlt->u.s.WinIf.StateFlags.fStandBy) 535 535 { 536 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);536 RTSpinlockRelease(pNetFlt->hSpinlock); 537 537 *pStatus = NDIS_STATUS_FAILURE; 538 538 return 0; … … 541 541 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS; 542 542 543 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);543 RTSpinlockRelease(pNetFlt->hSpinlock); 544 544 545 545 *pStatus = NDIS_STATUS_SUCCESS; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltP-win.cpp
r44529 r52618 5 5 */ 6 6 /* 7 * Copyright (C) 2011-201 2Oracle Corporation7 * Copyright (C) 2011-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 176 176 /* mark the request as InProgress before posting it to RequestComplete */ 177 177 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS; 178 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);178 RTSpinlockRelease(pNetFlt->hSpinlock); 179 179 vboxNetFltWinPtRequestComplete(pNetFlt, &pNetFlt->u.s.WinIf.PassDownRequest, NDIS_STATUS_FAILURE); 180 180 } 181 181 else 182 182 { 183 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);183 RTSpinlockRelease(pNetFlt->hSpinlock); 184 184 } 185 185 } … … 209 209 } 210 210 211 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);211 RTSpinlockRelease(pNetFlt->hSpinlock); 212 212 213 213 vboxNetFltWinPtRequestsWaitComplete(pNetFlt); … … 1401 1401 if (pNetFlt->u.s.WinIf.StateFlags.fInterfaceClosing) 1402 1402 { 1403 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);1403 RTSpinlockRelease(pNetFlt->hSpinlock); 1404 1404 Assert(0); 1405 1405 return false; … … 1407 1407 if (pNetFlt->u.s.WinIf.hBinding == NULL) 1408 1408 { 1409 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);1409 RTSpinlockRelease(pNetFlt->hSpinlock); 1410 1410 Assert(0); 1411 1411 return false; … … 1413 1413 1414 1414 pNetFlt->u.s.WinIf.StateFlags.fInterfaceClosing = TRUE; 1415 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);1415 RTSpinlockRelease(pNetFlt->hSpinlock); 1416 1416 1417 1417 NdisResetEvent(&pNetFlt->u.s.WinIf.OpenCloseEvent); … … 1444 1444 pNetFlt->u.s.WinIf.StateFlags.fStandBy = TRUE; 1445 1445 } 1446 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);1446 RTSpinlockRelease(pNetFlt->hSpinlock); 1447 1447 vboxNetFltWinPtRequestsWaitComplete(pNetFlt); 1448 1448 vboxNetFltWinWaitDereference(&pNetFlt->u.s.WinIf.MpState); … … 1469 1469 { 1470 1470 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS; 1471 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);1471 RTSpinlockRelease(pNetFlt->hSpinlock); 1472 1472 1473 1473 vboxNetFltWinMpRequestPost(pNetFlt); … … 1475 1475 else 1476 1476 { 1477 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);1477 RTSpinlockRelease(pNetFlt->hSpinlock); 1478 1478 } 1479 1479 } -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltRt-win.cpp
r44529 r52618 5 5 */ 6 6 /* 7 * Copyright (C) 2011-201 2Oracle Corporation7 * Copyright (C) 2011-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1069 1069 pSG = pWorker->pSG; 1070 1070 pWorker->pSG = NULL; 1071 RTSpinlockRelease NoInts((pInstance)->hSpinlock);1071 RTSpinlockRelease((pInstance)->hSpinlock); 1072 1072 KeSetEvent(&pWorker->KillEvent, 0, FALSE); 1073 1073 … … 1083 1083 else 1084 1084 { 1085 RTSpinlockRelease NoInts((pInstance)->hSpinlock);1085 RTSpinlockRelease((pInstance)->hSpinlock); 1086 1086 } 1087 1087 } -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltRt-win.h
r49137 r52618 5 5 */ 6 6 /* 7 * Copyright (C) 2011-201 2Oracle Corporation7 * Copyright (C) 2011-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 594 594 #endif 595 595 { 596 RTSpinlockRelease NoInts((pNetFlt)->hSpinlock);596 RTSpinlockRelease((pNetFlt)->hSpinlock); 597 597 *pbNetFltActive = false; 598 598 return false; … … 602 602 { 603 603 vboxNetFltWinReferenceModePassThru(pNetFlt); 604 RTSpinlockRelease NoInts((pNetFlt)->hSpinlock);604 RTSpinlockRelease((pNetFlt)->hSpinlock); 605 605 *pbNetFltActive = false; 606 606 return true; … … 609 609 vboxNetFltRetain((pNetFlt), true /* fBusy */); 610 610 vboxNetFltWinReferenceModeNetFlt(pNetFlt); 611 RTSpinlockRelease NoInts((pNetFlt)->hSpinlock);611 RTSpinlockRelease((pNetFlt)->hSpinlock); 612 612 613 613 *pbNetFltActive = true; … … 633 633 #endif 634 634 { 635 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);635 RTSpinlockRelease(pNetFlt->hSpinlock); 636 636 *pbNetFltActive = false; 637 637 return false; … … 642 642 vboxNetFltWinIncReferenceModePassThru(pNetFlt, v); 643 643 644 RTSpinlockRelease NoInts((pNetFlt)->hSpinlock);644 RTSpinlockRelease((pNetFlt)->hSpinlock); 645 645 *pbNetFltActive = false; 646 646 return true; … … 651 651 vboxNetFltWinIncReferenceModeNetFlt(pNetFlt, v); 652 652 653 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);653 RTSpinlockRelease(pNetFlt->hSpinlock); 654 654 655 655 /* we have marked it as busy, so can do the res references outside the lock */ … … 715 715 #endif 716 716 { 717 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);717 RTSpinlockRelease(pNetFlt->hSpinlock); 718 718 return true; 719 719 } 720 720 721 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);721 RTSpinlockRelease(pNetFlt->hSpinlock); 722 722 return false; 723 723 } … … 732 732 #endif 733 733 { 734 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);734 RTSpinlockRelease(pNetFlt->hSpinlock); 735 735 return true; 736 736 } 737 737 738 RTSpinlockRelease NoInts(pNetFlt->hSpinlock);738 RTSpinlockRelease(pNetFlt->hSpinlock); 739 739 return false; 740 740 } -
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
r44529 r52618 5 5 6 6 /* 7 * Copyright (C) 2011-201 2Oracle Corporation7 * Copyright (C) 2011-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 90 90 { 91 91 #ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS 92 RTSpinlockRelease NoInts(pThis->hSpinlock);92 RTSpinlockRelease(pThis->hSpinlock); 93 93 #else 94 94 RTSemFastMutexRelease(pThis->hFastMtx); -
trunk/src/VBox/Runtime/generic/spinlock-generic.cpp
r51571 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 225 225 RT_EXPORT_SYMBOL(RTSpinlockRelease); 226 226 227 228 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)229 {230 #if 1231 if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))232 RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);233 #else234 AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);235 #endif236 RTSpinlockRelease(Spinlock);237 }238 RT_EXPORT_SYMBOL(RTSpinlockReleaseNoInts);239 -
trunk/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp
r44529 r52618 5 5 6 6 /* 7 * Copyright (C) 2008-201 1Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 271 271 } 272 272 273 274 RTDECL(bool) RTMpOnAllIsConcurrentSafe(void) 275 { 276 return true; 277 } 278 -
trunk/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp
r48935 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 161 161 } 162 162 163 164 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)165 {166 #if 1167 if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))168 RTAssertMsg2("RTSpinlockReleaseNoInts: %p (%s)\n", Spinlock, Spinlock->pszName);169 #else170 AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);171 #endif172 RTSpinlockRelease(Spinlock);173 }174 -
trunk/src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c
r49718 r52618 5 5 6 6 /* 7 * Copyright (C) 2008-201 1Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 289 289 #endif /* < 7.0 */ 290 290 291 292 RTDECL(bool) RTMpOnAllIsConcurrentSafe(void) 293 { 294 return true; 295 } 296 -
trunk/src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c
r42496 r52618 208 208 } 209 209 210 211 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)212 {213 #if 1214 if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))215 RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);216 #else217 AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);218 #endif219 RTSpinlockRelease(Spinlock);220 }221 -
trunk/src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c
r43373 r52618 5 5 6 6 /* 7 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 217 217 } 218 218 219 220 RTDECL(bool) RTMpOnAllIsConcurrentSafe(void) 221 { 222 return true; 223 } 224 -
trunk/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c
r43403 r52618 5 5 6 6 /* 7 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 137 137 } 138 138 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 5 5 6 6 /* 7 * Copyright (C) 2008-201 1Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 412 412 RT_EXPORT_SYMBOL(RTMpPokeCpu); 413 413 414 415 RTDECL(bool) RTMpOnAllIsConcurrentSafe(void) 416 { 417 return true; 418 } 419 RT_EXPORT_SYMBOL(RTMpOnAllIsConcurrentSafe); 420 -
trunk/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c
r50811 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 178 178 RT_EXPORT_SYMBOL(RTSpinlockRelease); 179 179 180 181 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)182 {183 #if 1184 if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))185 RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);186 #else187 AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);188 #endif189 RTSpinlockRelease(Spinlock);190 }191 RT_EXPORT_SYMBOL(RTSpinlockReleaseNoInts);192 -
trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
r44528 r52618 1441 1441 1442 1442 if (pTimer->cCpus > 1) 1443 RTSpinlockRelease NoInts(pTimer->hSpinlock);1443 RTSpinlockRelease(pTimer->hSpinlock); 1444 1444 } 1445 1445 -
trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
r44529 r52618 5 5 6 6 /* 7 * Copyright (C) 2008-201 1Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 416 416 return (bRet == TRUE) ? VINF_SUCCESS : VERR_ACCESS_DENIED /* already queued */; 417 417 } 418 419 420 RTDECL(bool) RTMpOnAllIsConcurrentSafe(void) 421 { 422 return false; 423 } 424 -
trunk/src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp
r48935 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 196 196 } 197 197 198 199 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)200 {201 #if 1202 if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))203 RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);204 #else205 AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);206 #endif207 RTSpinlockRelease(Spinlock);208 }209 -
trunk/src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp
r48935 r52618 128 128 } 129 129 130 131 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)132 {133 #if 1134 if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))135 RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);136 #else137 AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);138 #endif139 RTSpinlockRelease(Spinlock);140 }141 -
trunk/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp
r48935 r52618 157 157 g_pTimerHead = pTimer; 158 158 g_cTimers++; 159 RTSpinlockRelease NoInts(g_Spinlock);159 RTSpinlockRelease(g_Spinlock); 160 160 161 161 *ppTimer = pTimer; … … 201 201 if (RT_UNLIKELY(!pPrev)) 202 202 { 203 RTSpinlockRelease NoInts(g_Spinlock);203 RTSpinlockRelease(g_Spinlock); 204 204 return VERR_INVALID_HANDLE; 205 205 } … … 216 216 rtTimerOs2Dearm(); 217 217 } 218 RTSpinlockRelease NoInts(g_Spinlock);218 RTSpinlockRelease(g_Spinlock); 219 219 220 220 /* … … 246 246 if (RT_FAILURE(rc)) 247 247 { 248 RTSpinlockRelease NoInts(g_Spinlock);248 RTSpinlockRelease(g_Spinlock); 249 249 return rc; 250 250 } … … 256 256 pTimer->u64StartTS = u64First; 257 257 pTimer->u64NextTS = u64First; 258 RTSpinlockRelease NoInts(g_Spinlock);258 RTSpinlockRelease(g_Spinlock); 259 259 260 260 return VINF_SUCCESS; … … 279 279 if (!g_cActiveTimers) 280 280 rtTimerOs2Dearm(); 281 RTSpinlockRelease NoInts(g_Spinlock);281 RTSpinlockRelease(g_Spinlock); 282 282 283 283 return VINF_SUCCESS; … … 338 338 PFNRTTIMER pfnTimer = pTimer->pfnTimer; 339 339 void *pvUser = pTimer->pvUser; 340 RTSpinlockRelease NoInts(g_Spinlock);340 RTSpinlockRelease(g_Spinlock); 341 341 pfnTimer(pTimer, pvUser, pTimer->iTick); 342 342 … … 355 355 } 356 356 357 RTSpinlockRelease NoInts(g_Spinlock);357 RTSpinlockRelease(g_Spinlock); 358 358 } 359 359 -
trunk/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c
r44529 r52618 5 5 6 6 /* 7 * Copyright (C) 2008-201 2Oracle Corporation7 * Copyright (C) 2008-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 345 345 } 346 346 347 348 RTDECL(bool) RTMpOnAllIsConcurrentSafe(void) 349 { 350 return true; 351 } 352 -
trunk/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c
r44528 r52618 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 203 203 } 204 204 205 206 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)207 {208 #if 1209 if (RT_UNLIKELY(!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)))210 RTAssertMsg2("RTSpinlockReleaseNoInts: %p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);211 #else212 AssertRelease(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE);213 #endif214 RTSpinlockRelease(Spinlock);215 }216 -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r48395 r52618 5 5 6 6 /* 7 * Copyright (C) 2007-201 2Oracle Corporation7 * Copyright (C) 2007-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 2207 2207 uHistMaxHz = pCpu->Ppt.aHzHistory[i]; 2208 2208 if (uHistMaxHz == pCpu->Ppt.uTimerHz) 2209 RTSpinlockRelease NoInts(pCpu->Ppt.hSpinlock);2209 RTSpinlockRelease(pCpu->Ppt.hSpinlock); 2210 2210 else if (uHistMaxHz) 2211 2211 { … … 2224 2224 else 2225 2225 pCpu->Ppt.cTicksHistoriziationInterval = 1; 2226 RTSpinlockRelease NoInts(pCpu->Ppt.hSpinlock);2226 RTSpinlockRelease(pCpu->Ppt.hSpinlock); 2227 2227 2228 2228 /*SUPR0Printf("Cpu%u: change to %u Hz / %u ns\n", pCpu->idxCpuSet, uHistMaxHz, cNsInterval);*/ … … 2237 2237 pCpu->Ppt.uTimerHz = 0; 2238 2238 pCpu->Ppt.cNsInterval = 0; 2239 RTSpinlockRelease NoInts(pCpu->Ppt.hSpinlock);2239 RTSpinlockRelease(pCpu->Ppt.hSpinlock); 2240 2240 2241 2241 /*SUPR0Printf("Cpu%u: stopping (%u Hz)\n", pCpu->idxCpuSet, uHistMaxHz);*/ … … 2244 2244 } 2245 2245 else 2246 RTSpinlockRelease NoInts(pCpu->Ppt.hSpinlock);2246 RTSpinlockRelease(pCpu->Ppt.hSpinlock); 2247 2247 } 2248 2248 #endif /* GVMM_SCHED_WITH_PPT */ … … 2311 2311 } 2312 2312 2313 RTSpinlockRelease NoInts(pCpu->Ppt.hSpinlock);2313 RTSpinlockRelease(pCpu->Ppt.hSpinlock); 2314 2314 2315 2315 if (cNsInterval) … … 2323 2323 pCpu->Ppt.fStarted = false; 2324 2324 pCpu->Ppt.fStarting = false; 2325 RTSpinlockRelease NoInts(pCpu->Ppt.hSpinlock);2325 RTSpinlockRelease(pCpu->Ppt.hSpinlock); 2326 2326 } 2327 2327 }
Note:
See TracChangeset
for help on using the changeset viewer.