VirtualBox

儲存庫 vbox 的更動 37231


忽略:
時間撮記:
2011-5-27 上午11:28:52 (13 年 以前)
作者:
vboxsync
訊息:

HWACCMR0: Fixed bug in HWACCMR0EnableAllCpus, the current CPU is always possible. :-) Some nits and cleanup.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp

    r37062 r37231  
    5151static bool               hwaccmR0IsSubjectToVmxPreemptionTimerErratum(void);
    5252static DECLCALLBACK(void) hwaccmR0PowerCallback(RTPOWEREVENT enmEvent, void *pvUser);
    53 static DECLCALLBACK(void) hwaccmR0CpuCallback(RTMPEVENT enmEvent, RTCPUID idCpu, void *pvData);
     53static DECLCALLBACK(void) hwaccmR0MpEventCallback(RTMPEVENT enmEvent, RTCPUID idCpu, void *pvData);
    5454
    5555/*******************************************************************************
     
    499499    if (!HWACCMR0Globals.vmx.fUsingSUPR0EnableVTx)
    500500    {
    501         rc = RTMpNotificationRegister(hwaccmR0CpuCallback, 0);
     501        rc = RTMpNotificationRegister(hwaccmR0MpEventCallback, NULL);
    502502        AssertRC(rc);
    503503
    504         rc = RTPowerNotificationRegister(hwaccmR0PowerCallback, 0);
     504        rc = RTPowerNotificationRegister(hwaccmR0PowerCallback, NULL);
    505505        AssertRC(rc);
    506506    }
     
    580580        {
    581581            /* Doesn't really matter if this fails. */
    582             rc = RTMpNotificationDeregister(hwaccmR0CpuCallback, 0);
    583             AssertRC(rc);
    584             rc = RTPowerNotificationDeregister(hwaccmR0PowerCallback, 0);
    585             AssertRC(rc);
     582            rc = RTMpNotificationDeregister(hwaccmR0MpEventCallback, NULL);  AssertRC(rc);
     583            rc = RTPowerNotificationDeregister(hwaccmR0PowerCallback, NULL); AssertRC(rc);
    586584        }
    587585        else
     
    603601
    604602        /* Free the per-cpu pages used for VT-x and AMD-V */
    605         for (unsigned i=0;i<RT_ELEMENTS(HWACCMR0Globals.aCpuInfo);i++)
     603        for (unsigned i = 0; i < RT_ELEMENTS(HWACCMR0Globals.aCpuInfo); i++)
    606604        {
    607605            if (HWACCMR0Globals.aCpuInfo[i].pMemObj != NIL_RTR0MEMOBJ)
     
    735733        {
    736734            /* Allocate one page per cpu for the global vt-x and amd-v pages */
    737             for (unsigned i=0;i<RT_ELEMENTS(HWACCMR0Globals.aCpuInfo);i++)
     735            for (unsigned i = 0; i < RT_ELEMENTS(HWACCMR0Globals.aCpuInfo); i++)
    738736            {
    739737                Assert(!HWACCMR0Globals.aCpuInfo[i].pMemObj);
    740738
    741                 if (RTMpIsCpuPossible(RTMpCpuId()))
     739                if (RTMpIsCpuPossible(RTMpCpuIdFromSetIndex(i)))
    742740                {
    743741                    rc = RTR0MemObjAllocCont(&HWACCMR0Globals.aCpuInfo[i].pMemObj, 1 << PAGE_SHIFT, true /* executable R0 mapping */);
     
    805803    if (!pCpu->pMemObj)
    806804    {
    807         LogRel(("HWACCMR0: hwaccmR0EnableCpu failed idCpu=%d.\n", idCpu));
    808         AssertFailed();
     805        AssertLogRelMsgFailed(("hwaccmR0EnableCpu failed idCpu=%u.\n", idCpu));
    809806        return VERR_INTERNAL_ERROR;
    810807    }
     
    900897 * @param   pvData              Opaque data (PVM pointer).
    901898 */
    902 static DECLCALLBACK(void) hwaccmR0CpuCallback(RTMPEVENT enmEvent, RTCPUID idCpu, void *pvData)
     899static DECLCALLBACK(void) hwaccmR0MpEventCallback(RTMPEVENT enmEvent, RTCPUID idCpu, void *pvData)
    903900{
    904901    /*
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette