VirtualBox

Changeset 12404 in vbox for trunk/src


Ignore:
Timestamp:
Sep 11, 2008 2:58:38 PM (16 years ago)
Author:
vboxsync
Message:

Cut off calculated addresses when not in 64 bits mode. (fixes OS/2 guests #3115)

File:
1 edited

Legend:

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

    r10171 r12404  
    127127        }
    128128    }
    129     return (RTGCPTR)(pHiddenSel->u64Base + (RTGCUINTPTR)Addr);
     129    /* AMD64 manual: compatibility mode ignores the high 32 bits when calculating an effective address. */
     130    Assert(pHiddenSel->u64Base <= 0xffffffff);
     131    return ((pHiddenSel->u64Base + (RTGCUINTPTR)Addr) & 0xffffffff);
    130132}
    131133
     
    208210        }
    209211        else
    210             pvFlat = (RTGCPTR)(pHiddenSel->u64Base + (RTGCUINTPTR)Addr);
     212        {
     213            /* AMD64 manual: compatibility mode ignores the high 32 bits when calculating an effective address. */
     214            Assert(pHiddenSel->u64Base <= 0xffffffff);
     215            pvFlat = (RTGCPTR)((pHiddenSel->u64Base + (RTGCUINTPTR)Addr) & 0xffffffff);
     216        }
    211217
    212218        /*
     
    489495        u32Limit      = pHiddenSel->u32Limit;
    490496        pvFlat        = (RTGCPTR)(pHiddenSel->u64Base + (RTGCUINTPTR)Addr);
     497
     498        if (   !CPUMIsGuestInLongMode(pVM)
     499            || !pHiddenSel->Attr.n.u1Long)
     500        {
     501            /* AMD64 manual: compatibility mode ignores the high 32 bits when calculating an effective address. */
     502            pvFlat &= 0xffffffff;
     503        }
    491504    }
    492505    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