Changeset 106136 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 24, 2024 9:32:39 AM (5 months ago)
- svn:sync-xref-src-repo-rev:
- 164914
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r106134 r106136 8831 8831 PCIEMTB pTb; 8832 8832 PCIEMNATIVEPERCHUNKCTX pCtx; 8833 # 8833 #ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 8834 8834 PCIEMTBDBG pDbgInfo; 8835 # 8835 #endif 8836 8836 } IEMNATIVDISASMSYMCTX; 8837 8837 typedef IEMNATIVDISASMSYMCTX *PIEMNATIVDISASMSYMCTX; … … 8915 8915 } 8916 8916 } 8917 #endif 8917 #endif /* IEMNATIVE_WITH_TB_DEBUG_INFO */ 8918 8918 } 8919 8919 else … … 9203 9203 } 9204 9204 9205 # ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR9205 # ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR 9206 9206 case kIemTbDbgEntryType_GuestSimdRegShadowing: 9207 9207 { … … 9220 9220 continue; 9221 9221 } 9222 # endif9222 # endif 9223 9223 9224 9224 case kIemTbDbgEntryType_Label: … … 9241 9241 break; 9242 9242 9243 # ifdef IEMNATIVE_WITH_DELAYED_PC_UPDATING9243 # ifdef IEMNATIVE_WITH_DELAYED_PC_UPDATING 9244 9244 case kIemTbDbgEntryType_DelayedPcUpdate: 9245 9245 pHlp->pfnPrintf(pHlp, " Updating guest PC value by %u (cInstrSkipped=%u)\n", … … 9247 9247 pDbgInfo->aEntries[iDbgEntry].DelayedPcUpdate.cInstrSkipped); 9248 9248 continue; 9249 # endif9250 9251 # ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK9249 # endif 9250 9251 # ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK 9252 9252 case kIemTbDbgEntryType_GuestRegDirty: 9253 9253 { … … 9270 9270 << (pDbgInfo->aEntries[iDbgEntry].GuestRegWriteback.cShift * 25)); 9271 9271 continue; 9272 # endif9272 # endif 9273 9273 9274 9274 default: … … 9463 9463 { 9464 9464 PCIEMNATIVEINSTR const pNativeCur = &paNative[offNative]; 9465 # 9465 #ifndef VBOX_WITH_IEM_USING_CAPSTONE_DISASSEMBLER 9466 9466 uint32_t cbInstr = sizeof(paNative[0]); 9467 9467 int const rc = DISInstr(pNativeCur, enmHstCpuMode, &Dis, &cbInstr); 9468 9468 if (RT_SUCCESS(rc)) 9469 9469 { 9470 # 9470 # if defined(RT_ARCH_AMD64) 9471 9471 if (Dis.pCurInstr->uOpcode == OP_NOP && cbInstr == 7) /* iemNativeEmitMarker */ 9472 9472 { … … 9483 9483 } 9484 9484 else 9485 # 9485 # endif 9486 9486 { 9487 # 9487 # ifdef RT_ARCH_AMD64 9488 9488 DISFormatYasmEx(&Dis, szDisBuf, sizeof(szDisBuf), 9489 9489 DIS_FMT_FLAGS_BYTES_WIDTH_MAKE(10) | DIS_FMT_FLAGS_BYTES_LEFT 9490 9490 | DIS_FMT_FLAGS_RELATIVE_BRANCH | DIS_FMT_FLAGS_C_HEX, 9491 9491 iemNativeDisasmGetSymbolCb, &SymCtx); 9492 # 9492 # elif defined(RT_ARCH_ARM64) 9493 9493 DISFormatArmV8Ex(&Dis, szDisBuf, sizeof(szDisBuf), 9494 9494 DIS_FMT_FLAGS_BYTES_LEFT | DIS_FMT_FLAGS_RELATIVE_BRANCH | DIS_FMT_FLAGS_C_HEX, 9495 9495 iemNativeDisasmGetSymbolCb, &SymCtx); 9496 # 9497 # 9498 # 9496 # else 9497 # error "Port me" 9498 # endif 9499 9499 pHlp->pfnPrintf(pHlp, " %p: %s\n", pNativeCur, szDisBuf); 9500 9500 } … … 9502 9502 else 9503 9503 { 9504 # 9504 # if defined(RT_ARCH_AMD64) 9505 9505 pHlp->pfnPrintf(pHlp, " %p: %.*Rhxs - disassembly failure %Rrc\n", 9506 9506 pNativeCur, RT_MIN(cNative - offNative, 16), pNativeCur, rc); 9507 # 9507 # else 9508 9508 pHlp->pfnPrintf(pHlp, " %p: %#010RX32 - disassembly failure %Rrc\n", pNativeCur, *pNativeCur, rc); 9509 # 9509 # endif 9510 9510 cbInstr = sizeof(paNative[0]); 9511 9511 } 9512 9512 offNative += cbInstr / sizeof(paNative[0]); 9513 9513 9514 # 9514 #else /* VBOX_WITH_IEM_USING_CAPSTONE_DISASSEMBLER */ 9515 9515 cs_insn *pInstr; 9516 9516 size_t cInstrs = cs_disasm(hDisasm, (const uint8_t *)pNativeCur, (cNative - offNative) * sizeof(*pNativeCur), … … 9521 9521 const char * const pszAnnotation = iemNativeDisasmAnnotateCapstone(&SymCtx, pInstr, szDisBuf, sizeof(szDisBuf)); 9522 9522 size_t const cchOp = strlen(pInstr->op_str); 9523 # 9523 # if defined(RT_ARCH_AMD64) 9524 9524 if (pszAnnotation) 9525 9525 pHlp->pfnPrintf(pHlp, " %p: %.*Rhxs %-7s %s%*s ; %s\n", … … 9530 9530 pNativeCur, pInstr->size, pNativeCur, pInstr->mnemonic, pInstr->op_str); 9531 9531 9532 # 9532 # else 9533 9533 if (pszAnnotation) 9534 9534 pHlp->pfnPrintf(pHlp, " %p: %#010RX32 %-7s %s%*s ; %s\n", … … 9538 9538 pHlp->pfnPrintf(pHlp, " %p: %#010RX32 %-7s %s\n", 9539 9539 pNativeCur, *pNativeCur, pInstr->mnemonic, pInstr->op_str); 9540 # 9540 # endif 9541 9541 offNative += pInstr->size / sizeof(*pNativeCur); 9542 9542 cs_free(pInstr, cInstrs); … … 9544 9544 else 9545 9545 { 9546 # 9546 # if defined(RT_ARCH_AMD64) 9547 9547 pHlp->pfnPrintf(pHlp, " %p: %.*Rhxs - disassembly failure %d\n", 9548 9548 pNativeCur, RT_MIN(cNative - offNative, 16), pNativeCur, cs_errno(hDisasm))); 9549 # 9549 # else 9550 9550 pHlp->pfnPrintf(pHlp, " %p: %#010RX32 - disassembly failure %d\n", pNativeCur, *pNativeCur, cs_errno(hDisasm)); 9551 # 9551 # endif 9552 9552 offNative++; 9553 9553 } 9554 # 9554 #endif /* VBOX_WITH_IEM_USING_CAPSTONE_DISASSEMBLER */ 9555 9555 } 9556 9556 } … … 9571 9571 PIEMNATIVEINSTR pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, fAlignMask + 1); 9572 9572 while (off & fAlignMask) 9573 # 9573 #if defined(RT_ARCH_AMD64) 9574 9574 pCodeBuf[off++] = 0xcc; 9575 # 9575 #elif defined(RT_ARCH_ARM64) 9576 9576 pCodeBuf[off++] = Armv8A64MkInstrBrk(0xcccc); 9577 # 9578 # 9579 # 9577 #else 9578 # error "port me" 9579 #endif 9580 9580 } 9581 9581 return off; … … 9609 9609 AssertReturn(pReNative, VERR_NO_MEMORY); 9610 9610 9611 # 9611 #if defined(RT_ARCH_AMD64) 9612 9612 uint32_t const fAlignMask = 15; 9613 # 9613 #elif defined(RT_ARCH_ARM64) 9614 9614 uint32_t const fAlignMask = 31 / 4; 9615 # 9616 # 9617 # 9615 #else 9616 # error "port me" 9617 #endif 9618 9618 uint32_t aoffLabels[kIemNativeLabelType_LastTbExit + 1] = {0}; 9619 9619 int rc = VINF_SUCCESS; … … 9722 9722 else 9723 9723 { 9724 # 9724 #ifdef VBOX_STRICT 9725 9725 off = iemNativeEmitBrk(pReNative, off, 0x2201); 9726 # 9726 #endif 9727 9727 off = iemNativeEmitJmpToFixed(pReNative, off, offReturnWithStatus); 9728 9728 } … … 9730 9730 9731 9731 9732 # 9732 #ifdef VBOX_STRICT 9733 9733 /* Make sure we've generate code for all labels. */ 9734 9734 for (uint32_t i = kIemNativeLabelType_Invalid + 1; i < RT_ELEMENTS(aoffLabels); i++) 9735 9735 Assert(aoffLabels[i] != 0 || i == kIemNativeLabelType_ReturnSuccess); 9736 # 9736 #endif 9737 9737 } 9738 9738 IEMNATIVE_CATCH_LONGJMP_BEGIN(pReNative, rc);
Note:
See TracChangeset
for help on using the changeset viewer.