Changeset 72565 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 15, 2018 1:30:01 PM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r72564 r72565 450 450 * @param uCs The CS. 451 451 * @param uEip The EIP. 452 * @param uTimestamp The TSC value for the exit, 0 if not available. 452 453 * @thread EMT(0) 453 454 */ 454 VMMRC_INT_DECL(void) EMRCHistoryAddExit NoTs(PVMCPU pVCpu, uint32_t uFlagsAndType, uint16_t uCs, uint32_t uEip)455 VMMRC_INT_DECL(void) EMRCHistoryAddExitCsEip(PVMCPU pVCpu, uint32_t uFlagsAndType, uint16_t uCs, uint32_t uEip, uint64_t uTimestamp) 455 456 { 456 457 AssertCompile(RT_ELEMENTS(pVCpu->em.s.aExitHistory) == 256); 457 458 PEMEXITENTRY pHistEntry = &pVCpu->em.s.aExitHistory[(uintptr_t)(pVCpu->em.s.iNextExit++) & 0xff]; 458 459 pHistEntry->uFlatPC = ((uint64_t)uCs << 32) | uEip; 459 pHistEntry->uTimestamp = 0;460 pHistEntry->uTimestamp = uTimestamp; 460 461 pHistEntry->uFlagsAndType = uFlagsAndType | EMEXIT_F_CS_EIP; 461 462 pHistEntry->idxSlot = UINT32_MAX; -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r72490 r72565 449 449 450 450 EM_REG_PROFILE_ADV(&pVCpu->em.s.StatTotal, "/PROF/CPU%d/EM/Total", "Profiling EMR3ExecuteVM."); 451 452 rc = STAMR3RegisterF(pVM, &pVCpu->em.s.iNextExit, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, 453 "Number of recorded exits (R0/RC).", "/PROF/CPU%u/EM/RecordedExits", i); 454 AssertRC(rc); 455 451 456 } 452 457 -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r72564 r72565 333 333 LogFlow(("TRPMGC01: cs:eip=%04x:%08x uDr6=%RTreg EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, uDr6, CPUMRawGetEFlags(pVCpu))); 334 334 TRPM_ENTER_DBG_HOOK(1); 335 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_DB), pRegFrame->cs.Sel, pRegFrame->eip); 335 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_DB), 336 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 336 337 337 338 /* … … 387 388 PVMCPU pVCpu = TRPMCPU_2_VMCPU(pTrpmCpu); 388 389 TRPM_ENTER_DBG_HOOK_HYPER(1); 389 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_DB), pRegFrame->cs.Sel, pRegFrame->eip); 390 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_DB), 391 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 390 392 LogFlow(("TRPMGCHyper01: cs:eip=%04x:%08x uDr6=%RTreg\n", pRegFrame->cs.Sel, pRegFrame->eip, uDr6)); 391 393 … … 428 430 { 429 431 LogFlow(("TRPMGCTrap02Handler: cs:eip=%04x:%08x\n", pRegFrame->cs.Sel, pRegFrame->eip)); 430 EMRCHistoryAddExit NoTs(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NMI),431 pRegFrame->cs.Sel, pRegFrame->eip );432 EMRCHistoryAddExitCsEip(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NMI), 433 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 432 434 #if 0 /* Enable this iff you have a COM port and really want this debug info. */ 433 435 RTLogComPrintf("TRPMGCTrap02Handler: cs:eip=%04x:%08x\n", pRegFrame->cs.Sel, pRegFrame->eip); … … 456 458 { 457 459 LogFlow(("TRPMGCHyperTrap02Handler: cs:eip=%04x:%08x\n", pRegFrame->cs.Sel, pRegFrame->eip)); 458 EMRCHistoryAddExit NoTs(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NMI),459 pRegFrame->cs.Sel, pRegFrame->eip );460 EMRCHistoryAddExitCsEip(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NMI), 461 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 460 462 #if 0 /* Enable this iff you have a COM port and really want this debug info. */ 461 463 RTLogComPrintf("TRPMGCHyperTrap02Handler: cs:eip=%04x:%08x\n", pRegFrame->cs.Sel, pRegFrame->eip); … … 484 486 LogFlow(("TRPMGC03: %04x:%08x EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, CPUMRawGetEFlags(pVCpu))); 485 487 TRPM_ENTER_DBG_HOOK(3); 486 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_BP), pRegFrame->cs.Sel, pRegFrame->eip); 488 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_BP), 489 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 487 490 PGMRZDynMapStartAutoSet(pVCpu); 488 491 … … 537 540 LogFlow(("TRPMGCHyper03: %04x:%08x EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, CPUMRawGetEFlags(pVCpu))); 538 541 TRPM_ENTER_DBG_HOOK_HYPER(3); 539 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_BP), pRegFrame->cs.Sel, pRegFrame->eip); 542 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_BP), 543 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 540 544 541 545 /* … … 569 573 LogFlow(("TRPMGC06: %04x:%08x EFL=%#x/%#x\n", pRegFrame->cs.Sel, pRegFrame->eip, pRegFrame->eflags.u32, CPUMRawGetEFlags(pVCpu))); 570 574 TRPM_ENTER_DBG_HOOK(6); 571 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_UD), pRegFrame->cs.Sel, pRegFrame->eip); 575 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_UD), 576 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 572 577 PGMRZDynMapStartAutoSet(pVCpu); 573 578 … … 706 711 LogFlow(("TRPMGC07: %04x:%08x EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, CPUMRawGetEFlags(pVCpu))); 707 712 TRPM_ENTER_DBG_HOOK(7); 708 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NM), pRegFrame->cs.Sel, pRegFrame->eip); 713 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NM), 714 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 709 715 PGMRZDynMapStartAutoSet(pVCpu); 710 716 … … 733 739 LogFlow(("TRPMGC0b: %04x:%08x EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, CPUMRawGetEFlags(pVCpu))); 734 740 TRPM_ENTER_DBG_HOOK(0xb); 735 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NP), pRegFrame->cs.Sel, pRegFrame->eip); 741 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NP), 742 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 736 743 PGMRZDynMapStartAutoSet(pVCpu); 737 744 … … 1250 1257 LogFlow(("TRPMGC0d: %04x:%08x err=%x EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, (uint32_t)pVCpu->trpm.s.uActiveErrorCode, CPUMRawGetEFlags(pVCpu))); 1251 1258 TRPM_ENTER_DBG_HOOK(0xd); 1252 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_GP), pRegFrame->cs.Sel, pRegFrame->eip); 1259 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_GP), 1260 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 1253 1261 1254 1262 PGMRZDynMapStartAutoSet(pVCpu); … … 1316 1324 LogFlow(("TRPMGC0e: %04x:%08x err=%x cr2=%08x EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, (uint32_t)pVCpu->trpm.s.uActiveErrorCode, (uint32_t)pVCpu->trpm.s.uActiveCR2, CPUMRawGetEFlags(pVCpu))); 1317 1325 TRPM_ENTER_DBG_HOOK(0xe); 1318 EMRCHistoryAddExitNoTs(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_PF), pRegFrame->cs.Sel, pRegFrame->eip); 1326 EMRCHistoryAddExitCsEip(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_PF), 1327 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 1319 1328 1320 1329 /* … … 1432 1441 DECLASM(int) TRPMGCHyperTrap0bHandler(PTRPMCPU pTrpmCpu, PCPUMCTXCORE pRegFrame) 1433 1442 { 1434 EMRCHistoryAddExit NoTs(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NP),1435 pRegFrame->cs.Sel, pRegFrame->eip);1443 EMRCHistoryAddExitCsEip(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_NP), 1444 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 1436 1445 return trpmGCHyperGeneric(TRPMCPU_2_VM(pTrpmCpu), pRegFrame, g_aTrap0bHandlers, g_aTrap0bHandlersEnd); 1437 1446 } … … 1453 1462 DECLASM(int) TRPMGCHyperTrap0dHandler(PTRPMCPU pTrpmCpu, PCPUMCTXCORE pRegFrame) 1454 1463 { 1455 EMRCHistoryAddExit NoTs(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_GP),1456 pRegFrame->cs.Sel, pRegFrame->eip);1464 EMRCHistoryAddExitCsEip(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_GP), 1465 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 1457 1466 return trpmGCHyperGeneric(TRPMCPU_2_VM(pTrpmCpu), pRegFrame, g_aTrap0dHandlers, g_aTrap0dHandlersEnd); 1458 1467 } … … 1474 1483 DECLASM(int) TRPMGCHyperTrap0eHandler(PTRPMCPU pTrpmCpu, PCPUMCTXCORE pRegFrame) 1475 1484 { 1476 EMRCHistoryAddExit NoTs(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_PF),1477 pRegFrame->cs.Sel, pRegFrame->eip);1485 EMRCHistoryAddExitCsEip(TRPMCPU_2_VMCPU(pTrpmCpu), EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_XCPT, X86_XCPT_PF), 1486 pRegFrame->cs.Sel, pRegFrame->eip, ASMReadTSC()); 1478 1487 return trpmGCHyperGeneric(TRPMCPU_2_VM(pTrpmCpu), pRegFrame, g_aTrap0dHandlers, g_aTrap0dHandlersEnd); 1479 1488 }
Note:
See TracChangeset
for help on using the changeset viewer.