Changeset 71293 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Mar 9, 2018 9:11:20 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r71224 r71293 839 839 { 840 840 Log8(("nemHCWinCancelRunVirtualProcessor: Switched %u to canceled state\n", pVCpu->idCpu)); 841 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatCancelChangedState); 841 842 return VINF_SUCCESS; 842 843 } … … 854 855 Assert(rcNt == STATUS_SUCCESS); 855 856 if (NT_SUCCESS(rcNt)) 857 { 858 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatCancelAlertedThread); 856 859 return VINF_SUCCESS; 860 } 857 861 AssertLogRelMsgFailedReturn(("NtAlertThread failed: %#x\n", rcNt), RTErrConvertFromNtStatus(rcNt)); 858 862 } … … 1454 1458 case HvMessageTypeUnmappedGpa: 1455 1459 Assert(pMsg->Header.PayloadSize == RT_UOFFSETOF(HV_X64_MEMORY_INTERCEPT_MESSAGE, DsSegment)); 1460 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitMemUnmapped); 1456 1461 return nemHCWinHandleMessageMemory(pVM, pVCpu, &pMsg->X64MemoryIntercept, pCtx, pGVCpu); 1457 1462 1458 1463 case HvMessageTypeGpaIntercept: 1459 1464 Assert(pMsg->Header.PayloadSize == RT_UOFFSETOF(HV_X64_MEMORY_INTERCEPT_MESSAGE, DsSegment)); 1465 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitMemIntercept); 1460 1466 return nemHCWinHandleMessageMemory(pVM, pVCpu, &pMsg->X64MemoryIntercept, pCtx, pGVCpu); 1461 1467 1462 1468 case HvMessageTypeX64IoPortIntercept: 1463 1469 Assert(pMsg->Header.PayloadSize == sizeof(pMsg->X64IoPortIntercept)); 1470 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitPortIo); 1464 1471 return nemHCWinHandleMessageIoPort(pVM, pVCpu, &pMsg->X64IoPortIntercept, pCtx, pGVCpu); 1465 1472 1466 1473 case HvMessageTypeX64Halt: 1474 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitHalt); 1467 1475 return VINF_EM_HALT; 1468 1476 … … 1536 1544 { 1537 1545 Log8(("nemHCWinStopCpu: Stopping CPU succeeded (cpu status %u)\n", nemHCWinCpuGetRunningStatus(pVCpu) )); 1546 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatStopCpuSuccess); 1538 1547 return rcStrict; 1539 1548 } … … 1543 1552 { 1544 1553 Log8(("nemHCWinStopCpu: Stopping CPU succeeded (cpu status %u)\n", nemHCWinCpuGetRunningStatus(pVCpu) )); 1554 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatStopCpuSuccess); 1545 1555 return rcStrict; 1546 1556 } … … 1560 1570 # endif 1561 1571 Log8(("nemHCWinStopCpu: Stopping CPU pending...\n")); 1572 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatStopCpuPending); 1562 1573 1563 1574 /* … … 1652 1663 1653 1664 /* 1665 * Try switch to NEM runloop state. 1666 */ 1667 if (VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM, VMCPUSTATE_STARTED)) 1668 { /* likely */ } 1669 else 1670 { 1671 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM, VMCPUSTATE_STARTED_EXEC_NEM_CANCELED); 1672 LogFlow(("NEM/%u: returning immediately because canceled\n", pVCpu->idCpu)); 1673 return VINF_SUCCESS; 1674 } 1675 1676 /* 1654 1677 * The run loop. 1655 1678 * … … 1704 1727 } 1705 1728 1706 if (VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM_WAIT, VMCPUSTATE_STARTED ))1729 if (VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM_WAIT, VMCPUSTATE_STARTED_EXEC_NEM)) 1707 1730 { 1708 1731 # ifdef IN_RING0 … … 1714 1737 sizeof(pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext), 1715 1738 NULL, 0); 1716 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED , VMCPUSTATE_STARTED_EXEC_NEM_WAIT);1739 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM, VMCPUSTATE_STARTED_EXEC_NEM_WAIT); 1717 1740 if (rcNt == STATUS_SUCCESS) 1718 1741 # else 1719 1742 BOOL fRet = VidMessageSlotHandleAndGetNext(pVM->nem.s.hPartitionDevice, pVCpu->idCpu, 1720 1743 pVCpu->nem.s.fHandleAndGetFlags, cMillies); 1721 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED , VMCPUSTATE_STARTED_EXEC_NEM_WAIT);1744 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM, VMCPUSTATE_STARTED_EXEC_NEM_WAIT); 1722 1745 if (fRet) 1723 1746 # endif … … 1733 1756 { 1734 1757 LogFlow(("NEM/%u: breaking: nemHCWinHandleMessage -> %Rrc\n", pVCpu->idCpu, VBOXSTRICTRC_VAL(rcStrict) )); 1758 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnStatus); 1735 1759 break; 1736 1760 } … … 1750 1774 , ("VidMessageSlotHandleAndGetNext failed for CPU #%u: %#x (%u)\n", pVCpu->idCpu, rcNt, rcNt), 1751 1775 VERR_INTERNAL_ERROR_3); 1752 pVCpu->nem.s.fHandleAndGetFlags = VID_MSHAGN_F_GET_NEXT_MESSAGE; /* exits are likely */ 1776 pVCpu->nem.s.fHandleAndGetFlags = VID_MSHAGN_F_GET_NEXT_MESSAGE; 1777 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatGetMsgTimeout); 1753 1778 } 1754 1779 … … 1764 1789 LogFlow(("NEM/%u: breaking: pending FF (%#x / %#x)\n", 1765 1790 pVCpu->idCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions)); 1791 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnFFPost); 1766 1792 } 1767 1793 else 1794 { 1768 1795 LogFlow(("NEM/%u: breaking: canceled %d (pre exec)\n", pVCpu->idCpu, VMCPU_GET_STATE(pVCpu) )); 1796 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnCancel); 1797 } 1769 1798 } 1770 1799 else 1800 { 1771 1801 LogFlow(("NEM/%u: breaking: pending FF (pre exec)\n", pVCpu->idCpu)); 1802 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnFFPre); 1803 } 1772 1804 break; 1773 1805 } /* the run loop */ … … 1784 1816 } 1785 1817 1786 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED, VMCPUSTATE_STARTED_EXEC_NEM_CANCELED); 1818 if (!VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED, VMCPUSTATE_STARTED_EXEC_NEM)) 1819 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED, VMCPUSTATE_STARTED_EXEC_NEM_CANCELED); 1787 1820 1788 1821 if (pCtx->fExtrn & (CPUMCTX_EXTRN_ALL | (CPUMCTX_EXTRN_NEM_WIN_MASK & ~CPUMCTX_EXTRN_NEM_WIN_EVENT_INJECT)))
Note:
See TracChangeset
for help on using the changeset viewer.