VirtualBox

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


Ignore:
Timestamp:
Jun 5, 2018 2:35:45 PM (7 years ago)
Author:
vboxsync
Message:

NEM/win: Working on vmcall in ring-3. bugref:9044

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h

    r72446 r72452  
    27292729     */
    27302730    AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));
    2731 #if 0
    2732     Log4(("XcptExit/%u: %04x:%08RX64/%s: %x\n", pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext), pExit->VpException.ExceptionType));
     2731
     2732    /*
     2733     * Get most of the register state since we'll end up making IEM inject the
     2734     * event.  The exception isn't normally flaged as a pending event, so duh.
     2735     *
     2736     * Note! We can optimize this later with event injection.
     2737     */
     2738    Log4(("XcptExit/%u: %04x:%08RX64/%s: %x errcd=%#x parm=%RX64\n", pVCpu->idCpu, pExit->VpContext.Cs.Selector,
     2739          pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext), pExit->VpException.ExceptionType,
     2740          pExit->VpException.ErrorCode, pExit->VpException.ExceptionParameter ));
    27332741    nemR3WinCopyStateFromExceptionMessage(pVCpu, pExit, pCtx, true /*fClearXcpt*/);
    2734     VBOXSTRICTRC rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, NULL, pCtx, NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM, "#UD");
     2742    VBOXSTRICTRC rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, NULL, pCtx, NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM, "Xcpt");
    27352743    if (rcStrict != VINF_SUCCESS)
    27362744        return rcStrict;
    2737 #endif
    2738     Assert(pExit->VpContext.ExecutionState.InterruptionPending);
    27392745
    27402746    /*
     
    27482754         */
    27492755        case X86_XCPT_UD:
     2756            /** @todo Call GIMXcptUD if required. */
    27502757            if (nemHcWinIsInterestingUndefinedOpcode(pExit->VpException.InstructionByteCount, pExit->VpException.InstructionBytes,
    27512758                                                     pExit->VpContext.ExecutionState.EferLma && pExit->VpContext.Cs.Long ))
    27522759            {
    2753                 nemR3WinCopyStateFromExceptionMessage(pVCpu, pExit, pCtx, true /*fClearXcpt*/);
    2754                 VBOXSTRICTRC rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, NULL, pCtx,
    2755                                                                           NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM, "#UD");
    2756                 if (rcStrict == VINF_SUCCESS)
    2757                 {
    2758                     rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pExit->VpContext.Rip,
    2759                                                             pExit->VpException.InstructionBytes,
    2760                                                             pExit->VpException.InstructionByteCount);
    2761                     Log4(("XcptExit/%u: %04x:%08RX64/%s: #UD -> emulated -> %Rrc\n",
    2762                           pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip,
    2763                           nemR3WinExecStateToLogStr(&pExit->VpContext), VBOXSTRICTRC_VAL(rcStrict) ));
    2764                 }
    2765                 else
    2766                     Log4(("XcptExit/%u: %04x:%08RX64/%s: #UD -> state import (emulate) -> %Rrc\n",
    2767                           pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip,
    2768                           nemR3WinExecStateToLogStr(&pExit->VpContext), VBOXSTRICTRC_VAL(rcStrict) ));
     2760                rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pExit->VpContext.Rip,
     2761                                                        pExit->VpException.InstructionBytes,
     2762                                                        pExit->VpException.InstructionByteCount);
     2763                Log4(("XcptExit/%u: %04x:%08RX64/%s: #UD -> emulated -> %Rrc\n",
     2764                      pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip,
     2765                      nemR3WinExecStateToLogStr(&pExit->VpContext), VBOXSTRICTRC_VAL(rcStrict) ));
    27692766                return rcStrict;
    27702767            }
     2768
    27712769            Log4(("XcptExit/%u: %04x:%08RX64/%s: #UD [%.*Rhxs] -> re-injected\n", pVCpu->idCpu,
    27722770                  pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext),
     
    27782776         */
    27792777        case X86_XCPT_DB:
     2778            Log4(("XcptExit/%u: %04x:%08RX64/%s: #DB - TODO\n",
     2779                  pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext) ));
    27802780            break;
    27812781
    27822782        case X86_XCPT_BP:
     2783            Log4(("XcptExit/%u: %04x:%08RX64/%s: #BP - TODO\n",
     2784                  pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext) ));
    27832785            break;
    27842786
     
    27882790    }
    27892791
     2792    /*
     2793     * Inject it.
     2794     */
     2795    rcStrict = IEMInjectTrap(pVCpu, pExit->VpException.ExceptionType, TRPM_TRAP, pExit->VpException.ErrorCode,
     2796                             pExit->VpException.ExceptionParameter /*??*/, pExit->VpContext.InstructionLength);
     2797    Log4(("XcptExit/%u: %04x:%08RX64/%s: %#u -> injected -> %Rrc\n",
     2798          pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip,
     2799          nemR3WinExecStateToLogStr(&pExit->VpContext), pExit->VpException.ExceptionType, VBOXSTRICTRC_VAL(rcStrict) ));
     2800
    27902801    RT_NOREF_PV(pVM);
    2791     return VINF_SUCCESS;
     2802    return rcStrict;
    27922803}
    27932804#endif /* IN_RING3 && !NEM_WIN_USE_OUR_OWN_RUN_API */
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