Changeset 70212 in vbox
- Timestamp:
- Dec 19, 2017 2:54:28 AM (7 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 5 edited
-
initterm-r0drv-nt.cpp (modified) (4 diffs)
-
internal-r0drv-nt.h (modified) (3 diffs)
-
memobj-r0drv-nt.cpp (modified) (4 diffs)
-
mp-r0drv-nt.cpp (modified) (10 diffs)
-
timer-r0drv-nt.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
r70157 r70212 89 89 /** KeDeregisterProcessorChangeCallback - Introducted in Windows 7. */ 90 90 PFNKEDEREGISTERPROCESSORCHANGECALLBACK g_pfnrtKeDeregisterProcessorChangeCallback; 91 /** KeSetImportanceDpc - Introducted in NT 3.51. */ 92 decltype(KeSetImportanceDpc) *g_pfnrtKeSetImportanceDpc; 93 /** KeSetTargetProcessorDpc - Introducted in NT 3.51. */ 94 decltype(KeSetTargetProcessorDpc) *g_pfnrtKeSetTargetProcessorDpc; 91 95 /** Pointer to the MmProtectMdlSystemAddress kernel function if it's available. 92 96 * This API was introduced in XP. */ … … 100 104 /** MmAllocateContiguousMemorySpecifyCache - Introduced in Windows 2000. */ 101 105 decltype(MmAllocateContiguousMemorySpecifyCache) *g_pfnrtMmAllocateContiguousMemorySpecifyCache; 106 /** MmSecureVirtualMemory - Introduced in NT 3.51. */ 107 decltype(MmSecureVirtualMemory) *g_pfnrtMmSecureVirtualMemory; 108 /** MmUnsecureVirtualMemory - Introduced in NT 3.51. */ 109 decltype(MmUnsecureVirtualMemory) *g_pfnrtMmUnsecureVirtualMemory; 102 110 /** RtlGetVersion, introduced in ??. */ 103 111 PFNRTRTLGETVERSION g_pfnrtRtlGetVersion; … … 295 303 GET_SYSTEM_ROUTINE(KeRegisterProcessorChangeCallback); 296 304 GET_SYSTEM_ROUTINE(KeDeregisterProcessorChangeCallback); 305 GET_SYSTEM_ROUTINE(KeSetImportanceDpc); 306 GET_SYSTEM_ROUTINE(KeSetTargetProcessorDpc); 297 307 GET_SYSTEM_ROUTINE(MmProtectMdlSystemAddress); 298 308 GET_SYSTEM_ROUTINE(MmAllocatePagesForMdl); … … 300 310 GET_SYSTEM_ROUTINE(MmMapLockedPagesSpecifyCache); 301 311 GET_SYSTEM_ROUTINE(MmAllocateContiguousMemorySpecifyCache); 312 GET_SYSTEM_ROUTINE(MmSecureVirtualMemory); 313 GET_SYSTEM_ROUTINE(MmUnsecureVirtualMemory); 302 314 303 315 GET_SYSTEM_ROUTINE_TYPE(RtlGetVersion, PFNRTRTLGETVERSION); -
trunk/src/VBox/Runtime/r0drv/nt/internal-r0drv-nt.h
r70157 r70212 82 82 extern PFNKEREGISTERPROCESSORCHANGECALLBACK g_pfnrtKeRegisterProcessorChangeCallback; 83 83 extern PFNKEDEREGISTERPROCESSORCHANGECALLBACK g_pfnrtKeDeregisterProcessorChangeCallback; 84 extern decltype(KeSetImportanceDpc) *g_pfnrtKeSetImportanceDpc; 85 extern decltype(KeSetTargetProcessorDpc) *g_pfnrtKeSetTargetProcessorDpc; 84 86 extern decltype(MmProtectMdlSystemAddress) *g_pfnrtMmProtectMdlSystemAddress; 85 87 extern decltype(MmAllocatePagesForMdl) *g_pfnrtMmAllocatePagesForMdl; … … 87 89 extern decltype(MmMapLockedPagesSpecifyCache) *g_pfnrtMmMapLockedPagesSpecifyCache; 88 90 extern decltype(MmAllocateContiguousMemorySpecifyCache) *g_pfnrtMmAllocateContiguousMemorySpecifyCache; 91 extern decltype(MmSecureVirtualMemory) *g_pfnrtMmSecureVirtualMemory; 92 extern decltype(MmUnsecureVirtualMemory) *g_pfnrtMmUnsecureVirtualMemory; 93 89 94 extern PFNRTRTLGETVERSION g_pfnrtRtlGetVersion; 90 95 #ifndef RT_ARCH_AMD64 … … 111 116 112 117 118 int __stdcall rtMpPokeCpuUsingFailureNotSupported(RTCPUID idCpu); 113 119 int __stdcall rtMpPokeCpuUsingDpc(RTCPUID idCpu); 114 120 int __stdcall rtMpPokeCpuUsingBroadcastIpi(RTCPUID idCpu); -
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r70157 r70212 96 96 if (pMemNt->pvSecureMem) 97 97 { 98 MmUnsecureVirtualMemory(pMemNt->pvSecureMem);98 g_pfnrtMmUnsecureVirtualMemory(pMemNt->pvSecureMem); 99 99 pMemNt->pvSecureMem = NULL; 100 100 } … … 159 159 if (pMemNt->pvSecureMem) 160 160 { 161 MmUnsecureVirtualMemory(pMemNt->pvSecureMem);161 g_pfnrtMmUnsecureVirtualMemory(pMemNt->pvSecureMem); 162 162 pMemNt->pvSecureMem = NULL; 163 163 } … … 602 602 } 603 603 604 if (R0Process != NIL_RTR0PROCESS) 604 if ( R0Process != NIL_RTR0PROCESS 605 && g_pfnrtMmSecureVirtualMemory 606 && g_pfnrtMmUnsecureVirtualMemory) 605 607 { 606 608 /* Make sure the user process can't change the allocation. */ 607 pMemNt->pvSecureMem = MmSecureVirtualMemory(pv, cb,608 fAccess & RTMEM_PROT_WRITE609 ? PAGE_READWRITE610 : PAGE_READONLY);609 pMemNt->pvSecureMem = g_pfnrtMmSecureVirtualMemory(pv, cb, 610 fAccess & RTMEM_PROT_WRITE 611 ? PAGE_READWRITE 612 : PAGE_READONLY); 611 613 if (!pMemNt->pvSecureMem) 612 614 { … … 639 641 if (pMemNt->pvSecureMem) 640 642 { 641 MmUnsecureVirtualMemory(pMemNt->pvSecureMem); 643 if (g_pfnrtMmUnsecureVirtualMemory) 644 g_pfnrtMmUnsecureVirtualMemory(pMemNt->pvSecureMem); 642 645 pMemNt->pvSecureMem = NULL; 643 646 } -
trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
r70153 r70212 593 593 g_pfnrtHalRequestIpiW7Plus = NULL; 594 594 595 g_pfnrtMpPokeCpuWorker = rtMpPokeCpuUsingDpc;596 595 if ( g_pfnrtHalRequestIpiW7Plus 597 596 && g_pfnrtKeInitializeAffinityEx … … 607 606 g_pfnrtMpPokeCpuWorker = rtMpPokeCpuUsingBroadcastIpi; 608 607 } 608 else if (g_pfnrtKeSetTargetProcessorDpc) 609 { 610 DbgPrint("IPRT: RTMpPoke => rtMpPokeCpuUsingDpc\n"); 611 g_pfnrtMpPokeCpuWorker = rtMpPokeCpuUsingDpc; 612 /* Windows XP should send always send an IPI -> VERIFY */ 613 } 609 614 else 610 DbgPrint("IPRT: RTMpPoke => rtMpPokeCpuUsingDpc\n"); 611 /* else: Windows XP should send always send an IPI -> VERIFY */ 615 { 616 DbgPrint("IPRT: RTMpPoke => rtMpPokeCpuUsingFailureNotSupported\n"); 617 Assert(pOsVerInfo->uMajorVer == 3 && pOsVerInfo->uMinorVer <= 50); 618 g_pfnrtMpPokeCpuWorker = rtMpPokeCpuUsingFailureNotSupported; 619 } 612 620 613 621 return VINF_SUCCESS; … … 1338 1346 RTErrConvertFromNtStatus(rcNt)); 1339 1347 } 1348 else if (g_pfnrtKeSetTargetProcessorDpc) 1349 g_pfnrtKeSetTargetProcessorDpc(pDpc, RTMpCpuIdToSetIndex(idCpu)); 1340 1350 else 1341 KeSetTargetProcessorDpc(pDpc, RTMpCpuIdToSetIndex(idCpu));1351 return VERR_NOT_SUPPORTED; 1342 1352 return VINF_SUCCESS; 1343 1353 } … … 1414 1424 { 1415 1425 KeInitializeDpc(&paExecCpuDpcs[0], rtmpNtDPCWrapper, pArgs); 1416 KeSetImportanceDpc(&paExecCpuDpcs[0], HighImportance); 1426 if (g_pfnrtKeSetImportanceDpc) 1427 g_pfnrtKeSetImportanceDpc(&paExecCpuDpcs[0], HighImportance); 1417 1428 rc = rtMpNtSetTargetProcessorDpc(&paExecCpuDpcs[0], idCpu); 1418 1429 pArgs->idCpu = idCpu; … … 1421 1432 { 1422 1433 KeInitializeDpc(&paExecCpuDpcs[0], rtmpNtDPCWrapper, pArgs); 1423 KeSetImportanceDpc(&paExecCpuDpcs[0], HighImportance); 1434 if (g_pfnrtKeSetImportanceDpc) 1435 g_pfnrtKeSetImportanceDpc(&paExecCpuDpcs[0], HighImportance); 1424 1436 rc = rtMpNtSetTargetProcessorDpc(&paExecCpuDpcs[0], idCpu); 1425 1437 pArgs->idCpu = idCpu; 1426 1438 1427 1439 KeInitializeDpc(&paExecCpuDpcs[1], rtmpNtDPCWrapper, pArgs); 1428 KeSetImportanceDpc(&paExecCpuDpcs[1], HighImportance); 1440 if (g_pfnrtKeSetImportanceDpc) 1441 g_pfnrtKeSetImportanceDpc(&paExecCpuDpcs[1], HighImportance); 1429 1442 if (RT_SUCCESS(rc)) 1430 1443 rc = rtMpNtSetTargetProcessorDpc(&paExecCpuDpcs[1], (int)idCpu2); … … 1438 1451 { 1439 1452 KeInitializeDpc(&paExecCpuDpcs[i], rtmpNtDPCWrapper, pArgs); 1440 KeSetImportanceDpc(&paExecCpuDpcs[i], HighImportance); 1453 if (g_pfnrtKeSetImportanceDpc) 1454 g_pfnrtKeSetImportanceDpc(&paExecCpuDpcs[i], HighImportance); 1441 1455 rc = rtMpNtSetTargetProcessorDpc(&paExecCpuDpcs[i], RTMpCpuIdFromSetIndex(i)); 1442 1456 } … … 1693 1707 KeInitializeEvent(&pArgs->DoneEvt, SynchronizationEvent, FALSE /* not signalled */); 1694 1708 KeInitializeDpc(&pArgs->Dpc, rtMpNtOnSpecificDpcWrapper, pArgs); 1695 KeSetImportanceDpc(&pArgs->Dpc, HighImportance); 1709 if (g_pfnrtKeSetImportanceDpc) 1710 g_pfnrtKeSetImportanceDpc(&pArgs->Dpc, HighImportance); 1696 1711 rc = rtMpNtSetTargetProcessorDpc(&pArgs->Dpc, idCpu); 1697 1712 if (RT_FAILURE(rc)) … … 1871 1886 } 1872 1887 1888 int rtMpPokeCpuUsingFailureNotSupported(RTCPUID idCpu) 1889 { 1890 NOREF(idCpu); 1891 return VERR_NOT_SUPPORTED; 1892 } 1873 1893 1874 1894 int rtMpPokeCpuUsingDpc(RTCPUID idCpu) … … 1887 1907 { 1888 1908 KeInitializeDpc(&s_aPokeDpcs[i], rtMpNtPokeCpuDummy, NULL); 1889 KeSetImportanceDpc(&s_aPokeDpcs[i], HighImportance); 1909 if (g_pfnrtKeSetImportanceDpc) 1910 g_pfnrtKeSetImportanceDpc(&s_aPokeDpcs[i], HighImportance); 1890 1911 int rc = rtMpNtSetTargetProcessorDpc(&s_aPokeDpcs[i], idCpu); 1891 1912 if (RT_FAILURE(rc)) … … 1901 1922 KeRaiseIrql(DISPATCH_LEVEL, &oldIrql); 1902 1923 1903 KeSetImportanceDpc(&s_aPokeDpcs[idCpu], HighImportance); 1904 KeSetTargetProcessorDpc(&s_aPokeDpcs[idCpu], (int)idCpu); 1924 if (g_pfnrtKeSetImportanceDpc) 1925 g_pfnrtKeSetImportanceDpc(&s_aPokeDpcs[idCpu], HighImportance); 1926 g_pfnrtKeSetTargetProcessorDpc(&s_aPokeDpcs[idCpu], (int)idCpu); 1905 1927 1906 1928 /* Assuming here that high importance DPCs will be delivered immediately; or at least an IPI will be sent immediately. -
trunk/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp
r69111 r70212 533 533 else 534 534 KeInitializeDpc(&pTimer->aSubTimers[iCpu].NtDpc, rtTimerNtOmniSlaveCallback, &pTimer->aSubTimers[iCpu]); 535 KeSetImportanceDpc(&pTimer->aSubTimers[iCpu].NtDpc, HighImportance); 535 if (g_pfnrtKeSetImportanceDpc) 536 g_pfnrtKeSetImportanceDpc(&pTimer->aSubTimers[iCpu].NtDpc, HighImportance); 536 537 rc = rtMpNtSetTargetProcessorDpc(&pTimer->aSubTimers[iCpu].NtDpc, iCpu); 537 538 } … … 548 549 549 550 KeInitializeDpc(&pTimer->aSubTimers[0].NtDpc, rtTimerNtSimpleCallback, pTimer); 550 KeSetImportanceDpc(&pTimer->aSubTimers[0].NtDpc, HighImportance); 551 if (g_pfnrtKeSetImportanceDpc) 552 g_pfnrtKeSetImportanceDpc(&pTimer->aSubTimers[0].NtDpc, HighImportance); 551 553 if (pTimer->fSpecificCpu) 552 554 rc = rtMpNtSetTargetProcessorDpc(&pTimer->aSubTimers[0].NtDpc, (int)pTimer->idCpu);
Note:
See TracChangeset
for help on using the changeset viewer.

