VirtualBox

Ignore:
Timestamp:
Jul 26, 2012 11:48:01 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79529
Message:

VMM: Fixed some selector arithmetic, introducing a new constand and renaming and old one to make things clearer. Also added CPUMGetGuestLdtrEx and make some (but not all) of SELM use this instead of shadow GDT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMRC/SELMRC.cpp

    r42407 r42427  
    9595     */
    9696    RTSEL   Sel = iGDTEntry << X86_SEL_SHIFT;
    97     Assert(   !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS] & ~X86_SEL_MASK)
    98            && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS] & ~X86_SEL_MASK)
    99            && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64] & ~X86_SEL_MASK)
    100            && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS] & ~X86_SEL_MASK)
    101            && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] & ~X86_SEL_MASK));
     97    Assert(   !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS]         & ~X86_SEL_MASK_OFF_RPL)
     98           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]         & ~X86_SEL_MASK_OFF_RPL)
     99           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS64]       & ~X86_SEL_MASK_OFF_RPL)
     100           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS]        & ~X86_SEL_MASK_OFF_RPL)
     101           && !(pVM->selm.s.aHyperSel[SELM_HYPER_SEL_TSS_TRAP08] & ~X86_SEL_MASK_OFF_RPL));
    102102    if (    pVM->selm.s.aHyperSel[SELM_HYPER_SEL_CS]         == Sel
    103103        ||  pVM->selm.s.aHyperSel[SELM_HYPER_SEL_DS]         == Sel
     
    137137    for (unsigned iSReg = 0; iSReg <= X86_SREG_COUNT; iSReg++)
    138138    {
    139         if (Sel == (paSReg[iSReg].Sel & X86_SEL_MASK_RPL))
     139        if (Sel == (paSReg[iSReg].Sel & X86_SEL_MASK_OFF_RPL))
    140140        {
    141141            if (CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &paSReg[iSReg]))
     
    200200    for (unsigned iSReg = 0; iSReg <= X86_SREG_COUNT; iSReg++)
    201201    {
    202         if (iGDTEntry == (paSReg[iSReg].Sel & X86_SEL_MASK_RPL))
     202        if (iGDTEntry == (paSReg[iSReg].Sel & X86_SEL_MASK_OFF_RPL))
    203203        {
    204204            if (!CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &paSReg[iSReg]))
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