VirtualBox

Changeset 72634 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Jun 20, 2018 4:08:42 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123137
Message:

EM[R3]: Use pVCpu->cpum.GstCtx and stop keeping and passing pCtx around.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/EMHandleRCTmpl.h

    r72580 r72634  
    2525
    2626/**
    27  * Process a subset of the raw-mode and hm return codes.
     27 * Process a subset of the raw-mode, HM and NEM return codes.
    2828 *
    2929 * Since we have to share this with raw-mode single stepping, this inline
     
    3535 * @param   pVM     The cross context VM structure.
    3636 * @param   pVCpu   The cross context virtual CPU structure.
    37  * @param   pCtx    Pointer to the guest CPU context.
    3837 * @param   rc      The return code.
    3938 */
    4039#ifdef EMHANDLERC_WITH_PATM
    41 int emR3RawHandleRC(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, int rc)
     40int emR3RawHandleRC(PVM pVM, PVMCPU pVCpu, int rc)
    4241#elif defined(EMHANDLERC_WITH_HM) || defined(DOXYGEN_RUNNING)
    43 int emR3HmHandleRC(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, int rc)
     42int emR3HmHandleRC(PVM pVM, PVMCPU pVCpu, int rc)
    4443#elif defined(EMHANDLERC_WITH_NEM)
    45 int emR3NemHandleRC(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, int rc)
     44int emR3NemHandleRC(PVM pVM, PVMCPU pVCpu, int rc)
    4645#endif
    4746{
    48     NOREF(pCtx);
    49 
    5047    switch (rc)
    5148    {
     
    7774             * Got a trap which needs dispatching.
    7875             */
    79             if (PATMR3IsInsidePatchJump(pVM, pCtx->eip, NULL))
     76            if (PATMR3IsInsidePatchJump(pVM, pVCpu->cpum.GstCtx.eip, NULL))
    8077            {
    8178                AssertReleaseMsgFailed(("FATAL ERROR: executing random instruction inside generated patch jump %08X\n", CPUMGetGuestEIP(pVCpu)));
     
    9188        case VINF_PATM_PATCH_TRAP_PF:
    9289        case VINF_PATM_PATCH_INT3:
    93             rc = emR3RawPatchTrap(pVM, pVCpu, pCtx, rc);
     90            rc = emR3RawPatchTrap(pVM, pVCpu, rc);
    9491            break;
    9592
    9693        case VINF_PATM_DUPLICATE_FUNCTION:
    97             Assert(PATMIsPatchGCAddr(pVM, pCtx->eip));
    98             rc = PATMR3DuplicateFunctionRequest(pVM, pCtx);
     94            Assert(PATMIsPatchGCAddr(pVM, pVCpu->cpum.GstCtx.eip));
     95            rc = PATMR3DuplicateFunctionRequest(pVM, &pVCpu->cpum.GstCtx);
    9996            AssertRC(rc);
    10097            rc = VINF_SUCCESS;
     
    118115         */
    119116        case VINF_PATM_HC_MMIO_PATCH_READ:
    120             rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DISSELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip),
     117            rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DISSELREG_CS, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), pVCpu->cpum.GstCtx.eip),
    121118                                      PATMFL_MMIO_ACCESS
    122119                                    | (CPUMGetGuestCodeBits(pVCpu) == 32 ? PATMFL_CODE32 : 0));
     
    167164        case VINF_PGM_CHANGE_MODE:
    168165            CPUM_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_CR0 | CPUMCTX_EXTRN_CR3 | CPUMCTX_EXTRN_CR4 | CPUMCTX_EXTRN_EFER);
    169             rc = PGMChangeMode(pVCpu, pCtx->cr0, pCtx->cr4, pCtx->msrEFER);
     166            rc = PGMChangeMode(pVCpu, pVCpu->cpum.GstCtx.cr0, pVCpu->cpum.GstCtx.cr4, pVCpu->cpum.GstCtx.msrEFER);
    170167            if (rc == VINF_SUCCESS)
    171168                rc = VINF_EM_RESCHEDULE;
     
    188185        case VINF_EM_RAW_RING_SWITCH_INT:
    189186            Assert(TRPMHasTrap(pVCpu));
    190             Assert(!PATMIsPatchGCAddr(pVM, pCtx->eip));
     187            Assert(!PATMIsPatchGCAddr(pVM, pVCpu->cpum.GstCtx.eip));
    191188
    192189            if (TRPMHasTrap(pVCpu))
     
    260257         */
    261258        case VINF_EM_RAW_EMULATE_IO_BLOCK:
    262             rc = HMR3EmulateIoBlock(pVM, pCtx);
     259            rc = HMR3EmulateIoBlock(pVM, &pVCpu->cpum.GstCtx);
    263260            break;
    264261
    265262        case VINF_EM_HM_PATCH_TPR_INSTR:
    266             rc = HMR3PatchTprInstr(pVM, pVCpu, pCtx);
     263            rc = HMR3PatchTprInstr(pVM, pVCpu, &pVCpu->cpum.GstCtx);
    267264            break;
    268265#endif
     
    313310        case VINF_EM_RAW_IRET_TRAP:
    314311            /* We will not go to the recompiler if EIP points to patch code. */
    315             if (PATMIsPatchGCAddr(pVM, pCtx->eip))
     312            if (PATMIsPatchGCAddr(pVM, pVCpu->cpum.GstCtx.eip))
    316313            {
    317                 pCtx->eip = PATMR3PatchToGCPtr(pVM, (RTGCPTR)pCtx->eip, 0);
     314                pVCpu->cpum.GstCtx.eip = PATMR3PatchToGCPtr(pVM, (RTGCPTR)pVCpu->cpum.GstCtx.eip, 0);
    318315            }
    319316            LogFlow(("emR3RawHandleRC: %Rrc -> %Rrc\n", rc, VINF_EM_RESCHEDULE_REM));
  • trunk/src/VBox/VMM/include/EMInternal.h

    r72583 r72634  
    399399    RTR3PTR                 R3PtrPaddingNoRaw;
    400400#endif
    401 
    402     /** Pointer to the guest CPUM state. (R3 Ptr)
    403      * @deprecated Use pVCpu->cpum.GstCtx!  */
    404     R3PTRTYPE(PCPUMCTX)     pCtx;
    405 
     401    RTR3PTR                 R3PtrNullPadding; /**< Used to be pCtx. */
    406402#if GC_ARCH_BITS == 64
    407403    RTGCPTR                 aPadding1;
     
    550546/** @} */
    551547
    552 int     emR3InitDbg(PVM pVM);
    553 
    554 int          emR3HmExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone);
    555 VBOXSTRICTRC emR3NemExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone);
    556 int          emR3RawExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone);
    557 
    558 int     emR3RawHandleRC(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, int rc);
    559 int     emR3HmHandleRC(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, int rc);
    560 int     emR3NemHandleRC(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, int rc);
    561 
    562 EMSTATE emR3Reschedule(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    563 int     emR3ForcedActions(PVM pVM, PVMCPU pVCpu, int rc);
    564 VBOXSTRICTRC emR3HighPriorityPostForcedActions(PVM pVM, PVMCPU pVCpu, VBOXSTRICTRC rc);
    565 
    566 int     emR3RawUpdateForceFlag(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, int rc);
    567 int     emR3RawResumeHyper(PVM pVM, PVMCPU pVCpu);
    568 int     emR3RawStep(PVM pVM, PVMCPU pVCpu);
    569 
    570 VBOXSTRICTRC emR3NemSingleInstruction(PVM pVM, PVMCPU pVCpu, uint32_t fFlags);
    571 
    572 int     emR3SingleStepExecRem(PVM pVM, PVMCPU pVCpu, uint32_t cIterations);
    573 
    574 bool    emR3IsExecutionAllowed(PVM pVM, PVMCPU pVCpu);
    575 
    576 VBOXSTRICTRC emR3ExecutePendingIoPortWrite(PVM pVM, PVMCPU pVCpu);
    577 VBOXSTRICTRC emR3ExecutePendingIoPortRead(PVM pVM, PVMCPU pVCpu);
     548int             emR3InitDbg(PVM pVM);
     549
     550int             emR3HmExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone);
     551VBOXSTRICTRC    emR3NemExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone);
     552int             emR3RawExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone);
     553
     554EMSTATE         emR3Reschedule(PVM pVM, PVMCPU pVCpu);
     555int             emR3ForcedActions(PVM pVM, PVMCPU pVCpu, int rc);
     556VBOXSTRICTRC    emR3HighPriorityPostForcedActions(PVM pVM, PVMCPU pVCpu, VBOXSTRICTRC rc);
     557
     558int             emR3RawResumeHyper(PVM pVM, PVMCPU pVCpu);
     559int             emR3RawStep(PVM pVM, PVMCPU pVCpu);
     560
     561VBOXSTRICTRC    emR3NemSingleInstruction(PVM pVM, PVMCPU pVCpu, uint32_t fFlags);
     562
     563int             emR3SingleStepExecRem(PVM pVM, PVMCPU pVCpu, uint32_t cIterations);
     564
     565bool            emR3IsExecutionAllowed(PVM pVM, PVMCPU pVCpu);
     566
     567VBOXSTRICTRC    emR3ExecutePendingIoPortWrite(PVM pVM, PVMCPU pVCpu);
     568VBOXSTRICTRC    emR3ExecutePendingIoPortRead(PVM pVM, PVMCPU pVCpu);
    578569
    579570RT_C_DECLS_END
  • trunk/src/VBox/VMM/include/NEMInternal.h

    r72575 r72634  
    398398void    nemR3NativeResetCpu(PVMCPU pVCpu, bool fInitIpi);
    399399VBOXSTRICTRC    nemR3NativeRunGC(PVM pVM, PVMCPU pVCpu);
    400 bool            nemR3NativeCanExecuteGuest(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
     400bool            nemR3NativeCanExecuteGuest(PVM pVM, PVMCPU pVCpu);
    401401bool            nemR3NativeSetSingleInstruction(PVM pVM, PVMCPU pVCpu, bool fEnable);
    402402void            nemR3NativeNotifyFF(PVM pVM, PVMCPU pVCpu, uint32_t fFlags);
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