VirtualBox

Changeset 40360 in vbox for trunk


Ignore:
Timestamp:
Mar 5, 2012 3:41:22 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76651
Message:

Do not try to run unreal mode code as V86 in VT-x.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r40356 r40360  
    14531453                    pCtx->gsHid.Attr.n.u2Dpl  = 0;
    14541454                    pCtx->ssHid.Attr.n.u2Dpl  = 0;
    1455 
    1456                     /* The limit must correspond to the 32 bits setting. */
    1457                     if (!pCtx->csHid.Attr.n.u1DefBig)
    1458                         pCtx->csHid.u32Limit &= 0xffff;
    1459                     if (!pCtx->dsHid.Attr.n.u1DefBig)
    1460                         pCtx->dsHid.u32Limit &= 0xffff;
    1461                     if (!pCtx->esHid.Attr.n.u1DefBig)
    1462                         pCtx->esHid.u32Limit &= 0xffff;
    1463                     if (!pCtx->fsHid.Attr.n.u1DefBig)
    1464                         pCtx->fsHid.u32Limit &= 0xffff;
    1465                     if (!pCtx->gsHid.Attr.n.u1DefBig)
    1466                         pCtx->gsHid.u32Limit &= 0xffff;
    1467                     if (!pCtx->ssHid.Attr.n.u1DefBig)
    1468                         pCtx->ssHid.u32Limit &= 0xffff;
    1469                 }
    1470                 else
    1471                 /* Switching from protected mode to real mode. */
    1472                 if (    pVCpu->hwaccm.s.vmx.enmLastSeenGuestMode >= PGMMODE_PROTECTED
    1473                     &&  enmGuestMode == PGMMODE_REAL)
    1474                 {
    1475                     /* The limit must also be set to 0xffff. */
    1476                     pCtx->csHid.u32Limit = 0xffff;
    1477                     pCtx->dsHid.u32Limit = 0xffff;
    1478                     pCtx->esHid.u32Limit = 0xffff;
    1479                     pCtx->fsHid.u32Limit = 0xffff;
    1480                     pCtx->gsHid.u32Limit = 0xffff;
    1481                     pCtx->ssHid.u32Limit = 0xffff;
    1482 
    1483                     Assert(pCtx->csHid.u64Base <= 0xfffff);
    1484                     Assert(pCtx->dsHid.u64Base <= 0xfffff);
    1485                     Assert(pCtx->esHid.u64Base <= 0xfffff);
    1486                     Assert(pCtx->fsHid.u64Base <= 0xfffff);
    1487                     Assert(pCtx->gsHid.u64Base <= 0xfffff);
    14881455                }
    14891456                pVCpu->hwaccm.s.vmx.enmLastSeenGuestMode = enmGuestMode;
  • trunk/src/VBox/VMM/VMMR3/HWACCM.cpp

    r40280 r40360  
    22812281                if (   (   pCtx->cs != (pCtx->csHid.u64Base >> 4)
    22822282                        && pCtx->csHid.u64Base != 0xffff0000 /* we can deal with the BIOS code as it's also mapped into the lower region. */)
     2283                    || (pCtx->csHid.u32Limit != 0xffff)
     2284                    || (pCtx->dsHid.u32Limit != 0xffff)
     2285                    || (pCtx->esHid.u32Limit != 0xffff)
     2286                    || (pCtx->ssHid.u32Limit != 0xffff)
     2287                    || (pCtx->fsHid.u32Limit != 0xffff)
     2288                    || (pCtx->gsHid.u32Limit != 0xffff)
    22832289                    || pCtx->ds != (pCtx->dsHid.u64Base >> 4)
    22842290                    || pCtx->es != (pCtx->esHid.u64Base >> 4)
  • trunk/src/recompiler/target-i386/translate.c

    r39961 r40360  
    25632563    tcg_gen_st_tl(cpu_T[0], cpu_env,
    25642564                  offsetof(CPUX86State,segs[seg_reg].base));
    2565 #ifdef VBOX
    2566     int flags = DESC_P_MASK | DESC_S_MASK | DESC_W_MASK;
    2567     if (seg_reg == R_CS)
    2568         flags |= DESC_CS_MASK;
    2569     gen_op_movl_T0_im(flags);
    2570     tcg_gen_st32_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,segs[seg_reg].flags));
    2571 
    2572     /* Set the limit to 0xffff. */
    2573     gen_op_movl_T0_im(0xffff);
    2574     tcg_gen_st32_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,segs[seg_reg].limit));
    2575 #endif
    25762565}
    25772566
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