Changeset 70151 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Dec 15, 2017 2:34:43 PM (7 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
r70149 r70151 117 117 uint32_t g_uRtNtBuildNo; 118 118 119 /** Pointer to the MmHighestUserAddress kernel variable - can be NULL. */ 120 uintptr_t const *g_puRtMmHighestUserAddress; 121 /** Pointer to the MmSystemRangeStart kernel variable - can be NULL. */ 122 uintptr_t const *g_puRtMmSystemRangeStart; 123 119 124 120 125 /** … … 288 293 g_pfnrtHalRequestIpiW7Plus = (PFNHALREQUESTIPI_W7PLUS)RTR0DbgKrnlInfoGetSymbol(hKrnlInfo, NULL, "HalRequestIpi"); 289 294 g_pfnrtHalRequestIpiPreW7 = (PFNHALREQUESTIPI_PRE_W7)g_pfnrtHalRequestIpiW7Plus; 295 296 g_puRtMmHighestUserAddress = (uintptr_t const *)RTR0DbgKrnlInfoGetSymbol(hKrnlInfo, NULL, "MmHighestUserAddress"); 297 g_puRtMmSystemRangeStart = (uintptr_t const *)RTR0DbgKrnlInfoGetSymbol(hKrnlInfo, NULL, "MmSystemRangeStart"); 290 298 291 299 RTR0DbgKrnlInfoRelease(hKrnlInfo); -
trunk/src/VBox/Runtime/r0drv/nt/internal-r0drv-nt.h
r70150 r70151 101 101 extern uint32_t g_uRtNtBuildNo; 102 102 103 extern uintptr_t const *g_puRtMmHighestUserAddress; 104 extern uintptr_t const *g_puRtMmSystemRangeStart; 105 103 106 104 107 int __stdcall rtMpPokeCpuUsingDpc(RTCPUID idCpu); -
trunk/src/VBox/Runtime/r0drv/nt/memuserkernel-r0drv-nt.cpp
r69111 r70151 34 34 #include <iprt/err.h> 35 35 36 #include "internal-r0drv-nt.h" 37 36 38 37 39 RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb) … … 68 70 { 69 71 #ifdef IPRT_TARGET_NT4 70 /* Play safe+wrong... it used to be a constant, but in w2k+ is a variable. */ 71 return R3Ptr < _2G; 72 uintptr_t const uLast = g_puRtMmHighestUserAddress ? *g_puRtMmHighestUserAddress : ~(uintptr_t)0 / 2; 72 73 #else 73 return R3Ptr <= (uintptr_t)MM_HIGHEST_USER_ADDRESS;74 uintptr_t const uLast = (uintptr_t)MM_HIGHEST_USER_ADDRESS; 74 75 #endif 76 return R3Ptr <= uLast; 75 77 } 76 78 … … 79 81 { 80 82 #ifdef IPRT_TARGET_NT4 81 /* Play safe+wrong... it used to be a constant, but in w2k+ is a variable. */ 82 return (uintptr_t)pv >= _2G; 83 uintptr_t const uFirst = g_puRtMmSystemRangeStart ? *g_puRtMmSystemRangeStart : ~(uintptr_t)0 / 2 + 1; 83 84 #else 84 return (uintptr_t)pv >= (uintptr_t)MM_SYSTEM_RANGE_START;85 uintptr_t const uFirst = (uintptr_t)MM_SYSTEM_RANGE_START; 85 86 #endif 87 return (uintptr_t)pv >= uFirst; 86 88 } 87 89 -
trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
r69111 r70151 594 594 595 595 g_pfnrtMpPokeCpuWorker = rtMpPokeCpuUsingDpc; 596 #ifndef IPRT_TARGET_NT4597 596 if ( g_pfnrtHalRequestIpiW7Plus 598 597 && g_pfnrtKeInitializeAffinityEx … … 611 610 DbgPrint("IPRT: RTMpPoke => rtMpPokeCpuUsingDpc\n"); 612 611 /* else: Windows XP should send always send an IPI -> VERIFY */ 613 #endif614 612 615 613 return VINF_SUCCESS; … … 1362 1360 RT_NT_CPUID enmCpuid, RTCPUID idCpu, RTCPUID idCpu2, uint32_t *pcHits) 1363 1361 { 1364 #ifdef IPRT_TARGET_NT4 1365 RT_NOREF(pfnWorker, pvUser1, pvUser2, enmCpuid, idCpu, idCpu2, pcHits); 1366 /* g_pfnrtNt* are not present on NT anyway. */ 1367 return VERR_NOT_SUPPORTED; 1368 1369 #else /* !IPRT_TARGET_NT4 */ 1370 # if 0 1362 #if 0 1371 1363 /* KeFlushQueuedDpcs must be run at IRQL PASSIVE_LEVEL according to MSDN, but the 1372 1364 * driver verifier doesn't complain... 1373 1365 */ 1374 1366 AssertMsg(KeGetCurrentIrql() == PASSIVE_LEVEL, ("%d != %d (PASSIVE_LEVEL)\n", KeGetCurrentIrql(), PASSIVE_LEVEL)); 1375 # 1367 #endif 1376 1368 /* KeFlushQueuedDpcs is not present in Windows 2000; import it dynamically so we can just fail this call. */ 1377 1369 if (!g_pfnrtNtKeFlushQueuedDpcs) … … 1512 1504 * executed. Seen pArgs being freed while some CPU was using it before 1513 1505 * cRefs was added. */ 1514 g_pfnrtNtKeFlushQueuedDpcs(); 1506 if (g_pfnrtNtKeFlushQueuedDpcs) 1507 g_pfnrtNtKeFlushQueuedDpcs(); 1515 1508 1516 1509 if (pcHits) … … 1524 1517 1525 1518 return VINF_SUCCESS; 1526 #endif /* !IPRT_TARGET_NT4 */1527 1519 } 1528 1520 … … 1764 1756 if (rcNt == STATUS_TIMEOUT) 1765 1757 { 1766 #ifndef IPRT_TARGET_NT41767 1758 if ( !pArgs->fExecuting 1768 1759 && ( g_pfnrtMpPokeCpuWorker == rtMpPokeCpuUsingHalReqestIpiW7Plus 1769 1760 || g_pfnrtMpPokeCpuWorker == rtMpPokeCpuUsingHalReqestIpiPreW7)) 1770 1761 RTMpPokeCpu(idCpu); 1771 #endif1772 1762 1773 1763 Timeout.QuadPart = -1280000; /* 128ms */ … … 1823 1813 } 1824 1814 1825 #ifndef IPRT_TARGET_NT41826 1815 1827 1816 /** Callback used by rtMpPokeCpuUsingBroadcastIpi. */ … … 1881 1870 return VINF_SUCCESS; 1882 1871 } 1883 1884 #endif /* !IPRT_TARGET_NT4 */1885 1872 1886 1873 … … 1910 1897 1911 1898 /* Raise the IRQL to DISPATCH_LEVEL so we can't be rescheduled to another cpu. 1912 * KeInsertQueueDpc must also be executed at IRQL >= DISPATCH_LEVEL. 1913 */ 1899 KeInsertQueueDpc must also be executed at IRQL >= DISPATCH_LEVEL. */ 1914 1900 KIRQL oldIrql; 1915 1901 KeRaiseIrql(DISPATCH_LEVEL, &oldIrql); … … 1919 1905 1920 1906 /* Assuming here that high importance DPCs will be delivered immediately; or at least an IPI will be sent immediately. 1921 * @note: not true on at least Vista & Windows 7 1922 */ 1923 BOOLEAN bRet = KeInsertQueueDpc(&s_aPokeDpcs[idCpu], 0, 0); 1907 Note! Not true on at least Vista & Windows 7 */ 1908 BOOLEAN fRet = KeInsertQueueDpc(&s_aPokeDpcs[idCpu], 0, 0); 1924 1909 1925 1910 KeLowerIrql(oldIrql); 1926 return (bRet == TRUE)? VINF_SUCCESS : VERR_ACCESS_DENIED /* already queued */;1911 return fRet == TRUE ? VINF_SUCCESS : VERR_ACCESS_DENIED /* already queued */; 1927 1912 } 1928 1913
Note:
See TracChangeset
for help on using the changeset viewer.