Changeset 105465 in vbox
- Timestamp:
- Jul 24, 2024 9:05:40 AM (6 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r105440 r105465 4438 4438 : EMEXIT_MAKE_FT(EMEXIT_F_KIND_IEM, u8Vector | 0x100), 4439 4439 pVCpu->cpum.GstCtx.rip + pVCpu->cpum.GstCtx.cs.u64Base, uTimestamp); 4440 IEMTLBTRACE_IRQ(pVCpu, u8Vector, fFlags, pVCpu->cpum.GstCtx.rflags.uBoth); 4440 4441 } 4441 4442 else … … 4449 4450 if (fFlags & IEM_XCPT_FLAGS_CR2) 4450 4451 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FT(EMEXIT_F_KIND_XCPT, u8Vector | EMEXIT_F_XCPT_CR2), uCr2, uTimestamp); 4452 IEMTLBTRACE_XCPT(pVCpu, u8Vector, fFlags & IEM_XCPT_FLAGS_ERR ? uErr : 0, fFlags & IEM_XCPT_FLAGS_CR2 ? uCr2 : 0, fFlags); 4451 4453 } 4452 4454 -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp
r105440 r105465 2912 2912 * Commit the operation. 2913 2913 */ 2914 IEMTLBTRACE_IRET(pVCpu, uNewCs, uNewEip, uNewFlags); 2914 2915 #ifdef DBGFTRACE_ENABLED 2915 2916 RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "iret/rm %04x:%04x -> %04x:%04x %x %04llx", … … 3329 3330 fEFlagsNew &= ~fEFlagsMask; 3330 3331 fEFlagsNew |= uNewFlags & fEFlagsMask; 3332 IEMTLBTRACE_IRET(pVCpu, uNewCs, uNewEip, fEFlagsNew); 3331 3333 #ifdef DBGFTRACE_ENABLED 3332 3334 RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "iret/%up%u %04x:%08x -> %04x:%04x %x %04x:%04x", … … 3403 3405 NewEfl.u &= ~fEFlagsMask; 3404 3406 NewEfl.u |= fEFlagsMask & uNewFlags; 3407 IEMTLBTRACE_IRET(pVCpu, uNewCs, uNewEip, NewEfl.u); 3405 3408 #ifdef DBGFTRACE_ENABLED 3406 3409 RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "iret/%up %04x:%08x -> %04x:%04x %x %04x:%04llx", … … 3692 3695 fEFlagsNew &= ~fEFlagsMask; 3693 3696 fEFlagsNew |= uNewFlags & fEFlagsMask; 3697 IEMTLBTRACE_IRET(pVCpu, uNewCs, uNewRip, fEFlagsNew); 3694 3698 #ifdef DBGFTRACE_ENABLED 3695 3699 RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "iret/64/%ul%u %08llx -> %04x:%04llx %llx %04x:%04llx", -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r105440 r105465 189 189 190 190 /** @cfgm{/IEM/NativeRecompileAtUsedCount, uint32_t, 16} 191 * The translation block use count value to do native recompilation at. */ 191 * The translation block use count value to do native recompilation at. 192 * Set to zero to disable native recompilation. */ 192 193 uint32_t uTbNativeRecompileAtUsedCount = 16; 193 194 rc = CFGMR3QueryU32Def(pIem, "NativeRecompileAtUsedCount", &uTbNativeRecompileAtUsedCount, 16); … … 1455 1456 { "--limit", 'l', RTGETOPT_REQ_UINT32 }, 1456 1457 { "--stop-at-global-flush", 'g', RTGETOPT_REQ_NOTHING }, 1458 { "--resolve-rip", 'r', RTGETOPT_REQ_NOTHING }, 1457 1459 }; 1458 1460 … … 1463 1465 uint32_t cLimit = UINT32_MAX; 1464 1466 bool fStopAtGlobalFlush = false; 1467 bool fResolveRip = false; 1465 1468 PVMCPU const pVCpuCall = VMMGetCpu(pVM); 1466 1469 PVMCPU pVCpu = pVCpuCall; … … 1488 1491 break; 1489 1492 1493 case 'r': 1494 fResolveRip = true; 1495 break; 1496 1490 1497 case 'h': 1491 1498 pHlp->pfnPrintf(pHlp, 1492 "Usage: info tlbtrace [options] \n"1499 "Usage: info tlbtrace [options] [n]\n" 1493 1500 "\n" 1494 1501 "Options:\n" 1495 1502 " -c<n>, --cpu=<n>, --vcpu=<n>\n" 1496 1503 " Selects the CPU which TLB trace we're looking at. Default: Caller / 0\n" 1497 " -l<n>, --last=<n>\n"1504 " [n], -l<n>, --last=<n>\n" 1498 1505 " Limit display to the last N entries. Default: all\n" 1499 " -g, --stop-at-global-flush\n"1506 " -g, --stop-at-global-flush\n" 1500 1507 " Stop after the first global flush entry.\n" 1508 " -r, --resolve-rip\n" 1509 " Resolve symbols for the flattened RIP addresses.\n" 1501 1510 ); 1511 return; 1512 1513 case VINF_GETOPT_NOT_OPTION: 1514 rc = RTStrToUInt32Full(ValueUnion.psz, 0, &cLimit); 1515 if (RT_SUCCESS(rc)) 1516 break; 1517 pHlp->pfnPrintf(pHlp, "error: failed to convert '%s' to a number: %Rrc\n", ValueUnion.psz, rc); 1502 1518 return; 1503 1519 … … 1526 1542 while (cLeft-- > 0) 1527 1543 { 1528 PCIEMTLBTRACEENTRY const pCur = &paEntries[--idx & fMask]; 1544 PCIEMTLBTRACEENTRY const pCur = &paEntries[--idx & fMask]; 1545 const char *pszSymbol = ""; 1546 union 1547 { 1548 RTDBGSYMBOL Symbol; 1549 char ach[sizeof(RTDBGSYMBOL) + 32]; 1550 } uBuf; 1551 if (fResolveRip) 1552 { 1553 RTGCINTPTR offDisp = 0; 1554 DBGFADDRESS Addr; 1555 rc = DBGFR3AsSymbolByAddr(pVM->pUVM, DBGF_AS_GLOBAL, DBGFR3AddrFromFlat(pVM->pUVM, &Addr, pCur->rip), 1556 RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL 1557 | RTDBGSYMADDR_FLAGS_SKIP_ABS 1558 | RTDBGSYMADDR_FLAGS_SKIP_ABS_IN_DEFERRED, 1559 &offDisp, &uBuf.Symbol, NULL); 1560 if (RT_SUCCESS(rc)) 1561 { 1562 if (offDisp) 1563 { 1564 size_t const cchName = strlen(uBuf.Symbol.szName); 1565 char * const pszEndName = &uBuf.Symbol.szName[cchName]; 1566 size_t const cbLeft = sizeof(uBuf) - sizeof(uBuf.Symbol) + sizeof(uBuf.Symbol.szName) - cchName; 1567 if (offDisp > 0) 1568 RTStrPrintf(pszEndName, cbLeft, "+%#1RGv", offDisp); 1569 else 1570 RTStrPrintf(pszEndName, cbLeft, "-%#1RGv", -offDisp); 1571 char *pszName = uBuf.Symbol.szName; 1572 *--pszName = ' '; /* padding */ 1573 pszSymbol = pszName; 1574 } 1575 } 1576 } 1529 1577 switch (pCur->enmType) 1530 1578 { 1531 1579 case kIemTlbTraceType_InvlPg: 1532 pHlp->pfnPrintf(pHlp, "%u: %016RX64 invlpg %RGv slot=" IEMTLB_SLOT_FMT " \n",1533 idx, pCur->rip, pCur->u64Param, (uint32_t)IEMTLB_ADDR_TO_EVEN_INDEX(pCur->u64Param));1580 pHlp->pfnPrintf(pHlp, "%u: %016RX64 invlpg %RGv slot=" IEMTLB_SLOT_FMT "%s\n", idx, pCur->rip, 1581 pCur->u64Param, (uint32_t)IEMTLB_ADDR_TO_EVEN_INDEX(pCur->u64Param), pszSymbol); 1534 1582 break; 1535 1583 case kIemTlbTraceType_Flush: 1536 pHlp->pfnPrintf(pHlp, "%u: %016RX64 flush %s rev=%#RX64 \n", idx, pCur->rip,1537 pCur->bParam ? "data" : "code", pCur->u64Param );1584 pHlp->pfnPrintf(pHlp, "%u: %016RX64 flush %s rev=%#RX64%s\n", idx, pCur->rip, 1585 pCur->bParam ? "data" : "code", pCur->u64Param, pszSymbol); 1538 1586 break; 1539 1587 case kIemTlbTraceType_FlushGlobal: 1540 pHlp->pfnPrintf(pHlp, "%u: %016RX64 flush %s rev=%#RX64 grev=%#RX64 \n", idx, pCur->rip,1541 pCur->bParam ? "data" : "code", pCur->u64Param, pCur->u64Param2 );1588 pHlp->pfnPrintf(pHlp, "%u: %016RX64 flush %s rev=%#RX64 grev=%#RX64%s\n", idx, pCur->rip, 1589 pCur->bParam ? "data" : "code", pCur->u64Param, pCur->u64Param2, pszSymbol); 1542 1590 if (fStopAtGlobalFlush) 1543 1591 return; 1544 1592 break; 1545 1593 case kIemTlbTraceType_Load: 1546 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load %s %RGv slot=" IEMTLB_SLOT_FMT " \n",1594 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load %s %RGv slot=" IEMTLB_SLOT_FMT "%s\n", 1547 1595 idx, pCur->rip, pCur->bParam ? "data" : "code", 1548 pCur->u64Param, (uint32_t)IEMTLB_ADDR_TO_EVEN_INDEX(pCur->u64Param) );1596 pCur->u64Param, (uint32_t)IEMTLB_ADDR_TO_EVEN_INDEX(pCur->u64Param), pszSymbol); 1549 1597 break; 1550 1598 case kIemTlbTraceType_LoadGlobal: 1551 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load %s %RGv slot=" IEMTLB_SLOT_FMT " (global) \n",1599 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load %s %RGv slot=" IEMTLB_SLOT_FMT " (global)%s\n", 1552 1600 idx, pCur->rip, pCur->bParam ? "data" : "code", 1553 pCur->u64Param, (uint32_t)IEMTLB_ADDR_TO_EVEN_INDEX(pCur->u64Param) );1601 pCur->u64Param, (uint32_t)IEMTLB_ADDR_TO_EVEN_INDEX(pCur->u64Param), pszSymbol); 1554 1602 break; 1555 1603 case kIemTlbTraceType_Load_Cr0: 1556 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load cr0 %08RX64 (was %08RX64) \n",1557 idx, pCur->rip, pCur->u64Param, pCur->u64Param2 );1604 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load cr0 %08RX64 (was %08RX64)%s\n", 1605 idx, pCur->rip, pCur->u64Param, pCur->u64Param2, pszSymbol); 1558 1606 break; 1559 1607 case kIemTlbTraceType_Load_Cr3: 1560 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load cr3 %016RX64 (was %016RX64) \n",1561 idx, pCur->rip, pCur->u64Param, pCur->u64Param2 );1608 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load cr3 %016RX64 (was %016RX64)%s\n", 1609 idx, pCur->rip, pCur->u64Param, pCur->u64Param2, pszSymbol); 1562 1610 break; 1563 1611 case kIemTlbTraceType_Load_Cr4: 1564 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load cr4 %08RX64 (was %08RX64) \n",1565 idx, pCur->rip, pCur->u64Param, pCur->u64Param2 );1612 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load cr4 %08RX64 (was %08RX64)%s\n", 1613 idx, pCur->rip, pCur->u64Param, pCur->u64Param2, pszSymbol); 1566 1614 break; 1567 1615 case kIemTlbTraceType_Load_Efer: 1568 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load efer %016RX64 (was %016RX64)\n", 1569 idx, pCur->rip, pCur->u64Param, pCur->u64Param2); 1616 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load efer %016RX64 (was %016RX64)%s\n", 1617 idx, pCur->rip, pCur->u64Param, pCur->u64Param2, pszSymbol); 1618 break; 1619 case kIemTlbTraceType_Irq: 1620 pHlp->pfnPrintf(pHlp, "%u: %016RX64 irq %#04x flags=%#x eflboth=%#RX64%s\n", 1621 idx, pCur->rip, pCur->bParam, pCur->u32Param, 1622 pCur->u64Param & ((RT_BIT_64(CPUMX86EFLAGS_HW_BITS) - 1) | CPUMX86EFLAGS_INT_MASK_64), 1623 pszSymbol); 1624 break; 1625 case kIemTlbTraceType_Xcpt: 1626 if (pCur->u32Param & IEM_XCPT_FLAGS_CR2) 1627 pHlp->pfnPrintf(pHlp, "%u: %016RX64 xcpt %#04x flags=%#x errcd=%#x cr2=%RX64%s\n", 1628 idx, pCur->rip, pCur->bParam, pCur->u32Param, pCur->u64Param, pCur->u64Param2, pszSymbol); 1629 else if (pCur->u32Param & IEM_XCPT_FLAGS_ERR) 1630 pHlp->pfnPrintf(pHlp, "%u: %016RX64 xcpt %#04x flags=%#x errcd=%#x%s\n", 1631 idx, pCur->rip, pCur->bParam, pCur->u32Param, pCur->u64Param, pszSymbol); 1632 else 1633 pHlp->pfnPrintf(pHlp, "%u: %016RX64 xcpt %#04x flags=%#x%s\n", 1634 idx, pCur->rip, pCur->bParam, pCur->u32Param, pszSymbol); 1635 break; 1636 case kIemTlbTraceType_IRet: 1637 pHlp->pfnPrintf(pHlp, "%u: %016RX64 iret cs:rip=%04x:%016RX64 efl=%08RX32%s\n", 1638 idx, pCur->rip, pCur->u32Param, pCur->u64Param, (uint32_t)pCur->u64Param2, pszSymbol); 1570 1639 break; 1571 1640 case kIemTlbTraceType_Invalid: -
trunk/src/VBox/VMM/include/IEMInline.h
r105440 r105465 4805 4805 */ 4806 4806 DECLINLINE(void) iemTlbTrace(PVMCPU pVCpu, IEMTLBTRACETYPE enmType, uint64_t u64Param, uint64_t u64Param2 = 0, 4807 uint8_t bParam = 0 /*, uint32_t u32Param = 0, uint16_t u16Param = 0 */)4807 uint8_t bParam = 0, uint32_t u32Param = 0/*, uint16_t u16Param = 0 */) 4808 4808 { 4809 4809 uint32_t const fMask = RT_BIT_32(pVCpu->iem.s.cTlbTraceEntriesShift) - 1; … … 4812 4812 pEntry->u64Param2 = u64Param2; 4813 4813 pEntry->u16Param = 0; //u16Param; 4814 pEntry->u32Param = 0; //u32Param;4814 pEntry->u32Param = u32Param; 4815 4815 pEntry->bParam = bParam; 4816 4816 pEntry->enmType = enmType; -
trunk/src/VBox/VMM/include/IEMInternal.h
r105447 r105465 739 739 kIemTlbTraceType_Load_Cr3, 740 740 kIemTlbTraceType_Load_Cr4, 741 kIemTlbTraceType_Load_Efer 741 kIemTlbTraceType_Load_Efer, 742 kIemTlbTraceType_Irq, 743 kIemTlbTraceType_Xcpt, 744 kIemTlbTraceType_IRet 742 745 } IEMTLBTRACETYPE; 743 746 … … 779 782 # define IEMTLBTRACE_LOAD_CR4(a_pVCpu, a_uNew, a_uOld) iemTlbTrace(a_pVCpu, kIemTlbTraceType_Load_Cr4, a_uNew, a_uOld) 780 783 # define IEMTLBTRACE_LOAD_EFER(a_pVCpu, a_uNew, a_uOld) iemTlbTrace(a_pVCpu, kIemTlbTraceType_Load_Efer, a_uNew, a_uOld) 784 # define IEMTLBTRACE_IRQ(a_pVCpu, a_uVector, a_fFlags, a_fEFlags) \ 785 iemTlbTrace(a_pVCpu, kIemTlbTraceType_Irq, a_fEFlags, 0, a_uVector, a_fFlags) 786 # define IEMTLBTRACE_XCPT(a_pVCpu, a_uVector, a_uErr, a_uCr2, a_fFlags) \ 787 iemTlbTrace(a_pVCpu, kIemTlbTraceType_Xcpt, a_uErr, a_uCr2, a_uVector, a_fFlags) 788 # define IEMTLBTRACE_IRET(a_pVCpu, a_uRetCs, a_uRetRip, a_fEFlags) \ 789 iemTlbTrace(a_pVCpu, kIemTlbTraceType_IRet, a_uRetRip, a_fEFlags, 0, a_uRetCs) 781 790 #else 782 791 # define IEMTLBTRACE_INVLPG(a_pVCpu, a_GCPtr) do { } while (0) … … 789 798 # define IEMTLBTRACE_LOAD_CR4(a_pVCpu, a_uNew, a_uOld) do { } while (0) 790 799 # define IEMTLBTRACE_LOAD_EFER(a_pVCpu, a_uNew, a_uOld) do { } while (0) 800 # define IEMTLBTRACE_IRQ(a_pVCpu, a_uVector, a_fFlags) do { } while (0) 801 # define IEMTLBTRACE_XCPT(a_pVCpu, a_uVector, a_uErr, a_uCr2, a_fFlags) do { } while (0) 802 # define IEMTLBTRACE_IRET(a_pVCpu, a_uRetCs, a_uRetRip, a_fEFlags) do { } while (0) 791 803 #endif 792 804
Note:
See TracChangeset
for help on using the changeset viewer.