VirtualBox

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


Ignore:
Timestamp:
Nov 30, 2015 12:50:29 AM (9 years ago)
Author:
vboxsync
Message:

HM: More VBOXSTRICTRC and related stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r58915 r58917  
    316316 * VMX VM-exit handler.
    317317 *
    318  * @returns VBox status code.
     318 * @returns Strict VBox status code.
    319319 * @param   pVCpu           The cross context virtual CPU structure.
    320320 * @param   pMixedCtx       Pointer to the guest-CPU context. The data may be
     
    324324 */
    325325#ifndef HMVMX_USE_FUNCTION_TABLE
    326 typedef int FNVMXEXITHANDLER(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient);
     326typedef DECLINLINE(VBOXSTRICTRC)    FNVMXEXITHANDLER(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient);
    327327#else
    328 typedef DECLCALLBACK(int) FNVMXEXITHANDLER(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient);
     328typedef DECLCALLBACK(VBOXSTRICTRC) FNVMXEXITHANDLER(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient);
    329329/** Pointer to VM-exit handler. */
    330 typedef FNVMXEXITHANDLER *PFNVMXEXITHANDLER;
     330typedef FNVMXEXITHANDLER           *PFNVMXEXITHANDLER;
     331#endif
     332
     333/**
     334 * VMX VM-exit handler, non-strict status code.
     335 *
     336 * This is generally the same as FNVMXEXITHANDLER, the NSRC bit is just FYI.
     337 *
     338 * @returns VBox status code, no informational status code returned.
     339 * @param   pVCpu           The cross context virtual CPU structure.
     340 * @param   pMixedCtx       Pointer to the guest-CPU context. The data may be
     341 *                          out-of-sync. Make sure to update the required
     342 *                          fields before using them.
     343 * @param   pVmxTransient   Pointer to the VMX-transient structure.
     344 *
     345 * @remarks This is not used on anything returning VERR_EM_INTERPRETER as the
     346 *          use of that status code will be replaced with VINF_EM_SOMETHING
     347 *          later when switching over to IEM.
     348 */
     349#ifndef HMVMX_USE_FUNCTION_TABLE
     350typedef DECLINLINE(int)             FNVMXEXITHANDLERNSRC(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient);
     351#else
     352typedef FNVMXEXITHANDLER            FNVMXEXITHANDLERNSRC;
    331353#endif
    332354
     
    345367#endif
    346368#ifndef HMVMX_USE_FUNCTION_TABLE
    347 DECLINLINE(int)           hmR0VmxHandleExit(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient, uint32_t rcReason);
    348 # define HMVMX_EXIT_DECL  static int
     369DECLINLINE(VBOXSTRICTRC)  hmR0VmxHandleExit(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient, uint32_t rcReason);
     370# define HMVMX_EXIT_DECL  DECLINLINE(VBOXSTRICTRC)
     371# define HMVMX_EXIT_NSRC_DECL DECLINLINE(int)
    349372#else
    350 # define HMVMX_EXIT_DECL  static DECLCALLBACK(int)
     373# define HMVMX_EXIT_DECL  static DECLCALLBACK(VBOXSTRICTRC)
     374# define HMVMX_EXIT_NSRC_DECL HMVMX_EXIT_DECL
    351375#endif
     376
    352377DECLINLINE(VBOXSTRICTRC)  hmR0VmxHandleExitStep(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient,
    353378                                                uint32_t uExitReason, uint16_t uCsStart, uint64_t uRipStart);
     
    356381 * @{
    357382 */
    358 static FNVMXEXITHANDLER hmR0VmxExitXcptOrNmi;
    359 static FNVMXEXITHANDLER hmR0VmxExitExtInt;
    360 static FNVMXEXITHANDLER hmR0VmxExitTripleFault;
    361 static FNVMXEXITHANDLER hmR0VmxExitInitSignal;
    362 static FNVMXEXITHANDLER hmR0VmxExitSipi;
    363 static FNVMXEXITHANDLER hmR0VmxExitIoSmi;
    364 static FNVMXEXITHANDLER hmR0VmxExitSmi;
    365 static FNVMXEXITHANDLER hmR0VmxExitIntWindow;
    366 static FNVMXEXITHANDLER hmR0VmxExitNmiWindow;
    367 static FNVMXEXITHANDLER hmR0VmxExitTaskSwitch;
    368 static FNVMXEXITHANDLER hmR0VmxExitCpuid;
    369 static FNVMXEXITHANDLER hmR0VmxExitGetsec;
    370 static FNVMXEXITHANDLER hmR0VmxExitHlt;
    371 static FNVMXEXITHANDLER hmR0VmxExitInvd;
    372 static FNVMXEXITHANDLER hmR0VmxExitInvlpg;
    373 static FNVMXEXITHANDLER hmR0VmxExitRdpmc;
    374 static FNVMXEXITHANDLER hmR0VmxExitVmcall;
    375 static FNVMXEXITHANDLER hmR0VmxExitRdtsc;
    376 static FNVMXEXITHANDLER hmR0VmxExitRsm;
    377 static FNVMXEXITHANDLER hmR0VmxExitSetPendingXcptUD;
    378 static FNVMXEXITHANDLER hmR0VmxExitMovCRx;
    379 static FNVMXEXITHANDLER hmR0VmxExitMovDRx;
    380 static FNVMXEXITHANDLER hmR0VmxExitIoInstr;
    381 static FNVMXEXITHANDLER hmR0VmxExitRdmsr;
    382 static FNVMXEXITHANDLER hmR0VmxExitWrmsr;
    383 static FNVMXEXITHANDLER hmR0VmxExitErrInvalidGuestState;
    384 static FNVMXEXITHANDLER hmR0VmxExitErrMsrLoad;
    385 static FNVMXEXITHANDLER hmR0VmxExitErrUndefined;
    386 static FNVMXEXITHANDLER hmR0VmxExitMwait;
    387 static FNVMXEXITHANDLER hmR0VmxExitMtf;
    388 static FNVMXEXITHANDLER hmR0VmxExitMonitor;
    389 static FNVMXEXITHANDLER hmR0VmxExitPause;
    390 static FNVMXEXITHANDLER hmR0VmxExitErrMachineCheck;
    391 static FNVMXEXITHANDLER hmR0VmxExitTprBelowThreshold;
    392 static FNVMXEXITHANDLER hmR0VmxExitApicAccess;
    393 static FNVMXEXITHANDLER hmR0VmxExitXdtrAccess;
    394 static FNVMXEXITHANDLER hmR0VmxExitXdtrAccess;
    395 static FNVMXEXITHANDLER hmR0VmxExitEptViolation;
    396 static FNVMXEXITHANDLER hmR0VmxExitEptMisconfig;
    397 static FNVMXEXITHANDLER hmR0VmxExitRdtscp;
    398 static FNVMXEXITHANDLER hmR0VmxExitPreemptTimer;
    399 static FNVMXEXITHANDLER hmR0VmxExitWbinvd;
    400 static FNVMXEXITHANDLER hmR0VmxExitXsetbv;
    401 static FNVMXEXITHANDLER hmR0VmxExitRdrand;
    402 static FNVMXEXITHANDLER hmR0VmxExitInvpcid;
     383static FNVMXEXITHANDLER     hmR0VmxExitXcptOrNmi;
     384static FNVMXEXITHANDLER     hmR0VmxExitExtInt;
     385static FNVMXEXITHANDLER     hmR0VmxExitTripleFault;
     386static FNVMXEXITHANDLERNSRC hmR0VmxExitInitSignal;
     387static FNVMXEXITHANDLERNSRC hmR0VmxExitSipi;
     388static FNVMXEXITHANDLERNSRC hmR0VmxExitIoSmi;
     389static FNVMXEXITHANDLERNSRC hmR0VmxExitSmi;
     390static FNVMXEXITHANDLERNSRC hmR0VmxExitIntWindow;
     391static FNVMXEXITHANDLERNSRC hmR0VmxExitNmiWindow;
     392static FNVMXEXITHANDLER     hmR0VmxExitTaskSwitch;
     393static FNVMXEXITHANDLER     hmR0VmxExitCpuid;
     394static FNVMXEXITHANDLER     hmR0VmxExitGetsec;
     395static FNVMXEXITHANDLER     hmR0VmxExitHlt;
     396static FNVMXEXITHANDLERNSRC hmR0VmxExitInvd;
     397static FNVMXEXITHANDLER     hmR0VmxExitInvlpg;
     398static FNVMXEXITHANDLER     hmR0VmxExitRdpmc;
     399static FNVMXEXITHANDLER     hmR0VmxExitVmcall;
     400static FNVMXEXITHANDLER     hmR0VmxExitRdtsc;
     401static FNVMXEXITHANDLERNSRC hmR0VmxExitRsm;
     402static FNVMXEXITHANDLERNSRC hmR0VmxExitSetPendingXcptUD;
     403static FNVMXEXITHANDLER     hmR0VmxExitMovCRx;
     404static FNVMXEXITHANDLER     hmR0VmxExitMovDRx;
     405static FNVMXEXITHANDLER     hmR0VmxExitIoInstr;
     406static FNVMXEXITHANDLER     hmR0VmxExitRdmsr;
     407static FNVMXEXITHANDLER     hmR0VmxExitWrmsr;
     408static FNVMXEXITHANDLERNSRC hmR0VmxExitErrInvalidGuestState;
     409static FNVMXEXITHANDLERNSRC hmR0VmxExitErrMsrLoad;
     410static FNVMXEXITHANDLERNSRC hmR0VmxExitErrUndefined;
     411static FNVMXEXITHANDLER     hmR0VmxExitMwait;
     412static FNVMXEXITHANDLER     hmR0VmxExitMtf;
     413static FNVMXEXITHANDLER     hmR0VmxExitMonitor;
     414static FNVMXEXITHANDLER     hmR0VmxExitPause;
     415static FNVMXEXITHANDLERNSRC hmR0VmxExitErrMachineCheck;
     416static FNVMXEXITHANDLERNSRC hmR0VmxExitTprBelowThreshold;
     417static FNVMXEXITHANDLER     hmR0VmxExitApicAccess;
     418static FNVMXEXITHANDLER     hmR0VmxExitXdtrAccess;
     419static FNVMXEXITHANDLER     hmR0VmxExitXdtrAccess;
     420static FNVMXEXITHANDLER     hmR0VmxExitEptViolation;
     421static FNVMXEXITHANDLER     hmR0VmxExitEptMisconfig;
     422static FNVMXEXITHANDLER     hmR0VmxExitRdtscp;
     423static FNVMXEXITHANDLER     hmR0VmxExitPreemptTimer;
     424static FNVMXEXITHANDLERNSRC hmR0VmxExitWbinvd;
     425static FNVMXEXITHANDLER     hmR0VmxExitXsetbv;
     426static FNVMXEXITHANDLER     hmR0VmxExitRdrand;
     427static FNVMXEXITHANDLER     hmR0VmxExitInvpcid;
    403428/** @} */
    404429
     
    89708995
    89718996#ifndef HMVMX_USE_FUNCTION_TABLE
    8972 DECLINLINE(int) hmR0VmxHandleExit(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient, uint32_t rcReason)
    8973 {
    8974 #ifdef DEBUG_ramshankar
    8975 # define SVVMCS()       do { int rc2 = hmR0VmxSaveGuestState(pVCpu, pMixedCtx); AssertRC(rc2); } while (0)
    8976 # define LDVMCS()       do { HMCPU_CF_SET(pVCpu, HM_CHANGED_ALL_GUEST); } while (0)
    8977 #endif
    8978     int rc;
     8997DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExit(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient, uint32_t rcReason)
     8998{
     8999# ifdef DEBUG_ramshankar
     9000#  define RETURN_EXIT_CALL(a_CallExpr) \
     9001       do { \
     9002            /* int rc2 = hmR0VmxSaveGuestState(pVCpu, pMixedCtx); AssertRC(rc2); */ \
     9003            VBOXSTRICTRC rcStrict = a_CallExpr; \
     9004            /* HMCPU_CF_SET(pVCpu, HM_CHANGED_ALL_GUEST); */ \
     9005            return rcStrict; \
     9006        } while (0)
     9007# else
     9008#  define RETURN_EXIT_CALL(a_CallExpr) return a_CallExpr
     9009# endif
    89799010    switch (rcReason)
    89809011    {
    8981         case VMX_EXIT_EPT_MISCONFIG:           /* SVVMCS(); */ rc = hmR0VmxExitEptMisconfig(pVCpu, pMixedCtx, pVmxTransient);      /* LDVMCS(); */ break;
    8982         case VMX_EXIT_EPT_VIOLATION:           /* SVVMCS(); */ rc = hmR0VmxExitEptViolation(pVCpu, pMixedCtx, pVmxTransient);      /* LDVMCS(); */ break;
    8983         case VMX_EXIT_IO_INSTR:                /* SVVMCS(); */ rc = hmR0VmxExitIoInstr(pVCpu, pMixedCtx, pVmxTransient);           /* LDVMCS(); */ break;
    8984         case VMX_EXIT_CPUID:                   /* SVVMCS(); */ rc = hmR0VmxExitCpuid(pVCpu, pMixedCtx, pVmxTransient);             /* LDVMCS(); */ break;
    8985         case VMX_EXIT_RDTSC:                   /* SVVMCS(); */ rc = hmR0VmxExitRdtsc(pVCpu, pMixedCtx, pVmxTransient);             /* LDVMCS(); */ break;
    8986         case VMX_EXIT_RDTSCP:                  /* SVVMCS(); */ rc = hmR0VmxExitRdtscp(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    8987         case VMX_EXIT_APIC_ACCESS:             /* SVVMCS(); */ rc = hmR0VmxExitApicAccess(pVCpu, pMixedCtx, pVmxTransient);        /* LDVMCS(); */ break;
    8988         case VMX_EXIT_XCPT_OR_NMI:             /* SVVMCS(); */ rc = hmR0VmxExitXcptOrNmi(pVCpu, pMixedCtx, pVmxTransient);         /* LDVMCS(); */ break;
    8989         case VMX_EXIT_MOV_CRX:                 /* SVVMCS(); */ rc = hmR0VmxExitMovCRx(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    8990         case VMX_EXIT_EXT_INT:                 /* SVVMCS(); */ rc = hmR0VmxExitExtInt(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    8991         case VMX_EXIT_INT_WINDOW:              /* SVVMCS(); */ rc = hmR0VmxExitIntWindow(pVCpu, pMixedCtx, pVmxTransient);         /* LDVMCS(); */ break;
    8992         case VMX_EXIT_MWAIT:                   /* SVVMCS(); */ rc = hmR0VmxExitMwait(pVCpu, pMixedCtx, pVmxTransient);             /* LDVMCS(); */ break;
    8993         case VMX_EXIT_MONITOR:                 /* SVVMCS(); */ rc = hmR0VmxExitMonitor(pVCpu, pMixedCtx, pVmxTransient);           /* LDVMCS(); */ break;
    8994         case VMX_EXIT_TASK_SWITCH:             /* SVVMCS(); */ rc = hmR0VmxExitTaskSwitch(pVCpu, pMixedCtx, pVmxTransient);        /* LDVMCS(); */ break;
    8995         case VMX_EXIT_PREEMPT_TIMER:           /* SVVMCS(); */ rc = hmR0VmxExitPreemptTimer(pVCpu, pMixedCtx, pVmxTransient);      /* LDVMCS(); */ break;
    8996         case VMX_EXIT_RDMSR:                   /* SVVMCS(); */ rc = hmR0VmxExitRdmsr(pVCpu, pMixedCtx, pVmxTransient);             /* LDVMCS(); */ break;
    8997         case VMX_EXIT_WRMSR:                   /* SVVMCS(); */ rc = hmR0VmxExitWrmsr(pVCpu, pMixedCtx, pVmxTransient);             /* LDVMCS(); */ break;
    8998         case VMX_EXIT_MOV_DRX:                 /* SVVMCS(); */ rc = hmR0VmxExitMovDRx(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    8999         case VMX_EXIT_TPR_BELOW_THRESHOLD:     /* SVVMCS(); */ rc = hmR0VmxExitTprBelowThreshold(pVCpu, pMixedCtx, pVmxTransient); /* LDVMCS(); */ break;
    9000         case VMX_EXIT_HLT:                     /* SVVMCS(); */ rc = hmR0VmxExitHlt(pVCpu, pMixedCtx, pVmxTransient);               /* LDVMCS(); */ break;
    9001         case VMX_EXIT_INVD:                    /* SVVMCS(); */ rc = hmR0VmxExitInvd(pVCpu, pMixedCtx, pVmxTransient);              /* LDVMCS(); */ break;
    9002         case VMX_EXIT_INVLPG:                  /* SVVMCS(); */ rc = hmR0VmxExitInvlpg(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    9003         case VMX_EXIT_RSM:                     /* SVVMCS(); */ rc = hmR0VmxExitRsm(pVCpu, pMixedCtx, pVmxTransient);               /* LDVMCS(); */ break;
    9004         case VMX_EXIT_MTF:                     /* SVVMCS(); */ rc = hmR0VmxExitMtf(pVCpu, pMixedCtx, pVmxTransient);               /* LDVMCS(); */ break;
    9005         case VMX_EXIT_PAUSE:                   /* SVVMCS(); */ rc = hmR0VmxExitPause(pVCpu, pMixedCtx, pVmxTransient);             /* LDVMCS(); */ break;
    9006         case VMX_EXIT_XDTR_ACCESS:             /* SVVMCS(); */ rc = hmR0VmxExitXdtrAccess(pVCpu, pMixedCtx, pVmxTransient);        /* LDVMCS(); */ break;
    9007         case VMX_EXIT_TR_ACCESS:               /* SVVMCS(); */ rc = hmR0VmxExitXdtrAccess(pVCpu, pMixedCtx, pVmxTransient);        /* LDVMCS(); */ break;
    9008         case VMX_EXIT_WBINVD:                  /* SVVMCS(); */ rc = hmR0VmxExitWbinvd(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    9009         case VMX_EXIT_XSETBV:                  /* SVVMCS(); */ rc = hmR0VmxExitXsetbv(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    9010         case VMX_EXIT_RDRAND:                  /* SVVMCS(); */ rc = hmR0VmxExitRdrand(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    9011         case VMX_EXIT_INVPCID:                 /* SVVMCS(); */ rc = hmR0VmxExitInvpcid(pVCpu, pMixedCtx, pVmxTransient);           /* LDVMCS(); */ break;
    9012         case VMX_EXIT_GETSEC:                  /* SVVMCS(); */ rc = hmR0VmxExitGetsec(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    9013         case VMX_EXIT_RDPMC:                   /* SVVMCS(); */ rc = hmR0VmxExitRdpmc(pVCpu, pMixedCtx, pVmxTransient);             /* LDVMCS(); */ break;
    9014         case VMX_EXIT_VMCALL:                  /* SVVMCS(); */ rc = hmR0VmxExitVmcall(pVCpu, pMixedCtx, pVmxTransient);            /* LDVMCS(); */ break;
    9015 
    9016         case VMX_EXIT_TRIPLE_FAULT:            rc = hmR0VmxExitTripleFault(pVCpu, pMixedCtx, pVmxTransient); break;
    9017         case VMX_EXIT_NMI_WINDOW:              rc = hmR0VmxExitNmiWindow(pVCpu, pMixedCtx, pVmxTransient); break;
    9018         case VMX_EXIT_INIT_SIGNAL:             rc = hmR0VmxExitInitSignal(pVCpu, pMixedCtx, pVmxTransient); break;
    9019         case VMX_EXIT_SIPI:                    rc = hmR0VmxExitSipi(pVCpu, pMixedCtx, pVmxTransient); break;
    9020         case VMX_EXIT_IO_SMI:                  rc = hmR0VmxExitIoSmi(pVCpu, pMixedCtx, pVmxTransient); break;
    9021         case VMX_EXIT_SMI:                     rc = hmR0VmxExitSmi(pVCpu, pMixedCtx, pVmxTransient); break;
    9022         case VMX_EXIT_ERR_MSR_LOAD:            rc = hmR0VmxExitErrMsrLoad(pVCpu, pMixedCtx, pVmxTransient); break;
    9023         case VMX_EXIT_ERR_INVALID_GUEST_STATE: rc = hmR0VmxExitErrInvalidGuestState(pVCpu, pMixedCtx, pVmxTransient); break;
    9024         case VMX_EXIT_ERR_MACHINE_CHECK:       rc = hmR0VmxExitErrMachineCheck(pVCpu, pMixedCtx, pVmxTransient); break;
     9012        case VMX_EXIT_EPT_MISCONFIG:           RETURN_EXIT_CALL(hmR0VmxExitEptMisconfig(pVCpu, pMixedCtx, pVmxTransient));
     9013        case VMX_EXIT_EPT_VIOLATION:           RETURN_EXIT_CALL(hmR0VmxExitEptViolation(pVCpu, pMixedCtx, pVmxTransient));
     9014        case VMX_EXIT_IO_INSTR:                RETURN_EXIT_CALL(hmR0VmxExitIoInstr(pVCpu, pMixedCtx, pVmxTransient));
     9015        case VMX_EXIT_CPUID:                   RETURN_EXIT_CALL(hmR0VmxExitCpuid(pVCpu, pMixedCtx, pVmxTransient));
     9016        case VMX_EXIT_RDTSC:                   RETURN_EXIT_CALL(hmR0VmxExitRdtsc(pVCpu, pMixedCtx, pVmxTransient));
     9017        case VMX_EXIT_RDTSCP:                  RETURN_EXIT_CALL(hmR0VmxExitRdtscp(pVCpu, pMixedCtx, pVmxTransient));
     9018        case VMX_EXIT_APIC_ACCESS:             RETURN_EXIT_CALL(hmR0VmxExitApicAccess(pVCpu, pMixedCtx, pVmxTransient));
     9019        case VMX_EXIT_XCPT_OR_NMI:             RETURN_EXIT_CALL(hmR0VmxExitXcptOrNmi(pVCpu, pMixedCtx, pVmxTransient));
     9020        case VMX_EXIT_MOV_CRX:                 RETURN_EXIT_CALL(hmR0VmxExitMovCRx(pVCpu, pMixedCtx, pVmxTransient));
     9021        case VMX_EXIT_EXT_INT:                 RETURN_EXIT_CALL(hmR0VmxExitExtInt(pVCpu, pMixedCtx, pVmxTransient));
     9022        case VMX_EXIT_INT_WINDOW:              RETURN_EXIT_CALL(hmR0VmxExitIntWindow(pVCpu, pMixedCtx, pVmxTransient));
     9023        case VMX_EXIT_MWAIT:                   RETURN_EXIT_CALL(hmR0VmxExitMwait(pVCpu, pMixedCtx, pVmxTransient));
     9024        case VMX_EXIT_MONITOR:                 RETURN_EXIT_CALL(hmR0VmxExitMonitor(pVCpu, pMixedCtx, pVmxTransient));
     9025        case VMX_EXIT_TASK_SWITCH:             RETURN_EXIT_CALL(hmR0VmxExitTaskSwitch(pVCpu, pMixedCtx, pVmxTransient));
     9026        case VMX_EXIT_PREEMPT_TIMER:           RETURN_EXIT_CALL(hmR0VmxExitPreemptTimer(pVCpu, pMixedCtx, pVmxTransient));
     9027        case VMX_EXIT_RDMSR:                   RETURN_EXIT_CALL(hmR0VmxExitRdmsr(pVCpu, pMixedCtx, pVmxTransient));
     9028        case VMX_EXIT_WRMSR:                   RETURN_EXIT_CALL(hmR0VmxExitWrmsr(pVCpu, pMixedCtx, pVmxTransient));
     9029        case VMX_EXIT_MOV_DRX:                 RETURN_EXIT_CALL(hmR0VmxExitMovDRx(pVCpu, pMixedCtx, pVmxTransient));
     9030        case VMX_EXIT_TPR_BELOW_THRESHOLD:     RETURN_EXIT_CALL(hmR0VmxExitTprBelowThreshold(pVCpu, pMixedCtx, pVmxTransient));
     9031        case VMX_EXIT_HLT:                     RETURN_EXIT_CALL(hmR0VmxExitHlt(pVCpu, pMixedCtx, pVmxTransient));
     9032        case VMX_EXIT_INVD:                    RETURN_EXIT_CALL(hmR0VmxExitInvd(pVCpu, pMixedCtx, pVmxTransient));
     9033        case VMX_EXIT_INVLPG:                  RETURN_EXIT_CALL(hmR0VmxExitInvlpg(pVCpu, pMixedCtx, pVmxTransient));
     9034        case VMX_EXIT_RSM:                     RETURN_EXIT_CALL(hmR0VmxExitRsm(pVCpu, pMixedCtx, pVmxTransient));
     9035        case VMX_EXIT_MTF:                     RETURN_EXIT_CALL(hmR0VmxExitMtf(pVCpu, pMixedCtx, pVmxTransient));
     9036        case VMX_EXIT_PAUSE:                   RETURN_EXIT_CALL(hmR0VmxExitPause(pVCpu, pMixedCtx, pVmxTransient));
     9037        case VMX_EXIT_XDTR_ACCESS:             RETURN_EXIT_CALL(hmR0VmxExitXdtrAccess(pVCpu, pMixedCtx, pVmxTransient));
     9038        case VMX_EXIT_TR_ACCESS:               RETURN_EXIT_CALL(hmR0VmxExitXdtrAccess(pVCpu, pMixedCtx, pVmxTransient));
     9039        case VMX_EXIT_WBINVD:                  RETURN_EXIT_CALL(hmR0VmxExitWbinvd(pVCpu, pMixedCtx, pVmxTransient));
     9040        case VMX_EXIT_XSETBV:                  RETURN_EXIT_CALL(hmR0VmxExitXsetbv(pVCpu, pMixedCtx, pVmxTransient));
     9041        case VMX_EXIT_RDRAND:                  RETURN_EXIT_CALL(hmR0VmxExitRdrand(pVCpu, pMixedCtx, pVmxTransient));
     9042        case VMX_EXIT_INVPCID:                 RETURN_EXIT_CALL(hmR0VmxExitInvpcid(pVCpu, pMixedCtx, pVmxTransient));
     9043        case VMX_EXIT_GETSEC:                  RETURN_EXIT_CALL(hmR0VmxExitGetsec(pVCpu, pMixedCtx, pVmxTransient));
     9044        case VMX_EXIT_RDPMC:                   RETURN_EXIT_CALL(hmR0VmxExitRdpmc(pVCpu, pMixedCtx, pVmxTransient));
     9045        case VMX_EXIT_VMCALL:                  RETURN_EXIT_CALL(hmR0VmxExitVmcall(pVCpu, pMixedCtx, pVmxTransient));
     9046
     9047        case VMX_EXIT_TRIPLE_FAULT:            return hmR0VmxExitTripleFault(pVCpu, pMixedCtx, pVmxTransient);
     9048        case VMX_EXIT_NMI_WINDOW:              return hmR0VmxExitNmiWindow(pVCpu, pMixedCtx, pVmxTransient);
     9049        case VMX_EXIT_INIT_SIGNAL:             return hmR0VmxExitInitSignal(pVCpu, pMixedCtx, pVmxTransient);
     9050        case VMX_EXIT_SIPI:                    return hmR0VmxExitSipi(pVCpu, pMixedCtx, pVmxTransient);
     9051        case VMX_EXIT_IO_SMI:                  return hmR0VmxExitIoSmi(pVCpu, pMixedCtx, pVmxTransient);
     9052        case VMX_EXIT_SMI:                     return hmR0VmxExitSmi(pVCpu, pMixedCtx, pVmxTransient);
     9053        case VMX_EXIT_ERR_MSR_LOAD:            return hmR0VmxExitErrMsrLoad(pVCpu, pMixedCtx, pVmxTransient);
     9054        case VMX_EXIT_ERR_INVALID_GUEST_STATE: return hmR0VmxExitErrInvalidGuestState(pVCpu, pMixedCtx, pVmxTransient);
     9055        case VMX_EXIT_ERR_MACHINE_CHECK:       return hmR0VmxExitErrMachineCheck(pVCpu, pMixedCtx, pVmxTransient);
    90259056
    90269057        case VMX_EXIT_VMCLEAR:
     
    90389069        case VMX_EXIT_XSAVES:
    90399070        case VMX_EXIT_XRSTORS:
    9040             rc = hmR0VmxExitSetPendingXcptUD(pVCpu, pMixedCtx, pVmxTransient);
    9041             break;
     9071            return hmR0VmxExitSetPendingXcptUD(pVCpu, pMixedCtx, pVmxTransient);
    90429072        case VMX_EXIT_RESERVED_60:
    90439073        case VMX_EXIT_RDSEED: /* only spurious exits, so undefined */
    90449074        case VMX_EXIT_RESERVED_62:
    90459075        default:
    9046             rc = hmR0VmxExitErrUndefined(pVCpu, pMixedCtx, pVmxTransient);
    9047             break;
    9048     }
    9049     return rc;
     9076            return hmR0VmxExitErrUndefined(pVCpu, pMixedCtx, pVmxTransient);
     9077    }
    90509078}
    90519079#endif /* !HMVMX_USE_FUNCTION_TABLE */
     
    91949222 * Advances the guest RIP after reading it from the VMCS.
    91959223 *
    9196  * @returns VBox status code.
     9224 * @returns VBox status code, no informational status codes.
    91979225 * @param   pVCpu           The cross context virtual CPU structure.
    91989226 * @param   pMixedCtx       Pointer to the guest-CPU context. The data maybe
     
    92239251        hmR0VmxSetPendingDebugXcptVmcs(pVCpu);
    92249252
    9225     return rc;
     9253    return VINF_SUCCESS;
    92269254}
    92279255
     
    98819909
    98829910    /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */
    9883     rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
    9884     if (RT_UNLIKELY(rc != VINF_SUCCESS))
    9885     {
    9886         if (rc == VINF_HM_DOUBLE_FAULT)
    9887             rc = VINF_SUCCESS;
     9911    VBOXSTRICTRC rcStrictRc1 = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
     9912    if (RT_UNLIKELY(rcStrictRc1 == VINF_SUCCESS))
     9913    { /* likely */ }
     9914    else
     9915    {
     9916        if (rcStrictRc1 == VINF_HM_DOUBLE_FAULT)
     9917            rcStrictRc1 = VINF_SUCCESS;
    98889918        STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3);
    9889         return rc;
     9919        return rcStrictRc1;
    98909920    }
    98919921
     
    997310003 * VM-exit handler for interrupt-window exiting (VMX_EXIT_INT_WINDOW).
    997410004 */
    9975 HMVMX_EXIT_DECL hmR0VmxExitIntWindow(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10005HMVMX_EXIT_NSRC_DECL hmR0VmxExitIntWindow(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    997610006{
    997710007    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     
    998910019 * VM-exit handler for NMI-window exiting (VMX_EXIT_NMI_WINDOW).
    999010020 */
    9991 HMVMX_EXIT_DECL hmR0VmxExitNmiWindow(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10021HMVMX_EXIT_NSRC_DECL hmR0VmxExitNmiWindow(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    999210022{
    999310023    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     
    1002610056 * VM-exit handler for WBINVD (VMX_EXIT_WBINVD). Conditional VM-exit.
    1002710057 */
    10028 HMVMX_EXIT_DECL hmR0VmxExitWbinvd(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10058HMVMX_EXIT_NSRC_DECL hmR0VmxExitWbinvd(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1002910059{
    1003010060    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     
    1003710067 * VM-exit handler for INVD (VMX_EXIT_INVD). Unconditional VM-exit.
    1003810068 */
    10039 HMVMX_EXIT_DECL hmR0VmxExitInvd(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10069HMVMX_EXIT_NSRC_DECL hmR0VmxExitInvd(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1004010070{
    1004110071    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     
    1012310153    PVM pVM = pVCpu->CTX_SUFF(pVM);
    1012410154    rc = EMInterpretRdtscp(pVM, pVCpu, pMixedCtx);
    10125     if (RT_LIKELY(rc == VINF_SUCCESS))
     10155    if (RT_SUCCESS(rc))
    1012610156    {
    1012710157        rc  = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
     
    1019110221        /** @todo pre-increment RIP before hypercall will break when we have to implement
    1019210222         *  continuing hypercalls (e.g. Hyper-V). */
     10223        /** @todo r=bird: GIMHypercall will probably have to be able to return
     10224         *        informational status codes, so it should be made VBOXSTRICTRC. Not
     10225         *        doing that now because the status code handling isn't clean (i.e.
     10226         *        if you use RT_SUCCESS(rc) on the result of something, you don't
     10227         *        return rc in the success case, you return VINF_SUCCESS). */
    1019310228        rc = GIMHypercall(pVCpu, pMixedCtx);
    1019410229        /* If the hypercall changes anything other than guest general-purpose registers,
     
    1019610231        return rc;
    1019710232    }
    10198     else
    10199     {
    10200         Log4(("hmR0VmxExitVmcall: Hypercalls not enabled\n"));
    10201         hmR0VmxSetPendingXcptUD(pVCpu, pMixedCtx);
    10202     }
    10203 
     10233
     10234    Log4(("hmR0VmxExitVmcall: Hypercalls not enabled\n"));
     10235    hmR0VmxSetPendingXcptUD(pVCpu, pMixedCtx);
    1020410236    return VINF_SUCCESS;
    1020510237}
     
    1021910251    AssertRCReturn(rc, rc);
    1022010252
    10221     VBOXSTRICTRC rc2 = EMInterpretInvlpg(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), pVmxTransient->uExitQualification);
    10222     rc = VBOXSTRICTRC_VAL(rc2);
    10223     if (RT_LIKELY(rc == VINF_SUCCESS))
    10224         rc = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
     10253    VBOXSTRICTRC rcStrict = EMInterpretInvlpg(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), pVmxTransient->uExitQualification);
     10254    if (RT_LIKELY(rcStrict == VINF_SUCCESS))
     10255        rcStrict = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
    1022510256    else
    10226     {
    10227         AssertMsg(rc == VERR_EM_INTERPRETER, ("hmR0VmxExitInvlpg: EMInterpretInvlpg %#RX64 failed with %Rrc\n",
    10228                                               pVmxTransient->uExitQualification, rc));
    10229     }
     10257        AssertMsg(rcStrict == VERR_EM_INTERPRETER, ("hmR0VmxExitInvlpg: EMInterpretInvlpg %#RX64 failed with %Rrc\n",
     10258                                                    pVmxTransient->uExitQualification, VBOXSTRICTRC_VAL(rcStrict)));
    1023010259    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitInvlpg);
    10231     return rc;
     10260    return rcStrict;
    1023210261}
    1023310262
     
    1029910328 * VM-exit handler for RSM (VMX_EXIT_RSM). Unconditional VM-exit.
    1030010329 */
    10301 HMVMX_EXIT_DECL hmR0VmxExitRsm(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10330HMVMX_EXIT_NSRC_DECL hmR0VmxExitRsm(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1030210331{
    1030310332    /*
     
    1031610345 * VM-exit handler for SMI (VMX_EXIT_SMI). Unconditional VM-exit.
    1031710346 */
    10318 HMVMX_EXIT_DECL hmR0VmxExitSmi(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10347HMVMX_EXIT_NSRC_DECL hmR0VmxExitSmi(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1031910348{
    1032010349    /*
     
    1033310362 * VM-exit handler for IO SMI (VMX_EXIT_IO_SMI). Unconditional VM-exit.
    1033410363 */
    10335 HMVMX_EXIT_DECL hmR0VmxExitIoSmi(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10364HMVMX_EXIT_NSRC_DECL hmR0VmxExitIoSmi(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1033610365{
    1033710366    /* Same treatment as VMX_EXIT_SMI. See comment in hmR0VmxExitSmi(). */
     
    1034510374 * VM-exit handler for SIPI (VMX_EXIT_SIPI). Conditional VM-exit.
    1034610375 */
    10347 HMVMX_EXIT_DECL hmR0VmxExitSipi(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10376HMVMX_EXIT_NSRC_DECL hmR0VmxExitSipi(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1034810377{
    1034910378    /*
     
    1036210391 * VM-exit.
    1036310392 */
    10364 HMVMX_EXIT_DECL hmR0VmxExitInitSignal(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10393HMVMX_EXIT_NSRC_DECL hmR0VmxExitInitSignal(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1036510394{
    1036610395    /*
     
    1041610445 * the guest.
    1041710446 */
    10418 HMVMX_EXIT_DECL hmR0VmxExitSetPendingXcptUD(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10447HMVMX_EXIT_NSRC_DECL hmR0VmxExitSetPendingXcptUD(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1041910448{
    1042010449    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     
    1045910488    pVCpu->hm.s.fLoadSaveGuestXcr0 = (pMixedCtx->cr4 & X86_CR4_OSXSAVE) && pMixedCtx->aXcr[0] != ASMGetXcr0();
    1046010489
    10461     return VBOXSTRICTRC_TODO(rcStrict);
     10490    return rcStrict;
    1046210491}
    1046310492
     
    1048010509 * Error VM-exit.
    1048110510 */
    10482 HMVMX_EXIT_DECL hmR0VmxExitErrInvalidGuestState(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10511HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrInvalidGuestState(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1048310512{
    1048410513    int rc = hmR0VmxSaveGuestState(pVCpu, pMixedCtx);
     
    1053410563 * (VMX_EXIT_ERR_MSR_LOAD). Error VM-exit.
    1053510564 */
    10536 HMVMX_EXIT_DECL hmR0VmxExitErrMsrLoad(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10565HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrMsrLoad(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1053710566{
    1053810567    NOREF(pVmxTransient);
     
    1054610575 * (VMX_EXIT_ERR_MACHINE_CHECK). Error VM-exit.
    1054710576 */
    10548 HMVMX_EXIT_DECL hmR0VmxExitErrMachineCheck(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10577HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrMachineCheck(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1054910578{
    1055010579    NOREF(pVmxTransient);
     
    1055810587 * theory.
    1055910588 */
    10560 HMVMX_EXIT_DECL hmR0VmxExitErrUndefined(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10589HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrUndefined(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1056110590{
    1056210591    AssertMsgFailed(("Huh!? Undefined VM-exit reason %d. pVCpu=%p pMixedCtx=%p\n", pVmxTransient->uExitReason, pVCpu, pMixedCtx));
     
    1064510674              ("hmR0VmxExitRdmsr: failed, invalid error code %Rrc\n", rc));
    1064610675    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdmsr);
    10647     if (RT_LIKELY(rc == VINF_SUCCESS))
     10676    if (RT_SUCCESS(rc))
    1064810677    {
    1064910678        rc = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
     
    1067910708    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitWrmsr);
    1068010709
    10681     if (RT_LIKELY(rc == VINF_SUCCESS))
     10710    if (RT_SUCCESS(rc))
    1068210711    {
    1068310712        rc = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
     
    1079010819 * threshold (VMX_EXIT_TPR_BELOW_THRESHOLD). Conditional VM-exit.
    1079110820 */
    10792 HMVMX_EXIT_DECL hmR0VmxExitTprBelowThreshold(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     10821HMVMX_EXIT_NSRC_DECL hmR0VmxExitTprBelowThreshold(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
    1079310822{
    1079410823    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
     
    1083910868                                                 VMX_EXIT_QUALIFICATION_CRX_REGISTER(uExitQualification),
    1084010869                                                 VMX_EXIT_QUALIFICATION_CRX_GENREG(uExitQualification));
    10841             AssertMsg(rcStrict == VINF_SUCCESS || rcStrict == VINF_IEM_RAISED_XCPT || rcStrict == VINF_PGM_CHANGE_MODE
     10870            AssertMsg(   rcStrict == VINF_SUCCESS || rcStrict == VINF_IEM_RAISED_XCPT || rcStrict == VINF_PGM_CHANGE_MODE
    1084210871                      || rcStrict == VINF_PGM_SYNC_CR3, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
    1084310872            switch (VMX_EXIT_QUALIFICATION_CRX_REGISTER(uExitQualification))
     
    1092810957    STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitMovCRx, y2);
    1092910958    NOREF(pVM);
    10930     return VBOXSTRICTRC_TODO(rcStrict);
     10959    return rcStrict;
    1093110960}
    1093210961
     
    1116411193
    1116511194    STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1);
    11166     return VBOXSTRICTRC_TODO(rcStrict);
     11195    return rcStrict;
    1116711196}
    1116811197
     
    1124211271
    1124311272    /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */
    11244     int rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
    11245     if (RT_UNLIKELY(rc != VINF_SUCCESS))
    11246     {
    11247         if (rc == VINF_HM_DOUBLE_FAULT)
    11248             rc = VINF_SUCCESS;
    11249         return rc;
     11273    VBOXSTRICTRC rcStrict1 = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
     11274    if (RT_LIKELY(rcStrict1 == VINF_SUCCESS))
     11275    { /* likely */ }
     11276    else
     11277    {
     11278        if (rcStrict1 == VINF_HM_DOUBLE_FAULT)
     11279            rcStrict1 = VINF_SUCCESS;
     11280        return rcStrict1;
    1125011281    }
    1125111282
     
    1125311284    /** @todo Investigate if IOMMMIOPhysHandler() requires a lot of state, for now
    1125411285     *   just sync the whole thing. */
    11255     rc = hmR0VmxSaveGuestState(pVCpu, pMixedCtx);
     11286    int rc = hmR0VmxSaveGuestState(pVCpu, pMixedCtx);
    1125611287#else
    1125711288    /* Aggressive state sync. for now. */
    11258     rc  = hmR0VmxSaveGuestRipRspRflags(pVCpu, pMixedCtx);
     11289    int rc  = hmR0VmxSaveGuestRipRspRflags(pVCpu, pMixedCtx);
    1125911290    rc |= hmR0VmxSaveGuestControlRegs(pVCpu, pMixedCtx);
    1126011291    rc |= hmR0VmxSaveGuestSegmentRegs(pVCpu, pMixedCtx);
     
    1126511296    /* See Intel spec. 27-6 "Exit Qualifications for APIC-access VM-exits from Linear Accesses & Guest-Phyiscal Addresses" */
    1126611297    uint32_t uAccessType = VMX_EXIT_QUALIFICATION_APIC_ACCESS_TYPE(pVmxTransient->uExitQualification);
     11298    VBOXSTRICTRC rcStrict2;
    1126711299    switch (uAccessType)
    1126811300    {
     
    1128111313                 VMX_EXIT_QUALIFICATION_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification)));
    1128211314
    11283             VBOXSTRICTRC rc2 = IOMMMIOPhysHandler(pVM, pVCpu,
    11284                                                   uAccessType == VMX_APIC_ACCESS_TYPE_LINEAR_READ ? 0 : X86_TRAP_PF_RW,
    11285                                                   CPUMCTX2CORE(pMixedCtx), GCPhys);
    11286             rc = VBOXSTRICTRC_VAL(rc2);
    11287             Log4(("ApicAccess rc=%d\n", rc));
    11288             if (   rc == VINF_SUCCESS
    11289                 || rc == VERR_PAGE_TABLE_NOT_PRESENT
    11290                 || rc == VERR_PAGE_NOT_PRESENT)
     11315            rcStrict2 = IOMMMIOPhysHandler(pVM, pVCpu,
     11316                                           uAccessType == VMX_APIC_ACCESS_TYPE_LINEAR_READ ? 0 : X86_TRAP_PF_RW,
     11317                                           CPUMCTX2CORE(pMixedCtx), GCPhys);
     11318            Log4(("ApicAccess rcStrict2=%d\n", VBOXSTRICTRC_VAL(rcStrict2)));
     11319            if (   rcStrict2 == VINF_SUCCESS
     11320                || rcStrict2 == VERR_PAGE_TABLE_NOT_PRESENT
     11321                || rcStrict2 == VERR_PAGE_NOT_PRESENT)
    1129111322            {
    1129211323                HMCPU_CF_SET(pVCpu,   HM_CHANGED_GUEST_RIP
     
    1129411325                                    | HM_CHANGED_GUEST_RFLAGS
    1129511326                                    | HM_CHANGED_VMX_GUEST_APIC_STATE);
    11296                 rc = VINF_SUCCESS;
     11327                rcStrict2 = VINF_SUCCESS;
    1129711328            }
    1129811329            break;
     
    1130111332        default:
    1130211333            Log4(("ApicAccess uAccessType=%#x\n", uAccessType));
    11303             rc = VINF_EM_RAW_EMULATE_INSTR;
     11334            rcStrict2 = VINF_EM_RAW_EMULATE_INSTR;
    1130411335            break;
    1130511336    }
    1130611337
    1130711338    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitApicAccess);
    11308     if (rc != VINF_SUCCESS)
     11339    if (rcStrict2 != VINF_SUCCESS)
    1130911340        STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchApicAccessToR3);
    11310     return rc;
     11341    return rcStrict2;
    1131111342}
    1131211343
     
    1132711358    }
    1132811359
    11329     int rc = VERR_INTERNAL_ERROR_5;
    1133011360    if (   !pVCpu->hm.s.fSingleInstruction
    1133111361        && !pVmxTransient->fWasHyperDebugStateActive)
     
    1133611366        /* Don't intercept MOV DRx any more. */
    1133711367        pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT;
    11338         rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
     11368        int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
    1133911369        AssertRCReturn(rc, rc);
    1134011370
     
    1136611396     * Update the segment registers and DR7 from the CPU.
    1136711397     */
    11368     rc = hmR0VmxReadExitQualificationVmcs(pVCpu, pVmxTransient);
    11369     rc |= hmR0VmxSaveGuestSegmentRegs(pVCpu, pMixedCtx);
    11370     rc |= hmR0VmxSaveGuestDR7(pVCpu, pMixedCtx);
     11398    int rc = hmR0VmxReadExitQualificationVmcs(pVCpu, pVmxTransient);
     11399    rc    |= hmR0VmxSaveGuestSegmentRegs(pVCpu, pMixedCtx);
     11400    rc    |= hmR0VmxSaveGuestDR7(pVCpu, pMixedCtx);
    1137111401    AssertRCReturn(rc, rc);
    1137211402    Log4(("CS:RIP=%04x:%08RX64\n", pMixedCtx->cs.Sel, pMixedCtx->rip));
     
    1139511425        int rc2 = hmR0VmxAdvanceGuestRip(pVCpu, pMixedCtx, pVmxTransient);
    1139611426        AssertRCReturn(rc2, rc2);
     11427        return VINF_SUCCESS;
    1139711428    }
    1139811429    return rc;
     
    1141011441
    1141111442    /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */
    11412     int rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
    11413     if (RT_UNLIKELY(rc != VINF_SUCCESS))
    11414     {
    11415         if (rc == VINF_HM_DOUBLE_FAULT)
    11416             rc = VINF_SUCCESS;
    11417         return rc;
     11443    VBOXSTRICTRC rcStrict1 = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
     11444    if (RT_LIKELY(rcStrict1 == VINF_SUCCESS))
     11445    { /* likely */ }
     11446    else
     11447    {
     11448        if (rcStrict1 == VINF_HM_DOUBLE_FAULT)
     11449            rcStrict1 = VINF_SUCCESS;
     11450        return rcStrict1;
    1141811451    }
    1141911452
    1142011453    RTGCPHYS GCPhys = 0;
    11421     rc = VMXReadVmcs64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys);
     11454    int rc = VMXReadVmcs64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys);
    1142211455
    1142311456#if 0
     
    1143911472     */
    1144011473    PVM pVM = pVCpu->CTX_SUFF(pVM);
    11441     VBOXSTRICTRC rc2 = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, PGMMODE_EPT, CPUMCTX2CORE(pMixedCtx), GCPhys, UINT32_MAX);
    11442     rc = VBOXSTRICTRC_VAL(rc2);
    11443     Log4(("EPT misconfig at %#RGv RIP=%#RX64 rc=%d\n", GCPhys, pMixedCtx->rip, rc));
    11444     if (   rc == VINF_SUCCESS
    11445         || rc == VERR_PAGE_TABLE_NOT_PRESENT
    11446         || rc == VERR_PAGE_NOT_PRESENT)
     11474    VBOXSTRICTRC rcStrict2 = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, PGMMODE_EPT, CPUMCTX2CORE(pMixedCtx), GCPhys, UINT32_MAX);
     11475    Log4(("EPT misconfig at %#RGv RIP=%#RX64 rc=%Rrc\n", GCPhys, pMixedCtx->rip, VBOXSTRICTRC_VAL(rcStrict2)));
     11476    if (   rcStrict2 == VINF_SUCCESS
     11477        || rcStrict2 == VERR_PAGE_TABLE_NOT_PRESENT
     11478        || rcStrict2 == VERR_PAGE_NOT_PRESENT)
    1144711479    {
    1144811480        /* Successfully handled MMIO operation. */
     
    1145111483                            | HM_CHANGED_GUEST_RFLAGS
    1145211484                            | HM_CHANGED_VMX_GUEST_APIC_STATE);
    11453         rc = VINF_SUCCESS;
    11454     }
    11455     return rc;
     11485        return VINF_SUCCESS;
     11486    }
     11487    return rcStrict2;
    1145611488}
    1145711489
     
    1146711499
    1146811500    /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */
    11469     int rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
    11470     if (RT_UNLIKELY(rc != VINF_SUCCESS))
    11471     {
    11472         if (rc == VINF_HM_DOUBLE_FAULT)
    11473             rc = VINF_SUCCESS;
    11474         return rc;
     11501    VBOXSTRICTRC rcStrict1 = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient);
     11502    if (RT_LIKELY(rcStrict1 == VINF_SUCCESS))
     11503    { /* likely */ }
     11504    else
     11505    {
     11506        if (rcStrict1 == VINF_HM_DOUBLE_FAULT)
     11507            rcStrict1 = VINF_SUCCESS;
     11508        return rcStrict1;
    1147511509    }
    1147611510
    1147711511    RTGCPHYS GCPhys = 0;
    11478     rc  = VMXReadVmcs64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys);
     11512    int rc  = VMXReadVmcs64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys);
    1147911513    rc |= hmR0VmxReadExitQualificationVmcs(pVCpu, pVmxTransient);
    1148011514#if 0
     
    1150611540    /* Handle the pagefault trap for the nested shadow table. */
    1150711541    PVM pVM = pVCpu->CTX_SUFF(pVM);
    11508     rc = PGMR0Trap0eHandlerNestedPaging(pVM, pVCpu, PGMMODE_EPT, uErrorCode, CPUMCTX2CORE(pMixedCtx), GCPhys);
     11542    VBOXSTRICTRC rcStrict2 = PGMR0Trap0eHandlerNestedPaging(pVM, pVCpu, PGMMODE_EPT, uErrorCode, CPUMCTX2CORE(pMixedCtx), GCPhys);
    1150911543    TRPMResetTrap(pVCpu);
    1151011544
    1151111545    /* Same case as PGMR0Trap0eHandlerNPMisconfig(). See comment above, @bugref{6043}. */
    11512     if (   rc == VINF_SUCCESS
    11513         || rc == VERR_PAGE_TABLE_NOT_PRESENT
    11514         || rc == VERR_PAGE_NOT_PRESENT)
     11546    if (   rcStrict2 == VINF_SUCCESS
     11547        || rcStrict2 == VERR_PAGE_TABLE_NOT_PRESENT
     11548        || rcStrict2 == VERR_PAGE_NOT_PRESENT)
    1151511549    {
    1151611550        /* Successfully synced our nested page tables. */
     
    1152211556    }
    1152311557
    11524     Log4(("EPT return to ring-3 rc=%Rrc\n", rc));
    11525     return rc;
     11558    Log4(("EPT return to ring-3 rcStrict2=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict2)));
     11559    return rcStrict2;
    1152611560}
    1152711561
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