VirtualBox

Ignore:
Timestamp:
Dec 11, 2021 1:38:33 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/timer-r0drv-nt.cpp,mp-r0drv-nt.cpp: Work around rtMpNtSetTargetProcessorDpc failure on systems with sparse CPU ID assignments (like on testboxmem1). For timers, if the function fails for an offline CPU, just defer the DPC setup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp

    r92871 r92873  
    13501350 *
    13511351 * @returns IPRT status code (errors are asserted).
     1352 * @retval  VERR_CPU_NOT_FOUND if impossible CPU. Not asserted.
    13521353 * @param   pDpc                The DPC.
    13531354 * @param   idCpu               The ID of the new target CPU.
     1355 * @note    Callable at any IRQL.
    13541356 */
    13551357DECLHIDDEN(int) rtMpNtSetTargetProcessorDpc(KDPC *pDpc, RTCPUID idCpu)
     
    13611363        PROCESSOR_NUMBER ProcNum;
    13621364        NTSTATUS rcNt = g_pfnrtKeGetProcessorNumberFromIndex(RTMpCpuIdToSetIndex(idCpu), &ProcNum);
    1363         AssertLogRelMsgReturn(NT_SUCCESS(rcNt), ("KeGetProcessorNumberFromIndex(%u) -> %#x\n", idCpu, rcNt),
    1364                               RTErrConvertFromNtStatus(rcNt));
    1365 
    1366         rcNt = g_pfnrtKeSetTargetProcessorDpcEx(pDpc, &ProcNum);
    1367         AssertLogRelMsgReturn(NT_SUCCESS(rcNt),
    1368                               ("KeSetTargetProcessorDpcEx(,%u(%u/%u)) -> %#x\n", idCpu, ProcNum.Group, ProcNum.Number, rcNt),
    1369                               RTErrConvertFromNtStatus(rcNt));
     1365        if (NT_SUCCESS(rcNt))
     1366        {
     1367            rcNt = g_pfnrtKeSetTargetProcessorDpcEx(pDpc, &ProcNum);
     1368            AssertLogRelMsgReturn(NT_SUCCESS(rcNt),
     1369                                  ("KeSetTargetProcessorDpcEx(,%u(%u/%u)) -> %#x\n", idCpu, ProcNum.Group, ProcNum.Number, rcNt),
     1370                                  RTErrConvertFromNtStatus(rcNt));
     1371        }
     1372        else if (rcNt == STATUS_INVALID_PARAMETER)
     1373            return VERR_CPU_NOT_FOUND;
     1374        else
     1375            AssertLogRelMsgReturn(NT_SUCCESS(rcNt), ("KeGetProcessorNumberFromIndex(%u) -> %#x\n", idCpu, rcNt),
     1376                                  RTErrConvertFromNtStatus(rcNt));
     1377
    13701378    }
    13711379    else if (g_pfnrtKeSetTargetProcessorDpc)
     
    19361944                g_pfnrtKeSetImportanceDpc(&s_aPokeDpcs[i], HighImportance);
    19371945            int rc = rtMpNtSetTargetProcessorDpc(&s_aPokeDpcs[i], idCpu);
    1938             if (RT_FAILURE(rc))
     1946            if (RT_FAILURE(rc) && rc != VERR_CPU_NOT_FOUND)
    19391947                return rc;
    19401948        }
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