Changeset 71184 in vbox for trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp
- Timestamp:
- Mar 3, 2018 3:01:59 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp
r71152 r71184 210 210 # define WHvGetVirtualProcessorRegisters g_pfnWHvGetVirtualProcessorRegisters 211 211 # define WHvSetVirtualProcessorRegisters g_pfnWHvSetVirtualProcessorRegisters 212 213 # define VidMessageSlotHandleAndGetNext g_pfnVidMessageSlotHandleAndGetNext 214 # define VidStartVirtualProcessor g_pfnVidStartVirtualProcessor 215 # define VidStopVirtualProcessor g_pfnVidStopVirtualProcessor 216 212 217 #endif 213 218 … … 1337 1342 } 1338 1343 1339 1340 #ifdef LOG_ENABLED 1341 1344 #ifndef NEM_WIN_USE_OUR_OWN_RUN_API 1345 1346 # ifdef LOG_ENABLED 1342 1347 /** 1343 1348 * Log the full details of an exit reason. … … 1392 1397 break; 1393 1398 1394 # if 01399 # if 0 1395 1400 case WHvRunVpExitReasonUnrecoverableException: 1396 1401 case WHvRunVpExitReasonInvalidVpRegisterValue: … … 1410 1415 WHV_X64_UNSUPPORTED_FEATURE_CONTEXT UnsupportedFeature; 1411 1416 WHV_RUN_VP_CANCELED_CONTEXT CancelReason; 1412 # endif1417 # endif 1413 1418 1414 1419 case WHvRunVpExitReasonNone: … … 1455 1460 } 1456 1461 } 1457 1458 #endif /* LOG_ENABLED */ 1462 # endif /* LOG_ENABLED */ 1463 1464 1465 /** 1466 * Advances the guest RIP and clear EFLAGS.RF. 1467 * 1468 * This may clear VMCPU_FF_INHIBIT_INTERRUPTS. 1469 * 1470 * @param pVCpu The cross context virtual CPU structure. 1471 * @param pCtx The CPU context to update. 1472 * @param pExitCtx The exit context. 1473 */ 1474 DECLINLINE(void) nemR3WinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, PCPUMCTX pCtx, WHV_VP_EXIT_CONTEXT const *pExitCtx) 1475 { 1476 /* Advance the RIP. */ 1477 Assert(pExitCtx->InstructionLength > 0 && pExitCtx->InstructionLength < 16); 1478 pCtx->rip += pExitCtx->InstructionLength; 1479 pCtx->rflags.Bits.u1RF = 0; 1480 1481 /* Update interrupt inhibition. */ 1482 if (!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)) 1483 { /* likely */ } 1484 else if (pCtx->rip != EMGetInhibitInterruptsPC(pVCpu)) 1485 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS); 1486 } 1459 1487 1460 1488 … … 1467 1495 1468 1496 1469 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_PAGES1497 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_PAGES 1470 1498 /** 1471 1499 * @callback_method_impl{FNPGMPHYSNEMENUMCALLBACK, … … 1493 1521 return VINF_SUCCESS; 1494 1522 } 1495 # endif /* !NEM_WIN_USE_HYPERCALLS_FOR_PAGES */1523 # endif /* !NEM_WIN_USE_HYPERCALLS_FOR_PAGES */ 1496 1524 1497 1525 … … 1587 1615 pIoPortCtx->AccessInfo.AccessSize); 1588 1616 if (IOM_SUCCESS(rcStrict)) 1589 nem HCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pIoPortCtx->VpContext);1617 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pIoPortCtx->VpContext); 1590 1618 } 1591 1619 else … … 1597 1625 { 1598 1626 pCtx->eax = (pCtx->eax & ~fAndMask) | (uValue & fAndMask); 1599 nem HCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pIoPortCtx->VpContext);1627 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pIoPortCtx->VpContext); 1600 1628 } 1601 1629 } … … 1692 1720 VBOXSTRICTRC nemR3WinWHvRunGC(PVM pVM, PVMCPU pVCpu) 1693 1721 { 1694 # ifdef LOG_ENABLED1722 # ifdef LOG_ENABLED 1695 1723 if (LogIs3Enabled()) 1696 1724 { … … 1698 1726 nemHCWinLogState(pVM, pVCpu); 1699 1727 } 1700 # endif1728 # endif 1701 1729 1702 1730 /* … … 1725 1753 && !VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_HM_TO_R3_MASK)) 1726 1754 { 1727 #ifdef NEM_WIN_USE_OUR_OWN_RUN_API1728 int rc2 = nemHCWinRunVirtualProcessor(pVM, pVCpu, &ExitReason, sizeof(ExitReason));1729 AssertRCBreakStmt(rc2, rcStrict = rc2);1730 #else1731 1755 Log8(("Calling WHvRunVirtualProcessor\n")); 1732 1756 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM, VMCPUSTATE_STARTED); … … 1739 1763 Log2(("WHvRunVirtualProcessor -> %#x; exit code %#x (%d) (cpu status %u)\n", 1740 1764 hrc, ExitReason.ExitReason, ExitReason.ExitReason, nemR3WinCpuGetRunningStatus(pVCpu) )); 1741 #endif1742 1765 } 1743 1766 else … … 1753 1776 AssertRCBreakStmt(rc2, rcStrict = rc2); 1754 1777 1755 # ifdef LOG_ENABLED1778 # ifdef LOG_ENABLED 1756 1779 /* 1757 1780 * Do some logging. … … 1761 1784 if (LogIs3Enabled()) 1762 1785 nemHCWinLogState(pVM, pVCpu); 1763 # endif1764 1765 # ifdef VBOX_STRICT1786 # endif 1787 1788 # ifdef VBOX_STRICT 1766 1789 /* Assert that the VpContext field makes sense. */ 1767 1790 switch (ExitReason.ExitReason) … … 1792 1815 default: break; /* shut up compiler. */ 1793 1816 } 1794 # endif1817 # endif 1795 1818 1796 1819 /* … … 1859 1882 } 1860 1883 1861 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_PAGES1884 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_PAGES 1862 1885 /* Hack alert! */ 1863 1886 uint32_t const cMappedPages = pVM->nem.s.cMappedPages; … … 1869 1892 Log(("nemR3NativeRunGC: Unmapped all; cMappedPages=%u -> %u\n", cMappedPages, pVM->nem.s.cMappedPages)); 1870 1893 } 1871 # endif1894 # endif 1872 1895 1873 1896 /* If any FF is pending, return to the EM loops. That's okay for the … … 1884 1907 } 1885 1908 1909 #endif /* !NEM_WIN_USE_OUR_OWN_RUN_API */ 1910 1886 1911 1887 1912 VBOXSTRICTRC nemR3NativeRunGC(PVM pVM, PVMCPU pVCpu) 1888 1913 { 1889 #if 11914 #ifndef NEM_WIN_USE_OUR_OWN_RUN_API 1890 1915 return nemR3WinWHvRunGC(pVM, pVCpu); 1891 1916 #elif 1
Note:
See TracChangeset
for help on using the changeset viewer.