VirtualBox

Changeset 36254 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 10, 2011 5:22:08 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70492
Message:

GIP,++: Lots of CPUs (disabled).

Location:
trunk/src/VBox/Runtime
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/time/timesupA.mac

    r36220 r36254  
    9595    mov     u32ApicIdPlus, ebx
    9696 %endif
    97     ; pGipCpu = &pGip->aCPU[u8ApicId];
     97    ; pGipCpu = &pGip->aCPU[pGip->aiCpuFromApicId[u8ApicId]];
    9898    shr     ebx, 24
     99 %ifdef SUP_WITH_LOTS_OF_CPUS
     100    movzx   ebx, word [esi + ebx * 2 + SUPGLOBALINFOPAGE.aiCpuFromApicId]
     101 %else
     102    and     ebx, SUPGLOBALINFOPAGE_CPUS - 1
     103 %endif
    99104    mov     eax, SUPGIPCPU_size
    100105    mul     ebx
     
    516521    mov     u32ApicIdPlus, ebx
    517522 %endif
    518     ; pGipCpu = &pGip->aCPU[u8ApicId];
     523    ; pGipCpu = &pGip->aCPU[pGip->aiCpuFromApicId[u8ApicId]];
    519524    shr     ebx, 24
     525 %ifdef SUP_WITH_LOTS_OF_CPUS
     526    movzx   eax, word [pGip + rbx * 2 + SUPGLOBALINFOPAGE.aiCpuFromApicId]
     527 %else
    520528    mov     eax, ebx
    521  %if SUPGLOBALINFOPAGE_CPUS < 256
    522529    and     eax, SUPGLOBALINFOPAGE_CPUS - 1
    523530 %endif
  • trunk/src/VBox/Runtime/common/time/timesupref.h

    r36220 r36254  
    6363
    6464#ifdef ASYNC_GIP
    65         uint8_t u8ApicId = ASMGetApicId();
    66 # if SUPGLOBALINFOPAGE_CPUS < 256
    67         PSUPGIPCPU pGipCpu = &pGip->aCPUs[u8ApicId & SUPGLOBALINFOPAGE_CPUS];
     65        uint8_t    u8ApicId = ASMGetApicId();
     66# ifdef SUP_WITH_LOTS_OF_CPUS
     67        PSUPGIPCPU pGipCpu = &pGip->aCPUs[pGip->aiCpuFromApicId[u8ApicId]];
    6868# else
    69         PSUPGIPCPU pGipCpu = &pGip->aCPUs[u8ApicId];
     69        PSUPGIPCPU pGipCpu = &pGip->aCPUs[u8ApicId & (SUPGLOBALINFOPAGE_CPUS - 1)];
    7070# endif
    7171#else
  • trunk/src/VBox/Runtime/generic/RTMpGetArraySize-generic.cpp

    r33676 r36254  
    55
    66/*
    7  * Copyright (C) 2010 Oracle Corporation
     7 * Copyright (C) 2010-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030*******************************************************************************/
    3131#include <iprt/mp.h>
     32#include "internal/iprt.h"
     33
     34#include <iprt/asm.h>
    3235#include <iprt/cpuset.h>
    33 #include "internal/iprt.h"
    3436
    3537
    3638RTDECL(uint32_t) RTMpGetArraySize(void)
    3739{
    38     RTCPUSET    CpuSet;
    39     return RTCpuLastIndex(RTMpGetSet(&CpuSet)) + 1;
     40    /*
     41     * Cache the result here.  This whole point of this function is that it
     42     * will always return the same value, so that should be safe.
     43     *
     44     * Note! Because RTCPUSET may be to small to represent all the CPUs, we
     45     *       check with RTMpGetCount() as well.
     46     */
     47    static uint32_t s_cMaxCpus = 0;
     48    uint32_t cCpus = s_cMaxCpus;
     49    if (RT_UNLIKELY(cCpus == 0))
     50    {
     51        RTCPUSET    CpuSet;
     52        uint32_t    cCpus1 = RTCpuLastIndex(RTMpGetSet(&CpuSet)) + 1;
     53        uint32_t    cCpus2 = RTMpGetCount();
     54        uint32_t    cCpus  = RT_MAX(cCpus1, cCpus2);
     55        ASMAtomicCmpXchgU32(&s_cMaxCpus, cCpus, 0);
     56        return cCpus;
     57    }
     58    return s_cMaxCpus;
     59
    4060}
    4161RT_EXPORT_SYMBOL(RTMpGetArraySize);
Note: See TracChangeset for help on using the changeset viewer.

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