Changeset 105560 in vbox
- Timestamp:
- Aug 1, 2024 10:14:06 AM (4 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
r105490 r105560 1050 1050 1051 1051 1052 #if 0 1053 /** 1054 * Frees all TBs. 1055 */ 1056 static int iemTbAllocatorFreeAll(PVMCPUCC pVCpu) 1057 { 1058 PIEMTBALLOCATOR const pTbAllocator = pVCpu->iem.s.pTbAllocatorR3; 1059 AssertReturn(pTbAllocator, VERR_WRONG_ORDER); 1060 AssertReturn(pTbAllocator->uMagic == IEMTBALLOCATOR_MAGIC, VERR_INVALID_MAGIC); 1061 1062 iemTbAllocatorProcessDelayedFrees(pVCpu, pTbAllocator); 1063 1064 uint32_t idxChunk = pTbAllocator->cAllocatedChunks; 1065 while (idxChunk-- > 0) 1066 { 1067 PIEMTB const paTbs = pTbAllocator->aChunks[idxChunk].paTbs; 1068 uint32_t idxTb = pTbAllocator->cTbsPerChunk; 1069 while (idxTb-- > 0) 1070 { 1071 PIEMTB const pTb = &paTbs[idxTb]; 1072 if (pTb->fFlags) 1073 iemTbAllocatorFreeInner(pVCpu, pTbAllocator, pTb, idxChunk, idxTb); 1074 } 1075 } 1076 1077 pVCpu->iem.s.ppTbLookupEntryR3 = &pVCpu->iem.s.pTbLookupEntryDummyR3; 1078 1079 # if 1 1080 /* Reset the free list. */ 1081 pTbAllocator->pTbsFreeHead = NULL; 1082 idxChunk = pTbAllocator->cAllocatedChunks; 1083 while (idxChunk-- > 0) 1084 { 1085 uint32_t const cTbsPerChunk = pTbAllocator->cTbsPerChunk; 1086 PIEMTB const paTbs = pTbAllocator->aChunks[idxChunk].paTbs; 1087 RT_BZERO(paTbs, sizeof(paTbs[0]) * cTbsPerChunk); 1088 for (uint32_t idxTb = 0; idxTb < cTbsPerChunk; idxTb++) 1089 { 1090 paTbs[idxTb].idxAllocChunk = idxChunk; /* This is not strictly necessary... */ 1091 paTbs[idxTb].pNext = pTbAllocator->pTbsFreeHead; 1092 pTbAllocator->pTbsFreeHead = &paTbs[idxTb]; 1093 } 1094 } 1095 # endif 1096 1097 # if 1 1098 /* Completely reset the TB cache. */ 1099 RT_BZERO(pVCpu->iem.s.pTbCacheR3->apHash, sizeof(pVCpu->iem.s.pTbCacheR3->apHash[0]) * pVCpu->iem.s.pTbCacheR3->cHash); 1100 # endif 1101 1102 return VINF_SUCCESS; 1103 } 1104 #endif 1105 1106 1052 1107 /** 1053 1108 * Grow the translation block allocator with another chunk. … … 2633 2688 static VBOXSTRICTRC iemThreadedCompile(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysPc, uint32_t fExtraFlags) IEM_NOEXCEPT_MAY_LONGJMP 2634 2689 { 2690 IEMTLBTRACE_TB_COMPILE(pVCpu, GCPhysPc); 2635 2691 Assert(!(fExtraFlags & IEMTB_F_TYPE_MASK)); 2636 2692 fExtraFlags |= IEMTB_F_TYPE_THREADED; … … 2823 2879 { 2824 2880 pVCpu->iem.s.cTbExecNative++; 2881 IEMTLBTRACE_TB_EXEC_N8VE(pVCpu, pTb); 2825 2882 # ifdef LOG_ENABLED 2826 2883 iemThreadedLogCurInstr(pVCpu, "EXn", 0); … … 2902 2959 */ 2903 2960 pVCpu->iem.s.cTbExecThreaded++; 2961 IEMTLBTRACE_TB_EXEC_THRD(pVCpu, pTb); 2904 2962 #ifdef LOG_ENABLED 2905 2963 uint64_t uRipPrev = UINT64_MAX; -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r105465 r105560 36 36 #include <VBox/vmm/dbgf.h> 37 37 #include <VBox/vmm/mm.h> 38 #include <VBox/vmm/ssm.h> 38 39 #if defined(VBOX_VMM_TARGET_ARMV8) 39 40 # include "IEMInternal-armv8.h" … … 1560 1561 if (RT_SUCCESS(rc)) 1561 1562 { 1563 /* Add displacement. */ 1562 1564 if (offDisp) 1563 1565 { … … 1569 1571 else 1570 1572 RTStrPrintf(pszEndName, cbLeft, "-%#1RGv", -offDisp); 1571 char *pszName = uBuf.Symbol.szName;1572 *--pszName = ' '; /* padding */1573 pszSymbol = pszName;1574 1573 } 1574 1575 /* Put a space before it. */ 1576 AssertCompile(RTASSERT_OFFSET_OF(RTDBGSYMBOL, szName) > 0); 1577 char *pszName = uBuf.Symbol.szName; 1578 *--pszName = ' '; 1579 pszSymbol = pszName; 1575 1580 } 1576 1581 } … … 1601 1606 pCur->u64Param, (uint32_t)IEMTLB_ADDR_TO_EVEN_INDEX(pCur->u64Param), pszSymbol); 1602 1607 break; 1608 1603 1609 case kIemTlbTraceType_Load_Cr0: 1604 1610 pHlp->pfnPrintf(pHlp, "%u: %016RX64 load cr0 %08RX64 (was %08RX64)%s\n", … … 1617 1623 idx, pCur->rip, pCur->u64Param, pCur->u64Param2, pszSymbol); 1618 1624 break; 1625 1619 1626 case kIemTlbTraceType_Irq: 1620 1627 pHlp->pfnPrintf(pHlp, "%u: %016RX64 irq %#04x flags=%#x eflboth=%#RX64%s\n", … … 1638 1645 idx, pCur->rip, pCur->u32Param, pCur->u64Param, (uint32_t)pCur->u64Param2, pszSymbol); 1639 1646 break; 1647 1648 case kIemTlbTraceType_Tb_Compile: 1649 pHlp->pfnPrintf(pHlp, "%u: %016RX64 tb comp GCPhysPc=%012RX64%s\n", 1650 idx, pCur->rip, pCur->u64Param, pszSymbol); 1651 break; 1652 case kIemTlbTraceType_Tb_Exec_Threaded: 1653 pHlp->pfnPrintf(pHlp, "%u: %016RX64 tb thrd GCPhysPc=%012RX64 tb=%p used=%u%s\n", 1654 idx, pCur->rip, pCur->u64Param, (uintptr_t)pCur->u64Param2, pCur->u32Param, pszSymbol); 1655 break; 1656 case kIemTlbTraceType_Tb_Exec_Native: 1657 pHlp->pfnPrintf(pHlp, "%u: %016RX64 tb n8ve GCPhysPc=%012RX64 tb=%p used=%u%s\n", 1658 idx, pCur->rip, pCur->u64Param, (uintptr_t)pCur->u64Param2, pCur->u32Param, pszSymbol); 1659 break; 1660 1640 1661 case kIemTlbTraceType_Invalid: 1641 1662 pHlp->pfnPrintf(pHlp, "%u: Invalid!\n"); -
trunk/src/VBox/VMM/include/IEMInternal.h
r105490 r105560 748 748 kIemTlbTraceType_Irq, 749 749 kIemTlbTraceType_Xcpt, 750 kIemTlbTraceType_IRet 750 kIemTlbTraceType_IRet, 751 kIemTlbTraceType_Tb_Compile, 752 kIemTlbTraceType_Tb_Exec_Threaded, 753 kIemTlbTraceType_Tb_Exec_Native 751 754 } IEMTLBTRACETYPE; 752 755 … … 784 787 # define IEMTLBTRACE_LOAD_GLOBAL(a_pVCpu, a_GCPtr, a_fDataTlb) \ 785 788 iemTlbTrace(a_pVCpu, kIemTlbTraceType_LoadGlobal, a_GCPtr, 0, a_fDataTlb) 789 #else 790 # define IEMTLBTRACE_INVLPG(a_pVCpu, a_GCPtr) do { } while (0) 791 # define IEMTLBTRACE_FLUSH(a_pVCpu, a_uRev, a_fDataTlb) do { } while (0) 792 # define IEMTLBTRACE_FLUSH_GLOBAL(a_pVCpu, a_uRev, a_uGRev, a_fDataTlb) do { } while (0) 793 # define IEMTLBTRACE_LOAD(a_pVCpu, a_GCPtr, a_fDataTlb) do { } while (0) 794 # define IEMTLBTRACE_LOAD_GLOBAL(a_pVCpu, a_GCPtr, a_fDataTlb) do { } while (0) 795 #endif 796 797 #if defined(IEM_WITH_TLB_TRACE) && defined(IN_RING3) && 1 786 798 # define IEMTLBTRACE_LOAD_CR0(a_pVCpu, a_uNew, a_uOld) iemTlbTrace(a_pVCpu, kIemTlbTraceType_Load_Cr0, a_uNew, a_uOld) 787 799 # define IEMTLBTRACE_LOAD_CR3(a_pVCpu, a_uNew, a_uOld) iemTlbTrace(a_pVCpu, kIemTlbTraceType_Load_Cr3, a_uNew, a_uOld) 788 800 # define IEMTLBTRACE_LOAD_CR4(a_pVCpu, a_uNew, a_uOld) iemTlbTrace(a_pVCpu, kIemTlbTraceType_Load_Cr4, a_uNew, a_uOld) 789 801 # define IEMTLBTRACE_LOAD_EFER(a_pVCpu, a_uNew, a_uOld) iemTlbTrace(a_pVCpu, kIemTlbTraceType_Load_Efer, a_uNew, a_uOld) 802 #else 803 # define IEMTLBTRACE_LOAD_CR0(a_pVCpu, a_uNew, a_uOld) do { } while (0) 804 # define IEMTLBTRACE_LOAD_CR3(a_pVCpu, a_uNew, a_uOld) do { } while (0) 805 # define IEMTLBTRACE_LOAD_CR4(a_pVCpu, a_uNew, a_uOld) do { } while (0) 806 # define IEMTLBTRACE_LOAD_EFER(a_pVCpu, a_uNew, a_uOld) do { } while (0) 807 #endif 808 809 #if defined(IEM_WITH_TLB_TRACE) && defined(IN_RING3) && 1 790 810 # define IEMTLBTRACE_IRQ(a_pVCpu, a_uVector, a_fFlags, a_fEFlags) \ 791 811 iemTlbTrace(a_pVCpu, kIemTlbTraceType_Irq, a_fEFlags, 0, a_uVector, a_fFlags) … … 795 815 iemTlbTrace(a_pVCpu, kIemTlbTraceType_IRet, a_uRetRip, a_fEFlags, 0, a_uRetCs) 796 816 #else 797 # define IEMTLBTRACE_INVLPG(a_pVCpu, a_GCPtr) do { } while (0)798 # define IEMTLBTRACE_FLUSH(a_pVCpu, a_uRev, a_fDataTlb) do { } while (0)799 # define IEMTLBTRACE_FLUSH_GLOBAL(a_pVCpu, a_uRev, a_uGRev, a_fDataTlb) do { } while (0)800 # define IEMTLBTRACE_LOAD(a_pVCpu, a_GCPtr, a_fDataTlb) do { } while (0)801 # define IEMTLBTRACE_LOAD_GLOBAL(a_pVCpu, a_GCPtr, a_fDataTlb) do { } while (0)802 # define IEMTLBTRACE_LOAD_CR0(a_pVCpu, a_uNew, a_uOld) do { } while (0)803 # define IEMTLBTRACE_LOAD_CR3(a_pVCpu, a_uNew, a_uOld) do { } while (0)804 # define IEMTLBTRACE_LOAD_CR4(a_pVCpu, a_uNew, a_uOld) do { } while (0)805 # define IEMTLBTRACE_LOAD_EFER(a_pVCpu, a_uNew, a_uOld) do { } while (0)806 817 # define IEMTLBTRACE_IRQ(a_pVCpu, a_uVector, a_fFlags, a_fEFlags) do { } while (0) 807 818 # define IEMTLBTRACE_XCPT(a_pVCpu, a_uVector, a_uErr, a_uCr2, a_fFlags) do { } while (0) 808 819 # define IEMTLBTRACE_IRET(a_pVCpu, a_uRetCs, a_uRetRip, a_fEFlags) do { } while (0) 820 #endif 821 822 #if defined(IEM_WITH_TLB_TRACE) && defined(IN_RING3) && 1 823 # define IEMTLBTRACE_TB_COMPILE(a_pVCpu, a_GCPhysPc) \ 824 iemTlbTrace(a_pVCpu, kIemTlbTraceType_Tb_Compile, a_GCPhysPc) 825 # define IEMTLBTRACE_TB_EXEC_THRD(a_pVCpu, a_pTb) \ 826 iemTlbTrace(a_pVCpu, kIemTlbTraceType_Tb_Exec_Threaded, (a_pTb)->GCPhysPc, (uintptr_t)a_pTb, 0, (a_pTb)->cUsed) 827 # define IEMTLBTRACE_TB_EXEC_N8VE(a_pVCpu, a_pTb) \ 828 iemTlbTrace(a_pVCpu, kIemTlbTraceType_Tb_Exec_Native, (a_pTb)->GCPhysPc, (uintptr_t)a_pTb, 0, (a_pTb)->cUsed) 829 #else 830 # define IEMTLBTRACE_TB_COMPILE(a_pVCpu, a_GCPhysPc) do { } while (0) 831 # define IEMTLBTRACE_TB_EXEC_THRD(a_pVCpu, a_pTb) do { } while (0) 832 # define IEMTLBTRACE_TB_EXEC_N8VE(a_pVCpu, a_pTb) do { } while (0) 809 833 #endif 810 834
Note:
See TracChangeset
for help on using the changeset viewer.