VirtualBox

Changeset 52871 in vbox


Ignore:
Timestamp:
Sep 26, 2014 3:12:49 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96295
Message:

HostDrivers/support: pick master based on Apic Id, use Apic Id to index and print deltas in tstGIP.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r52818 r52871  
    63566356
    63576357    /*
    6358      * Pick the first CPU online as the master TSC and make it the new GIP master.
     6358     * Pick the first CPU online as the master TSC and make it the new GIP master based
     6359     * on the APIC ID.
    63596360     *
    63606361     * Technically we can simply use "idGipMaster" but doing this gives us master as CPU 0
     
    63636364     */
    63646365    supdrvClearTscSamples(pGip, true /* fClearDeltas */);
    6365     for (iCpu = 0; iCpu < pGip->cCpus; iCpu++)
    6366     {
    6367         PSUPGIPCPU pGipCpu = &pGip->aCPUs[iCpu];
    6368         if (RTCpuSetIsMember(&pGip->OnlineCpuSet, pGipCpu->idCpu))
    6369         {
    6370             idxMaster = iCpu;
    6371             pGipCpu->i64TSCDelta = 0;
    6372             break;
     6366    for (iCpu = 0; iCpu < RT_ELEMENTS(pGip->aiCpuFromApicId); iCpu++)
     6367    {
     6368        uint16_t idxCpu = pGip->aiCpuFromApicId[iCpu];
     6369        if (idxCpu != UINT16_MAX)
     6370        {
     6371            PSUPGIPCPU pGipCpu = &pGip->aCPUs[idxCpu];
     6372            if (RTCpuSetIsMember(&pGip->OnlineCpuSet, pGipCpu->idCpu))
     6373            {
     6374                idxMaster = idxCpu;
     6375                pGipCpu->i64TSCDelta = 0;
     6376                break;
     6377            }
    63736378        }
    63746379    }
     
    66466651    pGip->idCpuMax              = RTMpGetMaxCpuId();
    66476652    for (i = 0; i < RT_ELEMENTS(pGip->aiCpuFromApicId); i++)
    6648         pGip->aiCpuFromApicId[i]    = 0;
     6653        pGip->aiCpuFromApicId[i]    = UINT16_MAX;
    66496654    for (i = 0; i < RT_ELEMENTS(pGip->aiCpuFromCpuSetIdx); i++)
    66506655        pGip->aiCpuFromCpuSetIdx[i] = UINT16_MAX;
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp

    r52718 r52871  
    162162            /* Display TSC deltas. */
    163163            RTPrintf("tstGIP-2: TSC deltas:\n");
    164             for (unsigned iCpu = 0; iCpu < g_pSUPGlobalInfoPage->cCpus; iCpu++)
    165                 RTPrintf("tstGIP-2: %6d: %lld\n", iCpu, g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta);
     164            RTPrintf("tstGIP-2: idApic: i64TSCDelta\n");
     165            for (unsigned i = 0; i < RT_ELEMENTS(g_pSUPGlobalInfoPage->aiCpuFromApicId); i++)
     166            {
     167                uint16_t iCpu = g_pSUPGlobalInfoPage->aiCpuFromApicId[i];
     168                if (iCpu != UINT16_MAX)
     169                {
     170                    RTPrintf("tstGIP-2: %6d: %lld\n", g_pSUPGlobalInfoPage->aCPUs[iCpu].idApic,
     171                             g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta);
     172                }
     173            }
    166174        }
    167175        else
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