VirtualBox

Changeset 46168 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 19, 2013 10:58:37 PM (12 years ago)
Author:
vboxsync
Message:

IEM/EM: Made DSL boot to command line (X doesn't start yet).

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

Legend:

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

    r46165 r46168  
    771771    pIemCpu->rcPassUp           = VINF_SUCCESS;
    772772    pIemCpu->fBypassHandlers    = fBypassHandlers;
    773 
     773#ifdef IN_RC
     774    pIemCpu->fInPatchCode       = pIemCpu->uCpl == 0
     775                               && pCtx->cs.u64Base == 0
     776                               && pCtx->cs.u32Limit == UINT32_MAX
     777                               && PATMIsPatchGCAddr(IEMCPU_TO_VM(pIemCpu), pCtx->eip);
     778    if (!pIemCpu->fInPatchCode)
     779        CPUMRawLeave(pVCpu, CPUMCTX2CORE(pCtx), VINF_SUCCESS);
     780#endif
    774781}
    775782
     
    818825    /* Allow interpretation of patch manager code blocks since they can for
    819826       instance throw #PFs for perfectly good reasons. */
    820     if (   (pCtx->cs.Sel & X86_SEL_RPL) == 1
    821         && PATMIsPatchGCAddr(IEMCPU_TO_VM(pIemCpu), GCPtrPC))
     827    if (pIemCpu->fInPatchCode)
    822828    {
    823829        uint32_t cbLeftOnPage = PAGE_SIZE - (GCPtrPC & PAGE_OFFSET_MASK);
     
    83728378
    83738379
     8380#ifdef IN_RC
     8381/**
     8382 * Re-enters raw-mode or ensure we return to ring-3.
     8383 *
     8384 * @returns rcStrict, maybe modified.
     8385 * @param   pIemCpu     The IEM CPU structure.
     8386 * @param   pVCpu       The cross context virtual CPU structure of the caller.
     8387 * @param   pCtx        The current CPU context.
     8388 * @param   rcStrict    The status code returne by the interpreter.
     8389 */
     8390DECLINLINE(VBOXSTRICTRC) iemRCRawMaybeReenter(PIEMCPU pIemCpu, PVMCPU pVCpu, PCPUMCTX pCtx, VBOXSTRICTRC rcStrict)
     8391{
     8392    if (!pIemCpu->fInPatchCode)
     8393        CPUMRawEnter(pVCpu, CPUMCTX2CORE(pCtx));
     8394    return rcStrict;
     8395}
     8396#endif
     8397
     8398
    83748399/**
    83758400 * Execute one instruction.
     
    84328457    iemExecVerificationModeCheck(pIemCpu);
    84338458#endif
     8459#ifdef IN_RC
     8460    rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict);
     8461#endif
    84348462    if (rcStrict != VINF_SUCCESS)
    84358463        LogFlow(("IEMExecOne: cs:rip=%04x:%08RX64 ss:rsp=%04x:%08RX64 EFL=%06x - rcStrict=%Rrc\n",
     
    84458473    AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3);
    84468474
    8447     iemInitDecoder(pIemCpu, false);
    84488475    uint32_t const cbOldWritten = pIemCpu->cbWritten;
    8449 
    84508476    VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pIemCpu, false);
    84518477    if (rcStrict == VINF_SUCCESS)
     
    84558481            *pcbWritten = pIemCpu->cbWritten - cbOldWritten;
    84568482    }
     8483
     8484#ifdef IN_RC
     8485    rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict);
     8486#endif
    84578487    return rcStrict;
    84588488}
     
    84818511        rcStrict = iemExecOneInner(pVCpu, pIemCpu, true);
    84828512    }
     8513
     8514#ifdef IN_RC
     8515    rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict);
     8516#endif
    84838517    return rcStrict;
    84848518}
     
    84918525    AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3);
    84928526
    8493 #ifdef IN_RC
    8494     CPUMRawLeave(pVCpu, pCtxCore, VINF_SUCCESS);
    8495 #endif
    8496 
    8497     iemInitDecoder(pIemCpu, true);
    84988527    uint32_t const cbOldWritten = pIemCpu->cbWritten;
    8499 
    85008528    VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pIemCpu, true);
    85018529    if (rcStrict == VINF_SUCCESS)
     
    85078535
    85088536#ifdef IN_RC
    8509     CPUMRawEnter(pVCpu, pCtxCore);
     8537    rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict);
    85108538#endif
    85118539    return rcStrict;
     
    85198547    PCPUMCTX pCtx    = pVCpu->iem.s.CTX_SUFF(pCtx);
    85208548    AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3);
    8521 
    8522 #ifdef IN_RC
    8523     CPUMRawLeave(pVCpu, pCtxCore, VINF_SUCCESS);
    8524 #endif
    85258549
    85268550    VBOXSTRICTRC rcStrict;
     
    85398563
    85408564#ifdef IN_RC
    8541     CPUMRawEnter(pVCpu, pCtxCore);
     8565    rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict);
    85428566#endif
    85438567    return rcStrict;
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r42778 r46168  
    214214    /** Whether to bypass access handlers or not. */
    215215    bool                    fBypassHandlers;
     216    /** Indicates that we're interpreting patch code - RC only! */
     217    bool                    fInPatchCode;
    216218    /** Explicit alignment padding. */
    217     bool                    afAlignment0[3];
     219    bool                    afAlignment0[2];
    218220
    219221    /** The flags of the current exception / interrupt. */
  • trunk/src/VBox/VMM/include/SELMInline.h

    r45485 r46168  
    282282    pSReg->u64Base        = X86DESC_BASE(pShwDesc);
    283283    pSReg->ValidSel       = pSReg->Sel;
     284/** @todo VBOX_WITH_RAW_RING1 */
    284285    if (pSReg->Attr.n.u1Available)
    285286        pSReg->ValidSel  &= ~(RTSEL)1;
     
    303304    pSReg->u64Base        = X86DESC_BASE(pGstDesc);
    304305    pSReg->ValidSel       = pSReg->Sel;
     306/** @todo VBOX_WITH_RAW_RING1 */
    305307    if ((pSReg->ValidSel & 1) && CPUMIsGuestInRawMode(pVCpu))
    306308        pSReg->ValidSel  &= ~(RTSEL)1;
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