VirtualBox

Changeset 41935 in vbox


Ignore:
Timestamp:
Jun 27, 2012 7:43:40 PM (13 years ago)
Author:
vboxsync
Message:

Reverted r78802, committed too much.

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

Legend:

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

    r41934 r41935  
    446446VMMDECL(VBOXSTRICTRC) EMInterpretInstruction(PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault)
    447447{
    448     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    449448    LogFlow(("EMInterpretInstruction %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault));
    450449#ifdef VBOX_WITH_IEM
     
    502501{
    503502    LogFlow(("EMInterpretInstructionEx %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault));
    504     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    505503#ifdef VBOX_WITH_IEM
    506504    NOREF(pvFault);
     
    566564{
    567565    LogFlow(("EMInterpretInstructionDisasState %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault));
    568     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    569566#ifdef VBOX_WITH_IEM
    570567    NOREF(pDis); NOREF(pvFault); NOREF(enmCodeType);
     
    609606    int         rc;
    610607
    611     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    612608    Assert(!CPUMIsGuestIn64BitCode(pVCpu, pRegFrame));
    613609    /** @todo Rainy day: Test what happens when VERR_EM_INTERPRETER is returned by
     
    675671VMMDECL(int) EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
    676672{
    677     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    678673    uint32_t iLeaf = pRegFrame->eax;
    679674    NOREF(pVM);
     
    703698VMMDECL(int) EMInterpretRdtsc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
    704699{
    705     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    706700    unsigned uCR4 = CPUMGetGuestCR4(pVCpu);
    707701
     
    730724VMMDECL(int) EMInterpretRdtscp(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    731725{
    732     Assert(pCtx == CPUMQueryGuestCtxPtr(pVCpu));
    733     uint32_t uCR4 = CPUMGetGuestCR4(pVCpu);
     726    unsigned uCR4 = CPUMGetGuestCR4(pVCpu);
    734727
    735728    if (!CPUMGetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_RDTSCP))
     
    765758VMMDECL(int) EMInterpretRdpmc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
    766759{
    767     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    768     uint32_t uCR4 = CPUMGetGuestCR4(pVCpu);
     760    unsigned uCR4 = CPUMGetGuestCR4(pVCpu);
    769761
    770762    /* If X86_CR4_PCE is not set, then CPL must be zero. */
     
    791783VMMDECL(VBOXSTRICTRC) EMInterpretMWait(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
    792784{
    793     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    794785    uint32_t u32Dummy, u32ExtFeatures, cpl, u32MWaitFeatures;
    795786    NOREF(pVM);
     
    831822{
    832823    uint32_t u32Dummy, u32ExtFeatures, cpl;
    833     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    834824    NOREF(pVM);
    835825
     
    872862     * (in absence of segment override prefixes)????
    873863     */
    874     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    875864    NOREF(pVM); NOREF(pRegFrame);
    876865#ifdef IN_RC
     
    908897    /** @todo Clean up this mess. */
    909898    LogFlow(("EMInterpretCRxWrite at %RGv CR%d <- %RX64\n", (RTGCPTR)pRegFrame->rip, DestRegCrx, val));
    910     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    911899    switch (DestRegCrx)
    912900    {
     
    10441032    uint64_t val;
    10451033    int      rc;
    1046     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    10471034
    10481035    if (CPUMIsGuestIn64BitCode(pVCpu, pRegFrame))
     
    10751062VMMDECL(int) EMInterpretLMSW(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint16_t u16Data)
    10761063{
    1077     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    10781064    uint64_t OldCr0 = CPUMGetGuestCR0(pVCpu);
    10791065
     
    10981084{
    10991085    NOREF(pVM);
    1100 
    11011086    uint64_t cr0 = CPUMGetGuestCR0(pVCpu);
    11021087    if (!(cr0 & X86_CR0_TS))
     
    11191104VMMDECL(int) EMInterpretCRxRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegGen, uint32_t SrcRegCrx)
    11201105{
    1121     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    11221106    uint64_t val64;
    11231107    int rc = CPUMGetGuestCRx(pVCpu, SrcRegCrx, &val64);
     
    11521136VMMDECL(int) EMInterpretDRxWrite(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen)
    11531137{
    1154     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    11551138    uint64_t val;
    11561139    int      rc;
     
    11941177{
    11951178    uint64_t val64;
    1196     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    11971179    NOREF(pVM);
    11981180
     
    30453027VMMDECL(int) EMInterpretWrmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
    30463028{
    3047     Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));
    3048 
    30493029    /* Check the current privilege level, this instruction is supervisor only. */
    30503030    if (CPUMGetGuestCPL(pVCpu, pRegFrame) != 0)
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r41934 r41935  
    77777777
    77787778/**
     7779 * Updates the real CPU context structure with the context core (from the trap
     7780 * stack frame) before interpreting any instructions.
     7781 *
     7782 * @param   pCtx        The real CPU context.
     7783 * @param   pCtxCore    The trap stack CPU core context.
     7784 */
     7785DECLINLINE(void) iemCtxCoreToCtx(PCPUMCTX pCtx, PCCPUMCTXCORE pCtxCore)
     7786{
     7787    PCPUMCTXCORE pDst = CPUMCTX2CORE(pCtx);
     7788    if (pDst != pCtxCore)
     7789        *pDst = *pCtxCore;
     7790}
     7791
     7792
     7793/**
     7794 * Updates the context core (from the trap stack frame) with the updated values
     7795 * from the real CPU context structure after instruction emulation.
     7796 *
     7797 * @param   pCtx        The real CPU context.
     7798 * @param   pCtxCore    The trap stack CPU core context.
     7799 */
     7800DECLINLINE(void) iemCtxToCtxCore(PCPUMCTXCORE pCtxCore, PCCPUMCTX pCtx)
     7801{
     7802    PCCPUMCTXCORE pSrc = CPUMCTX2CORE(pCtx);
     7803    if (pSrc != pCtxCore)
     7804        *pCtxCore = *pSrc;
     7805}
     7806
     7807
     7808/**
    77797809 * The actual code execution bits of IEMExecOne, IEMExecOneEx, and
    77807810 * IEMExecOneWithPrefetchedByPC.
     
    78867916    PIEMCPU  pIemCpu = &pVCpu->iem.s;
    78877917    PCPUMCTX pCtx    = pVCpu->iem.s.CTX_SUFF(pCtx);
    7888     AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3);
    7889 
     7918
     7919    iemCtxCoreToCtx(pCtx, pCtxCore);
    78907920    iemInitDecoder(pIemCpu);
    78917921    uint32_t const cbOldWritten = pIemCpu->cbWritten;
     
    78957925    {
    78967926        rcStrict = iemExecOneInner(pVCpu, pIemCpu);
     7927        if (rcStrict == VINF_SUCCESS)
     7928            iemCtxToCtxCore(pCtxCore, pCtx);
    78977929        if (pcbWritten)
    78987930            *pcbWritten = pIemCpu->cbWritten - cbOldWritten;
     
    79077939    PIEMCPU  pIemCpu = &pVCpu->iem.s;
    79087940    PCPUMCTX pCtx    = pVCpu->iem.s.CTX_SUFF(pCtx);
    7909     AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3);
     7941
     7942    iemCtxCoreToCtx(pCtx, pCtxCore);
    79107943
    79117944    VBOXSTRICTRC rcStrict;
     
    79237956    {
    79247957        rcStrict = iemExecOneInner(pVCpu, pIemCpu);
     7958        if (rcStrict == VINF_SUCCESS)
     7959            iemCtxToCtxCore(pCtxCore, pCtx);
    79257960    }
    79267961    return rcStrict;
  • trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac

    r41934 r41935  
    661661
    662662
    663 GLOBALNAME End
    664663;
    665664; The description string (in the text section).
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