Changeset 72463 in vbox
- Timestamp:
- Jun 6, 2018 2:45:54 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r72452 r72463 2660 2660 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE 2661 2661 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_EXECUTE); 2662 Assert(pMsg->Header.ExecutionState.InterruptionPending); 2662 2663 /* 2664 * Get most of the register state since we'll end up making IEM inject the 2665 * event. The exception isn't normally flaged as a pending event, so duh. 2666 * 2667 * Note! We can optimize this later with event injection. 2668 */ 2669 Log4(("XcptExit/%u: %04x:%08RX64/%s: %x errcd=%#x parm=%RX64\n", 2670 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, nemHCWinExecStateToLogStr(&pMsg->Header), 2671 pMsg->ExceptionVector, pMsg->ErrorCode, pMsg->ExceptionParameter)); 2672 nemHCWinCopyStateFromExceptionMessage(pVCpu, pMsg, pCtx, true /*fClearXcpt*/); 2673 VBOXSTRICTRC rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, pGVCpu, pCtx, NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM, "Xcpt"); 2674 if (rcStrict != VINF_SUCCESS) 2675 return rcStrict; 2663 2676 2664 2677 /* … … 2672 2685 */ 2673 2686 case X86_XCPT_UD: 2687 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionUd); 2688 /** @todo Call GIMXcptUD if required. */ 2674 2689 if (nemHcWinIsInterestingUndefinedOpcode(pMsg->InstructionByteCount, pMsg->InstructionBytes, 2675 2690 pMsg->Header.ExecutionState.EferLma && pMsg->Header.CsSegment.Long )) 2676 2691 { 2677 nemHCWinCopyStateFromExceptionMessage(pVCpu, pMsg, pCtx, true /*fClearXcpt*/); 2678 VBOXSTRICTRC rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, pGVCpu, pCtx, 2679 NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM, "#UD"); 2680 if (rcStrict == VINF_SUCCESS) 2681 { 2682 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pMsg->Header.Rip, pMsg->InstructionBytes, 2683 pMsg->InstructionByteCount); 2684 Log4(("XcptExit/%u: %04x:%08RX64/%s: #UD -> emulated -> %Rrc\n", pVCpu->idCpu, pMsg->Header.CsSegment.Selector, 2685 pMsg->Header.Rip, nemHCWinExecStateToLogStr(&pMsg->Header), VBOXSTRICTRC_VAL(rcStrict) )); 2686 } 2687 else 2688 Log4(("XcptExit/%u: %04x:%08RX64/%s: #UD -> state import (emulate) -> %Rrc\n", 2689 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, 2690 nemHCWinExecStateToLogStr(&pMsg->Header), VBOXSTRICTRC_VAL(rcStrict) )); 2692 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pMsg->Header.Rip, pMsg->InstructionBytes, 2693 pMsg->InstructionByteCount); 2694 Log4(("XcptExit/%u: %04x:%08RX64/%s: #UD -> emulated -> %Rrc\n", 2695 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, 2696 nemHCWinExecStateToLogStr(&pMsg->Header), VBOXSTRICTRC_VAL(rcStrict) )); 2697 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionUdHandled); 2691 2698 return rcStrict; 2692 2699 } … … 2699 2706 */ 2700 2707 case X86_XCPT_DB: 2708 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionDb); 2709 Log4(("XcptExit/%u: %04x:%08RX64/%s: #DB - TODO\n", 2710 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, nemHCWinExecStateToLogStr(&pMsg->Header) )); 2701 2711 break; 2702 2712 2703 2713 case X86_XCPT_BP: 2714 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionBp); 2715 Log4(("XcptExit/%u: %04x:%08RX64/%s: #BP - TODO\n", 2716 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, nemHCWinExecStateToLogStr(&pMsg->Header) )); 2704 2717 break; 2705 2718 … … 2709 2722 } 2710 2723 2711 return VINF_SUCCESS; 2724 /* 2725 * Inject it. 2726 */ 2727 rcStrict = IEMInjectTrap(pVCpu, pMsg->ExceptionVector, TRPM_TRAP, pMsg->ErrorCode, 2728 pMsg->ExceptionParameter /*??*/, pMsg->Header.InstructionLength); 2729 Log4(("XcptExit/%u: %04x:%08RX64/%s: %#u -> injected -> %Rrc\n", 2730 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, 2731 nemHCWinExecStateToLogStr(&pMsg->Header), pMsg->ExceptionVector, VBOXSTRICTRC_VAL(rcStrict) )); 2732 return rcStrict; 2712 2733 } 2713 2734 #elif defined(IN_RING3) … … 2754 2775 */ 2755 2776 case X86_XCPT_UD: 2777 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionUd); 2756 2778 /** @todo Call GIMXcptUD if required. */ 2757 2779 if (nemHcWinIsInterestingUndefinedOpcode(pExit->VpException.InstructionByteCount, pExit->VpException.InstructionBytes, … … 2764 2786 pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, 2765 2787 nemR3WinExecStateToLogStr(&pExit->VpContext), VBOXSTRICTRC_VAL(rcStrict) )); 2788 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionUdHandled); 2766 2789 return rcStrict; 2767 2790 } … … 2776 2799 */ 2777 2800 case X86_XCPT_DB: 2801 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionDb); 2778 2802 Log4(("XcptExit/%u: %04x:%08RX64/%s: #DB - TODO\n", 2779 2803 pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext) )); … … 2781 2805 2782 2806 case X86_XCPT_BP: 2807 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionBp); 2783 2808 Log4(("XcptExit/%u: %04x:%08RX64/%s: #BP - TODO\n", 2784 2809 pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext) )); -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp
r72446 r72463 1216 1216 STAMR3RegisterF(pVM, &pNemCpu->StatExitCpuId, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of CPUID exits", "/NEM/CPU%u/ExitCpuId", iCpu); 1217 1217 STAMR3RegisterF(pVM, &pNemCpu->StatExitMsr, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of MSR access exits", "/NEM/CPU%u/ExitMsr", iCpu); 1218 STAMR3RegisterF(pVM, &pNemCpu->StatExitException, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of exception exits", "/NEM/CPU%u/ExitException", iCpu); 1218 STAMR3RegisterF(pVM, &pNemCpu->StatExitException, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of exception exits", "/NEM/CPU%u/ExitException", iCpu); 1219 STAMR3RegisterF(pVM, &pNemCpu->StatExitExceptionBp, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of #BP exits", "/NEM/CPU%u/ExitExceptionBp", iCpu); 1220 STAMR3RegisterF(pVM, &pNemCpu->StatExitExceptionDb, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of #DB exits", "/NEM/CPU%u/ExitExceptionDb", iCpu); 1221 STAMR3RegisterF(pVM, &pNemCpu->StatExitExceptionUd, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of #UD exits", "/NEM/CPU%u/ExitExceptionUd", iCpu); 1222 STAMR3RegisterF(pVM, &pNemCpu->StatExitExceptionUdHandled, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of handled #UD exits", "/NEM/CPU%u/ExitExceptionUdHandled", iCpu); 1219 1223 STAMR3RegisterF(pVM, &pNemCpu->StatExitUnrecoverable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of unrecoverable exits", "/NEM/CPU%u/ExitUnrecoverable", iCpu); 1220 1224 STAMR3RegisterF(pVM, &pNemCpu->StatGetMsgTimeout, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of get message timeouts/alerts", "/NEM/CPU%u/GetMsgTimeout", iCpu); -
trunk/src/VBox/VMM/include/NEMInternal.h
r72446 r72463 252 252 STAMCOUNTER StatExitMsr; 253 253 STAMCOUNTER StatExitException; 254 STAMCOUNTER StatExitExceptionBp; 255 STAMCOUNTER StatExitExceptionDb; 256 STAMCOUNTER StatExitExceptionUd; 257 STAMCOUNTER StatExitExceptionUdHandled; 254 258 STAMCOUNTER StatExitUnrecoverable; 255 259 STAMCOUNTER StatGetMsgTimeout;
Note:
See TracChangeset
for help on using the changeset viewer.