VirtualBox

Changeset 91266 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Sep 15, 2021 10:26:50 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146925
Message:

VMM/CPUM: Moved CPUIDs and MSRs from the hyper heap and into the VM structure (might not be such a great idea for MSRs actually). bugref:10093

Location:
trunk/src/VBox/VMM/VMMAll
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp

    r85183 r91266  
    55175517     * Binary lookup.
    55185518     */
    5519     uint32_t        cRanges   = pVM->cpum.s.GuestInfo.cMsrRanges;
     5519    uint32_t        cRanges   = RT_MIN(pVM->cpum.s.GuestInfo.cMsrRanges, RT_ELEMENTS(pVM->cpum.s.GuestInfo.aMsrRanges));
    55205520    if (!cRanges)
    55215521        return NULL;
    5522     PCPUMMSRRANGE   paRanges  = pVM->cpum.s.GuestInfo.CTX_SUFF(paMsrRanges);
     5522    PCPUMMSRRANGE   paRanges  = pVM->cpum.s.GuestInfo.aMsrRanges;
    55235523    for (;;)
    55245524    {
     
    55505550     * Linear lookup to verify the above binary search.
    55515551     */
    5552     uint32_t        cLeft = pVM->cpum.s.GuestInfo.cMsrRanges;
    5553     PCPUMMSRRANGE   pCur  = pVM->cpum.s.GuestInfo.CTX_SUFF(paMsrRanges);
     5552    uint32_t        cLeft = RT_MIN(pVM->cpum.s.GuestInfo.cMsrRanges, RT_ELEMENTS(pVM->cpum.s.GuestInfo.aMsrRanges));
     5553    PCPUMMSRRANGE   pCur  = pVM->cpum.s.GuestInfo.aMsrRanges;
    55545554    while (cLeft-- > 0)
    55555555    {
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r91037 r91266  
    781781PCPUMCPUIDLEAF cpumCpuIdGetLeaf(PVM pVM, uint32_t uLeaf)
    782782{
    783     unsigned            iEnd     = pVM->cpum.s.GuestInfo.cCpuIdLeaves;
     783    unsigned            iEnd     = RT_MIN(pVM->cpum.s.GuestInfo.cCpuIdLeaves, RT_ELEMENTS(pVM->cpum.s.GuestInfo.aCpuIdLeaves));
    784784    if (iEnd)
    785785    {
    786786        unsigned        iStart   = 0;
    787         PCPUMCPUIDLEAF  paLeaves = pVM->cpum.s.GuestInfo.CTX_SUFF(paCpuIdLeaves);
     787        PCPUMCPUIDLEAF  paLeaves = pVM->cpum.s.GuestInfo.aCpuIdLeaves;
    788788        for (;;)
    789789        {
     
    838838PCPUMCPUIDLEAF cpumCpuIdGetLeafEx(PVM pVM, uint32_t uLeaf, uint32_t uSubLeaf, bool *pfExactSubLeafHit)
    839839{
    840     unsigned            iEnd     = pVM->cpum.s.GuestInfo.cCpuIdLeaves;
     840    unsigned            iEnd     = RT_MIN(pVM->cpum.s.GuestInfo.cCpuIdLeaves, RT_ELEMENTS(pVM->cpum.s.GuestInfo.aCpuIdLeaves));
    841841    if (iEnd)
    842842    {
    843843        unsigned        iStart   = 0;
    844         PCPUMCPUIDLEAF  paLeaves = pVM->cpum.s.GuestInfo.CTX_SUFF(paCpuIdLeaves);
     844        PCPUMCPUIDLEAF  paLeaves = pVM->cpum.s.GuestInfo.aCpuIdLeaves;
    845845        for (;;)
    846846        {
  • trunk/src/VBox/VMM/VMMAll/MMAllHyper.cpp

    r90991 r91266  
    338338
    339339
     340#if 0
    340341/**
    341342 * Duplicates a block of memory.
     
    359360    return rc;
    360361}
     362#endif
    361363
    362364
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