VirtualBox

Changeset 36220 in vbox


Ignore:
Timestamp:
Mar 9, 2011 10:57:45 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70434
Message:

GIP: Force a couple of aCPUs accesses within bounds.

Location:
trunk
Files:
4 edited

Legend:

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

    r35855 r36220  
    135135typedef SUPGIPCPU *PSUPGIPCPU;
    136136
     137/** The number of CPUs covered by the GIP.
     138 * @remarks Must be a power of two! */
     139#define SUPGLOBALINFOPAGE_CPUS      32
     140
    137141/**
    138142 * Global Information Page.
     
    167171     * If u32Mode == SUPGIPMODE_ASYNC_TSC then the CPU ACPI ID is used as an
    168172     * index into the array. */
    169     SUPGIPCPU           aCPUs[32];
     173    SUPGIPCPU           aCPUs[SUPGLOBALINFOPAGE_CPUS];
    170174} SUPGLOBALINFOPAGE;
    171175AssertCompile(sizeof(SUPGLOBALINFOPAGE) <= 0x1000);
  • trunk/include/VBox/sup.mac

    r28800 r36220  
    2828%define ___VBox_sup_mac
    2929
     30%define SUPGLOBALINFOPAGE_CPUS  32
    3031
    3132struc SUPGIPCPU
     
    5253    .u64NanoTSLastUpdateHz      resq 1
    5354    .au32Padding1               resd 56
    54     .aCPUs                      resb (SUPGIPCPU_size*32)
     55    .aCPUs                      resb (SUPGIPCPU_size*SUPGLOBALINFOPAGE_CPUS)
    5556endstruc
    5657
  • trunk/src/VBox/Runtime/common/time/timesupA.mac

    r33540 r36220  
    518518    ; pGipCpu = &pGip->aCPU[u8ApicId];
    519519    shr     ebx, 24
    520     mov     eax, SUPGIPCPU_size
    521     mul     ebx
     520    mov     eax, ebx
     521 %if SUPGLOBALINFOPAGE_CPUS < 256
     522    and     eax, SUPGLOBALINFOPAGE_CPUS - 1
     523 %endif
     524    imul    eax, SUPGIPCPU_size
    522525    lea     pGipCPU, [pGip + rax + SUPGLOBALINFOPAGE.aCPUs]
    523526%else
  • trunk/src/VBox/Runtime/common/time/timesupref.h

    r33540 r36220  
    6464#ifdef ASYNC_GIP
    6565        uint8_t u8ApicId = ASMGetApicId();
     66# if SUPGLOBALINFOPAGE_CPUS < 256
     67        PSUPGIPCPU pGipCpu = &pGip->aCPUs[u8ApicId & SUPGLOBALINFOPAGE_CPUS];
     68# else
    6669        PSUPGIPCPU pGipCpu = &pGip->aCPUs[u8ApicId];
     70# endif
    6771#else
    6872        PSUPGIPCPU pGipCpu = &pGip->aCPUs[0];
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