VirtualBox

Changeset 36262 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Mar 11, 2011 2:50:45 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70526
Message:

SUPDrv,IPRT,++: Enabled the code for supporting up to 256 host CPUs/cores/threads.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r36254 r36262  
    8888} SUPPAGINGMODE;
    8989
    90 #ifdef SUP_WITH_LOTS_OF_CPUS
    91 # ifndef RT_WITH_LOTS_OF_CPUS
    92 #  error "RT_WITH_LOTS_OF_CPUS must be defined with SUP_WITH_LOTS_OF_CPUS"
    93 # endif
    94 #endif
    9590
    9691/**
     
    147142
    148143    /** Reserved for future per processor data. */
    149 #ifdef SUP_WITH_LOTS_OF_CPUS
    150144    volatile uint32_t   au32Reserved[5+5];
    151 #else
    152     volatile uint32_t   au32Reserved[5];
    153 #endif
    154145
    155146    /** @todo Add topology/NUMA info. */
    156 #ifdef SUP_WITH_LOTS_OF_CPUS
    157147    /** The CPU state. */
    158148    SUPGIPCPUSTATE volatile enmState;
     
    163153    /** The APIC ID of this CPU. */
    164154    uint16_t                idApic;
    165 #endif
    166155} SUPGIPCPU;
    167 #ifdef SUP_WITH_LOTS_OF_CPUS
    168156AssertCompileSize(RTCPUID, 4);
    169157AssertCompileSize(SUPGIPCPU, 128);
    170 #else
    171 AssertCompileSize(SUPGIPCPU, 96);
    172 #endif
    173158AssertCompileMemberAlignment(SUPGIPCPU, u64NanoTS, 8);
    174159AssertCompileMemberAlignment(SUPGIPCPU, u64TSC, 8);
     
    179164
    180165
    181 
    182 #ifndef SUP_WITH_LOTS_OF_CPUS
    183 /** The number of CPUs covered by the GIP.
    184  * @remarks Must be a power of two! */
    185 # define SUPGLOBALINFOPAGE_CPUS     32
    186 #endif
    187166
    188167/**
     
    202181    /** The GIP update mode, see SUPGIPMODE. */
    203182    uint32_t            u32Mode;
    204 #ifdef SUP_WITH_LOTS_OF_CPUS
    205183    /** The number of entries in the CPU table.
    206184     * (This can work as RTMpGetArraySize().)  */
     
    208186    /** The size of the GIP in pages. */
    209187    uint16_t            cPages;
    210 #else
    211     /** Reserved / padding. */
    212     uint32_t            u32Padding0;
    213 #endif
    214188    /** The update frequency of the of the NanoTS. */
    215189    volatile uint32_t   u32UpdateHz;
     
    218192    /** The timestamp of the last time we update the update frequency. */
    219193    volatile uint64_t   u64NanoTSLastUpdateHz;
    220 #ifdef SUP_WITH_LOTS_OF_CPUS
    221194    /** The set of online CPUs. */
    222195    RTCPUSET            OnlineCpuSet;
    223     /** The number of CPUs that are online. */
    224     volatile uint32_t   cOnlineCpus;
    225     /** The number of CPUs present in the system. */
    226     volatile uint32_t   cPresentCpus;
    227196    /** The set of present CPUs. */
    228197    RTCPUSET            PresentCpuSet;
    229198    /** The set of possible CPUs. */
    230199    RTCPUSET            PossibleCpuSet;
     200    /** The number of CPUs that are online. */
     201    volatile uint16_t   cOnlineCpus;
     202    /** The number of CPUs present in the system. */
     203    volatile uint16_t   cPresentCpus;
    231204    /** The highest number of CPUs possible. */
    232     uint32_t            cPossibleCpus;
     205    uint16_t            cPossibleCpus;
     206    /** The highest number of CPUs possible. */
     207    uint16_t            u16Padding0;
    233208    /** The max CPU ID (RTMpGetMaxCpuId). */
    234209    RTCPUID             idCpuMax;
    235 #endif
    236210
    237211    /** Padding / reserved space for future data. */
    238 #ifdef SUP_WITH_LOTS_OF_CPUS
    239     uint32_t            au32Padding1[28];
    240 #else
    241     uint32_t            au32Padding1[56];
    242 #endif
    243 
    244 #ifdef SUP_WITH_LOTS_OF_CPUS
     212    uint32_t            au32Padding1[29];
     213
    245214    /** Table indexed by the CPU APIC ID to get the CPU table index. */
    246     uint16_t             aiCpuFromApicId[256];
     215    uint16_t            aiCpuFromApicId[256];
    247216    /** CPU set index to CPU table index. */
    248     uint16_t             aiCpuFromCpuSetIdx[RTCPUSET_MAX_CPUS];
    249 #endif
    250 
    251 #ifdef SUP_WITH_LOTS_OF_CPUS
     217    uint16_t            aiCpuFromCpuSetIdx[RTCPUSET_MAX_CPUS];
     218
    252219    /** Array of per-cpu data.
    253220     * This is index by ApicId via the aiCpuFromApicId table.
     
    257224     * entry is updated. */
    258225    SUPGIPCPU           aCPUs[1];
    259 #else
    260     /** Array of per-cpu data.
    261      * If u32Mode == SUPGIPMODE_SYNC_TSC then only the first entry is used.
    262      * If u32Mode == SUPGIPMODE_ASYNC_TSC then the CPU ACPI ID is used as an
    263      * index into the array. */
    264     SUPGIPCPU           aCPUs[SUPGLOBALINFOPAGE_CPUS];
    265 #endif
    266226} SUPGLOBALINFOPAGE;
    267 #ifndef SUP_WITH_LOTS_OF_CPUS
    268 AssertCompile(sizeof(SUPGLOBALINFOPAGE) <= 0x1000);
    269 #endif
    270 #ifdef SUP_WITH_LOTS_OF_CPUS
    271227AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, u64NanoTSLastUpdateHz, 8);
    272228AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, aCPUs[0], 256);
    273229AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, aCPUs[1], 128);
    274 #endif
    275230
    276231/** Pointer to the global info page.
     
    284239 * Upper 16 bits is the major version. Major version is only changed with
    285240 * incompatible changes in the GIP. */
    286 #ifdef SUP_WITH_LOTS_OF_CPUS
    287 # define SUPGLOBALINFOPAGE_VERSION   0x00030000
    288 #else
    289 # define SUPGLOBALINFOPAGE_VERSION   0x00020000
    290 #endif
     241#define SUPGLOBALINFOPAGE_VERSION   0x00030000
    291242
    292243/**
     
    369320    else
    370321    {
    371 # ifdef SUP_WITH_LOTS_OF_CPUS
    372322        iCpu = pGip->aiCpuFromApicId[ASMGetApicId()];
    373323        if (iCpu >= pGip->cCpus)
    374324            return UINT64_MAX;
    375 # else
    376         iCpu = ASMGetApicId();
    377         if (RT_UNLIKELY(iCpu >= RT_ELEMENTS(pGip->aCPUs)))
    378             return UINT64_MAX;
    379 # endif
    380325    }
    381326
  • trunk/include/VBox/sup.mac

    r36254 r36262  
    2828%define ___VBox_sup_mac
    2929
    30 %ifndef SUP_WITH_LOTS_OF_CPUS
    31  %define SUPGLOBALINFOPAGE_CPUS 32
    32 %endif
    33 
    3430struc SUPGIPCPU
    3531    .u32TransactionId           resd 1
     
    4238    .au32TSCHistory             resd 8
    4339    .u32PrevUpdateIntervalNS    resd 1
    44 %ifdef SUP_WITH_LOTS_OF_CPUS
    4540    .au32Reserved               resd (5+5)
    4641    .enmState                   resd 1
     
    4843    .iCpuSet                    resw 1
    4944    .idApic                     resw 1
    50 %else
    51     .au32Reserved               resd 5
    52 %endif
    5345endstruc
    5446
     
    5850    .u32Version                 resd 1
    5951    .u32Mode                    resd 1
    60 %ifdef SUP_WITH_LOTS_OF_CPUS
    6152    .cCpus                      resw 1
    6253    .cPages                     resw 1
    63 %else
    64     .u32Padding0                resd 1
    65 %endif
    6654    .u32UpdateHz                resd 1
    6755    .u32UpdateIntervalNS        resd 1
    6856    .u64NanoTSLastUpdateHz      resq 1
    69 %ifdef SUP_WITH_LOTS_OF_CPUS
    7057    .OnlineCpuSet               resq 4
    71     .cOnlineCpus                resd 1
    72     .cPresentCpus               resd 1
    7358    .PresentCpuSet              resq 4
    7459    .PossibleCpuSet             resq 4
    75     .cPossibleCpus              resd 1
     60    .cOnlineCpus                resw 1
     61    .cPresentCpus               resw 1
     62    .cPossibleCpus              resw 1
     63    .u16Padding0                resw 1
    7664    .idCpuMax                   resd 1
    77     .au32Padding1               resd 28
     65    .au32Padding1               resd 29
    7866    .aiCpuFromApicId            resw 256
    7967    .aiCpuFromCpuSetIdx         resw 256
    8068    .aCPUs                      resb SUPGIPCPU_size
    81 %else
    82     .au32Padding1               resd 56
    83     .aCPUs                      resb (SUPGIPCPU_size*SUPGLOBALINFOPAGE_CPUS)
    84 %endif
    8569endstruc
    8670
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