VirtualBox

Ignore:
Timestamp:
Jun 24, 2012 3:44:03 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
78759
Message:

CPUM: Combined the visible and hidden selector register data into one structure. Preparing for lazily resolving+caching of hidden registers in raw-mode.

File:
1 edited

Legend:

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

    r41830 r41906  
    384384#else
    385385/** @todo Get the CPU mode as well while we're at it! */
    386     int rc = SELMValidateAndConvertCSAddr(pVCpu, pCtxCore->eflags, pCtxCore->ss, pCtxCore->cs,
    387                                           &pCtxCore->csHid, pCtxCore->rip, &GCPtrInstr);
     386    int rc = SELMValidateAndConvertCSAddr(pVCpu, pCtxCore->eflags, pCtxCore->ss.Sel, pCtxCore->cs.Sel,
     387                                          &pCtxCore->cs, pCtxCore->rip, &GCPtrInstr);
    388388#endif
    389389    if (RT_FAILURE(rc))
    390390    {
    391391        Log(("EMInterpretDisasOne: Failed to convert %RTsel:%RGv (cpl=%d) - rc=%Rrc !!\n",
    392              pCtxCore->cs, (RTGCPTR)pCtxCore->rip, pCtxCore->ss & X86_SEL_RPL, rc));
     392             pCtxCore->cs.Sel, (RTGCPTR)pCtxCore->rip, pCtxCore->ss.Sel & X86_SEL_RPL, rc));
    393393        return rc;
    394394    }
     
    415415                                   PDISCPUSTATE pDis, unsigned *pcbInstr)
    416416{
    417     DISCPUMODE enmCpuMode = SELMGetCpuModeFromSelector(pVCpu, pCtxCore->eflags, pCtxCore->cs, (PCPUMSELREGHID)&pCtxCore->csHid);
     417    DISCPUMODE enmCpuMode = SELMGetCpuModeFromSelector(pVCpu, pCtxCore->eflags, pCtxCore->cs.Sel, (PCPUMSELREGHID)&pCtxCore->cs);
    418418    /** @todo Deal with too long instruction (=> \#GP), opcode read errors (=>
    419419     *        \#PF, \#GP, \#??), undefined opcodes (=> \#UD), and such. */
     
    461461        uint32_t     cbOp;
    462462        PDISCPUSTATE pDis = &pVCpu->em.s.DisState;
    463         pDis->uCpuMode = SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid);
     463        pDis->uCpuMode = SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->cs.Sel, &pRegFrame->cs);
    464464        rc = emDisCoreOne(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, (RTGCUINTPTR)pbCode, &cbOp);
    465465        if (RT_SUCCESS(rc))
     
    515515        uint32_t     cbOp;
    516516        PDISCPUSTATE pDis = &pVCpu->em.s.DisState;
    517         pDis->uCpuMode = SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid);
     517        pDis->uCpuMode = SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->cs.Sel, &pRegFrame->cs);
    518518        rc = emDisCoreOne(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, (RTGCUINTPTR)pbCode, &cbOp);
    519519        if (RT_SUCCESS(rc))
     
    625625    AssertRCReturn(rc, VERR_EM_INTERPRETER);
    626626
    627     pRegFrame->eip = eip & 0xffff;
    628     pRegFrame->cs  = cs;
     627    pRegFrame->eip    = eip & 0xffff;
     628    pRegFrame->cs.Sel = cs;
    629629
    630630    /* Mask away all reserved bits */
     
    635635    Assert((pRegFrame->eflags.u32 & (X86_EFL_IF|X86_EFL_IOPL)) == X86_EFL_IF);
    636636
    637     pRegFrame->esp = esp;
    638     pRegFrame->ss  = ss;
    639     pRegFrame->ds  = ds;
    640     pRegFrame->es  = es;
    641     pRegFrame->fs  = fs;
    642     pRegFrame->gs  = gs;
     637    pRegFrame->esp      = esp;
     638    pRegFrame->ss.Sel   = ss;
     639    pRegFrame->ds.Sel   = ds;
     640    pRegFrame->es.Sel   = es;
     641    pRegFrame->fs.Sel   = fs;
     642    pRegFrame->gs.Sel   = gs;
    643643
    644644    return VINF_SUCCESS;
     
    926926            {
    927927                /* Illegal to have an active 64 bits CS selector (AMD Arch. Programmer's Manual Volume 2: Table 14-5) */
    928                 if (pRegFrame->csHid.Attr.n.u1Long)
     928                if (pRegFrame->cs.Attr.n.u1Long)
    929929                {
    930930                    AssertMsgFailed(("Illegal enabling of paging with CS.u1Long = 1!!\n"));
     
    15351535
    15361536            /* Read stack value first */
    1537             if (SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->ss, &pRegFrame->ssHid) == DISCPUMODE_16BIT)
     1537            if (SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->ss.Sel, &pRegFrame->ss) == DISCPUMODE_16BIT)
    15381538                return VERR_EM_INTERPRETER; /* No legacy 16 bits stuff here, please. */
    15391539
     
    22022202    if (!(pDis->fPrefix & DISPREFIX_REP))
    22032203    {
    2204         LogFlow(("emInterpretStosWD dest=%04X:%RGv (%RGv) cbSize=%d\n", pRegFrame->es, GCOffset, GCDest, cbSize));
     2204        LogFlow(("emInterpretStosWD dest=%04X:%RGv (%RGv) cbSize=%d\n", pRegFrame->es.Sel, GCOffset, GCDest, cbSize));
    22052205
    22062206        rc = emRamWrite(pVM, pVCpu, pRegFrame, GCDest, &pRegFrame->rax, cbSize);
     
    22472247        }
    22482248
    2249         LogFlow(("emInterpretStosWD dest=%04X:%RGv (%RGv) cbSize=%d cTransfers=%x DF=%d\n", pRegFrame->es, GCOffset, GCDest, cbSize, cTransfers, pRegFrame->eflags.Bits.u1DF));
     2249        LogFlow(("emInterpretStosWD dest=%04X:%RGv (%RGv) cbSize=%d cTransfers=%x DF=%d\n", pRegFrame->es.Sel, GCOffset, GCDest, cbSize, cTransfers, pRegFrame->eflags.Bits.u1DF));
    22502250        /* Access verification first; we currently can't recover properly from traps inside this instruction */
    22512251        rc = PGMVerifyAccess(pVCpu, GCDest - ((offIncrement > 0) ? 0 : ((cTransfers-1) * cbSize)),
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