VirtualBox

Changeset 80016 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Jul 26, 2019 5:06:38 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132451
Message:

VMM: Kicking out raw-mode (work in progress) - EM. bugref:9517

Location:
trunk/src/VBox/VMM/VMMR3
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r80007 r80016  
    102102    AssertCompileMemberAlignment(VM, em.s, 32);
    103103    AssertCompile(sizeof(pVM->em.s) <= sizeof(pVM->em.padding));
    104     AssertCompile(sizeof(pVM->aCpus[0].em.s.u.FatalLongJump) <= sizeof(pVM->aCpus[0].em.s.u.achPaddingFatalLongJump));
     104    AssertCompile(RT_SIZEOFMEMB(VMCPU, em.s.u.FatalLongJump) <= RT_SIZEOFMEMB(VMCPU, em.s.u.achPaddingFatalLongJump));
     105    AssertCompile(RT_SIZEOFMEMB(VMCPU, em.s) <= RT_SIZEOFMEMB(VMCPU, em.padding));
    105106
    106107    /*
    107108     * Init the structure.
    108109     */
    109     pVM->em.s.offVM = RT_UOFFSETOF(VM, em.s);
    110110    PCFGMNODE pCfgRoot = CFGMR3GetRoot(pVM);
    111111    PCFGMNODE pCfgEM = CFGMR3GetChild(pCfgRoot, "EM");
     
    234234        pVCpu->em.s.enmState            = i == 0 ? EMSTATE_NONE : EMSTATE_WAIT_SIPI;
    235235        pVCpu->em.s.enmPrevState        = EMSTATE_NONE;
    236         pVCpu->em.s.fForceRAW           = false;
    237236        pVCpu->em.s.u64TimeSliceStart   = 0; /* paranoia */
    238237        pVCpu->em.s.idxContinueExitRec  = UINT16_MAX;
    239 
    240 #ifdef VBOX_WITH_RAW_MODE
    241         if (VM_IS_RAW_MODE_ENABLED(pVM))
    242         {
    243             pVCpu->em.s.pPatmGCState = PATMR3QueryGCStateHC(pVM);
    244             AssertMsg(pVCpu->em.s.pPatmGCState, ("PATMR3QueryGCStateHC failed!\n"));
    245         }
    246 #endif
    247238
    248239# define EM_REG_COUNTER(a, b, c) \
     
    273264        pVCpu->em.s.pStatsR3 = pStats;
    274265        pVCpu->em.s.pStatsR0 = MMHyperR3ToR0(pVM, pStats);
    275         pVCpu->em.s.pStatsRC = MMHyperR3ToRC(pVM, pStats);
    276266
    277267# if 1 /* rawmode only? */
     
    402392{
    403393    LogFlow(("EMR3Relocate\n"));
    404     for (VMCPUID i = 0; i < pVM->cCpus; i++)
    405     {
    406         PVMCPU pVCpu = &pVM->aCpus[i];
    407         if (pVCpu->em.s.pStatsR3)
    408             pVCpu->em.s.pStatsRC = MMHyperR3ToRC(pVM, pVCpu->em.s.pStatsR3);
    409     }
     394    RT_NOREF(pVM);
    410395}
    411396
     
    421406{
    422407    /* Reset scheduling state. */
    423     pVCpu->em.s.fForceRAW = false;
    424408    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_UNHALT);
    425409
     
    459443VMMR3_INT_DECL(int) EMR3Term(PVM pVM)
    460444{
    461     AssertMsg(pVM->em.s.offVM, ("bad init order!\n"));
    462 
    463445#ifdef VBOX_WITH_REM
    464446    PDMR3CritSectDelete(&pVM->em.s.CritSectREM);
     
    483465        PVMCPU pVCpu = &pVM->aCpus[i];
    484466
    485         SSMR3PutBool(pSSM, pVCpu->em.s.fForceRAW);
     467        SSMR3PutBool(pSSM, false /*fForceRAW*/);
    486468
    487469        Assert(pVCpu->em.s.enmState     == EMSTATE_SUSPENDED);
     
    531513        PVMCPU pVCpu = &pVM->aCpus[i];
    532514
    533         int rc = SSMR3GetBool(pSSM, &pVCpu->em.s.fForceRAW);
    534         if (RT_FAILURE(rc))
    535             pVCpu->em.s.fForceRAW = false;
     515        bool fForceRAWIgnored;
     516        int rc = SSMR3GetBool(pSSM, &fForceRAWIgnored);
    536517        AssertRCReturn(rc, rc);
    537518
     
    872853            case VINF_EM_DBG_STEP:
    873854                if (   pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_RAW
    874                     || pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER
    875                     || pVCpu->em.s.fForceRAW /* paranoia */)
    876 #ifdef VBOX_WITH_RAW_MODE
    877                     rc = emR3RawStep(pVM, pVCpu);
    878 #else
     855                    || pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER)
    879856                    AssertLogRelMsgFailedStmt(("Bad EM state."), VERR_EM_INTERNAL_ERROR);
    880 #endif
    881857                else if (pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_HM)
    882858                    rc = EMR3HmSingleInstruction(pVM, pVCpu, 0 /*fFlags*/);
     
    979955            case VINF_EM_HALT:
    980956                if (pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER)
    981                 {
    982 #ifdef VBOX_WITH_RAW_MODE
    983                     rc = emR3RawResumeHyper(pVM, pVCpu);
    984                     if (rc != VINF_SUCCESS && RT_SUCCESS(rc))
    985                         continue;
    986 #else
    987957                    AssertLogRelMsgFailedReturn(("Not implemented\n"), VERR_EM_INTERNAL_ERROR);
    988 #endif
    989                 }
    990958                if (rc == VINF_SUCCESS)
    991959                    rc = VINF_EM_RESCHEDULE;
     
    14221390{
    14231391    /*
    1424      * When forcing raw-mode execution, things are simple.
    1425      */
    1426     if (pVCpu->em.s.fForceRAW)
    1427         return EMSTATE_RAW;
    1428 
    1429     /*
    14301392     * We stay in the wait for SIPI state unless explicitly told otherwise.
    14311393     */
     
    15581520        }
    15591521
    1560 # ifdef VBOX_WITH_RAW_MODE
    1561         if (PATMShouldUseRawMode(pVM, (RTGCPTR)pVCpu->cpum.GstCtx.eip))
    1562         {
    1563             Log2(("raw r0 mode forced: patch code\n"));
    1564 #  ifdef VBOX_WITH_SAFE_STR
    1565             Assert(pVCpu->cpum.GstCtx.tr.Sel);
    1566 #  endif
    1567             return EMSTATE_RAW;
    1568         }
    1569 # endif /* VBOX_WITH_RAW_MODE */
    1570 
    15711522# if !defined(VBOX_ALLOW_IF0) && !defined(VBOX_RUN_INTERRUPT_GATE_HANDLERS)
    15721523        if (!(EFlags.u32 & X86_EFL_IF))
     
    16931644            pVCpu->em.s.idxContinueExitRec = UINT16_MAX;
    16941645    }
    1695 
    1696 #ifdef VBOX_WITH_RAW_MODE
    1697     if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_CSAM_PENDING_ACTION))
    1698         CSAMR3DoPendingAction(pVM, pVCpu);
    1699 #endif
    17001646
    17011647    if (VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY))
     
    19101856            UPDATE_RC();
    19111857        }
    1912 
    1913 #ifdef VBOX_WITH_RAW_MODE
    1914         /*
    1915          * CSAM page scanning.
    1916          */
    1917         if (    !VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)
    1918             &&  VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_CSAM_SCAN_PAGE))
    1919         {
    1920             /** @todo check for 16 or 32 bits code! (D bit in the code selector) */
    1921             Log(("Forced action VMCPU_FF_CSAM_SCAN_PAGE\n"));
    1922             CPUM_IMPORT_EXTRN_RCSTRICT(pVCpu, ~CPUMCTX_EXTRN_KEEPER_MASK, rc);
    1923             CSAMR3CheckCodeEx(pVM, &pVCpu->cpum.GstCtx, pVCpu->cpum.GstCtx.eip);
    1924             VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_CSAM_SCAN_PAGE);
    1925         }
    1926 #endif
    19271858
    19281859        /*
     
    21762107
    21772108            bool fGif = CPUMGetGuestGif(&pVCpu->cpum.GstCtx);
    2178 #ifdef VBOX_WITH_RAW_MODE
    2179             fGif &= !PATMIsPatchGCAddr(pVM, pVCpu->cpum.GstCtx.eip);
    2180 #endif
    21812109            if (fGif)
    21822110            {
     
    25072435VMMR3_INT_DECL(int) EMR3ExecuteVM(PVM pVM, PVMCPU pVCpu)
    25082436{
    2509     Log(("EMR3ExecuteVM: pVM=%p enmVMState=%d (%s)  enmState=%d (%s) enmPrevState=%d (%s) fForceRAW=%RTbool\n",
     2437    Log(("EMR3ExecuteVM: pVM=%p enmVMState=%d (%s)  enmState=%d (%s) enmPrevState=%d (%s)\n",
    25102438         pVM,
    25112439         pVM->enmVMState,          VMR3GetStateName(pVM->enmVMState),
    25122440         pVCpu->em.s.enmState,     emR3GetStateName(pVCpu->em.s.enmState),
    2513          pVCpu->em.s.enmPrevState, emR3GetStateName(pVCpu->em.s.enmPrevState),
    2514          pVCpu->em.s.fForceRAW));
     2441         pVCpu->em.s.enmPrevState, emR3GetStateName(pVCpu->em.s.enmPrevState) ));
    25152442    VM_ASSERT_EMT(pVM);
    25162443    AssertMsg(   pVCpu->em.s.enmState == EMSTATE_NONE
     
    25662493                rc = emR3ForcedActions(pVM, pVCpu, rc);
    25672494                VBOXVMM_EM_FF_ALL_RET(pVCpu, rc);
    2568                 if (   (   rc == VINF_EM_RESCHEDULE_REM
    2569                         || rc == VINF_EM_RESCHEDULE_HM)
    2570                     && pVCpu->em.s.fForceRAW)
     2495                if (   rc == VINF_EM_RESCHEDULE_REM
     2496                    || rc == VINF_EM_RESCHEDULE_HM)
    25712497                    rc = VINF_EM_RESCHEDULE_RAW;
    25722498            }
     
    26102536                case VINF_EM_RESCHEDULE_HM:
    26112537                    Assert(!pVM->em.s.fIemExecutesAll || pVCpu->em.s.enmState != EMSTATE_IEM);
    2612                     Assert(!pVCpu->em.s.fForceRAW);
    26132538                    if (VM_IS_HM_ENABLED(pVM))
    26142539                    {
     
    29062831                 */
    29072832                case EMSTATE_RAW:
    2908 #ifdef VBOX_WITH_RAW_MODE
    2909                     rc = emR3RawExecute(pVM, pVCpu, &fFFDone);
    2910 #else
    29112833                    AssertLogRelMsgFailed(("%Rrc\n", rc));
    29122834                    rc = VERR_EM_INTERNAL_ERROR;
    2913 #endif
    29142835                    break;
    29152836
  • trunk/src/VBox/VMM/VMMR3/EMHM.cpp

    r80007 r80016  
    309309            return rc;
    310310
    311 #ifdef VBOX_WITH_RAW_MODE
    312         Assert(!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT));
    313 #endif
    314 
    315311        /* Prefetch pages for EIP and ESP. */
    316312        /** @todo This is rather expensive. Should investigate if it really helps at all. */
     
    332328        }
    333329        /** @todo maybe prefetch the supervisor stack page as well */
    334 #ifdef VBOX_WITH_RAW_MODE
    335         Assert(!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT));
    336 #endif
    337330    }
    338331
     
    401394         * Process high priority pre-execution raw-mode FFs.
    402395         */
    403 #ifdef VBOX_WITH_RAW_MODE
    404         Assert(!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT));
    405 #endif
    406396        if (    VM_FF_IS_ANY_SET(pVM, VM_FF_HIGH_PRIORITY_PRE_RAW_MASK)
    407397            ||  VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK))
  • trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp

    r80007 r80016  
    300300static int emR3NemForcedActions(PVM pVM, PVMCPU pVCpu)
    301301{
    302 #ifdef VBOX_WITH_RAW_MODE
    303     Assert(!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT));
    304 #endif
    305 
    306302    /*
    307303     * Sync page directory should not happen in NEM mode.
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