Changeset 106743 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 28, 2024 11:43:04 AM (4 months ago)
- svn:sync-xref-src-repo-rev:
- 165627
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/Makefile.kmk
r106740 r106743 388 388 VBoxVMMArm_SONAME.linux = VBoxVMMArm.so 389 389 390 VBoxVMMArm_DEFS = VBOX_VMM_TARGET_ARMV8 VBOX_ IN_VMM IN_VMM_R3 IN_DIS IN_DBG IN_GMM_R3 \390 VBoxVMMArm_DEFS = VBOX_VMM_TARGET_ARMV8 VBOX_DIS_WITH_ARMV8 VBOX_IN_VMM IN_VMM_R3 IN_DIS IN_DBG IN_GMM_R3 \ 391 391 $(filter-out VBOX_WITH_IEM_RECOMPILER VBOX_WITH_IEM_NATIVE_RECOMPILER,$(VMM_COMMON_DEFS)) 392 392 ifdef VBOX_WITH_VUSB -
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r106061 r106743 651 651 pDisState->Param3 = State.Dis.aParams[2]; 652 652 pDisState->Param4 = State.Dis.aParams[3]; 653 #if defined(VBOX_VMM_TARGET_ARMV8) 654 memcpy(&pDisState->armv8, &State.Dis.armv8, sizeof(State.Dis.armv8)); 655 #else 656 memcpy(&pDisState->x86, &State.Dis.x86, sizeof(State.Dis.x86)); 657 #endif 653 658 } 654 659 -
trunk/src/VBox/VMM/VMMR3/DBGFR3Flow.cpp
r106061 r106743 213 213 214 214 /** 215 * Returns whether the given opcode and disassembler state denote an unconditional jump instruction. 216 * 217 * @returns Flag whether the given instruction is an unconditional jump. 218 * @param uOpc The opcode value from the disassembler. 219 * @param pDis The disassembler state. 220 */ 221 DECL_FORCE_INLINE(bool) dbgfR3FlowDisOpcIsUncondJmp(uint16_t uOpc, PDBGFDISSTATE pDis) 222 { 223 #ifdef VBOX_VMM_TARGET_ARMV8 224 if ( uOpc == OP_ARMV8_A64_BR 225 || uOpc == OP_ARMV8_A64_BRAAZ 226 || uOpc == OP_ARMV8_A64_BRABZ 227 || uOpc == OP_ARMV8_A64_BRAA 228 || uOpc == OP_ARMV8_A64_BRAB) 229 return true; 230 231 /* B and BC are special because only the al condition is unconditional. */ 232 if ( uOpc == OP_ARMV8_A64_B 233 || uOpc == OP_ARMV8_A64_BC) 234 { 235 return pDis->armv8.enmCond == kDisArmv8InstrCond_Al 236 || pDis->armv8.enmCond == kDisArmv8InstrCond_Al1; 237 } 238 239 return false; 240 #else 241 RT_NOREF(pDis); 242 243 return uOpc == OP_JMP; 244 #endif 245 } 246 247 248 /** 249 * Returns whether the given opcode denotes a call/branch and link instruction. 250 * 251 * @returns Flag whether the given instruction is a call. 252 * @param uOpc The opcode value from the disassembler. 253 */ 254 DECL_FORCE_INLINE(bool) dbgfR3FlowDisOpcIsCall(uint16_t uOpc) 255 { 256 #ifdef VBOX_VMM_TARGET_ARMV8 257 if ( uOpc == OP_ARMV8_A64_BL 258 || uOpc == OP_ARMV8_A64_BLR 259 || uOpc == OP_ARMV8_A64_BLRAA 260 || uOpc == OP_ARMV8_A64_BLRAB 261 || uOpc == OP_ARMV8_A64_BLRAAZ 262 || uOpc == OP_ARMV8_A64_BLRABZ) 263 return true; 264 265 return false; 266 #else 267 return uOpc == OP_CALL; 268 #endif 269 } 270 271 272 /** 273 * Returns whether the given opcode denotes a function/exception return. 274 * 275 * @returns Flag whether the given instruction is a return. 276 * @param uOpc The opcode value from the disassembler. 277 */ 278 DECL_FORCE_INLINE(bool) dbgfR3FlowDisOpcIsExit(uint16_t uOpc) 279 { 280 #ifdef VBOX_VMM_TARGET_ARMV8 281 if ( uOpc == OP_ARMV8_A64_RET 282 || uOpc == OP_ARMV8_A64_RETAA 283 || uOpc == OP_ARMV8_A64_RETAB 284 || uOpc == OP_ARMV8_A64_ERET 285 || uOpc == OP_ARMV8_A64_ERETAA 286 || uOpc == OP_ARMV8_A64_ERETAB) 287 return true; 288 289 return false; 290 #else 291 if ( uOpc == OP_RETN 292 || uOpc == OP_RETF 293 || uOpc == OP_IRET 294 || uOpc == OP_SYSEXIT 295 || uOpc == OP_SYSRET) 296 return true; 297 298 return false; 299 #endif 300 } 301 302 303 /** 215 304 * Checks whether both addresses are equal. 216 305 * … … 1229 1318 uint16_t uOpc = DisState.pCurInstr->uOpcode; 1230 1319 1231 if ( uOpc == OP_CALL)1320 if (dbgfR3FlowDisOpcIsCall(uOpc)) 1232 1321 pThis->cCallInsns++; 1233 1322 1234 if ( uOpc == OP_RETN || uOpc == OP_RETF || uOpc == OP_IRET 1235 || uOpc == OP_SYSEXIT || uOpc == OP_SYSRET) 1323 if (dbgfR3FlowDisOpcIsExit(uOpc)) 1236 1324 pFlowBb->enmEndType = DBGFFLOWBBENDTYPE_EXIT; 1237 else if ( uOpc == OP_JMP)1325 else if (dbgfR3FlowDisOpcIsUncondJmp(uOpc, &DisState)) 1238 1326 { 1327 #ifndef VBOX_VMM_TARGET_ARMV8 /* This is not true for B/BC on ARMv8 which can be both... */ 1239 1328 Assert(DisState.pCurInstr->fOpType & DISOPTYPE_UNCOND_CONTROLFLOW); 1329 #endif 1240 1330 1241 1331 if (dbgfR3FlowBranchTargetIsIndirect(&DisState.Param1)) … … 1279 1369 } 1280 1370 } 1281 else if ( uOpc != OP_CALL)1371 else if (!dbgfR3FlowDisOpcIsCall(uOpc)) 1282 1372 { 1283 1373 Assert(DisState.pCurInstr->fOpType & DISOPTYPE_COND_CONTROLFLOW); 1284 1374 pFlowBb->enmEndType = DBGFFLOWBBENDTYPE_COND; 1375 1376 #ifdef VBOX_VMM_TARGET_ARMV8 1377 PDISOPPARAM pParam = uOpc == OP_ARMV8_A64_B || uOpc == OP_ARMV8_A64_BC 1378 ? &DisState.Param1 1379 : uOpc == OP_ARMV8_A64_CBZ || uOpc == OP_ARMV8_A64_CBNZ 1380 ? &DisState.Param2 /* cbz/cbnz. */ 1381 : &DisState.Param3; /* tbz/tbnz. */ 1382 #else 1383 PDISOPPARAM pParam = &DisState.Param1; 1384 #endif 1285 1385 1286 1386 /* … … 1293 1393 if (RT_SUCCESS(rc)) 1294 1394 { 1295 rc = dbgfR3FlowQueryDirectBranchTarget(pUVM, idCpu, &DisState.Param1, &pInstr->AddrInstr, pInstr->cbInstr,1395 rc = dbgfR3FlowQueryDirectBranchTarget(pUVM, idCpu, pParam, &pInstr->AddrInstr, pInstr->cbInstr, 1296 1396 RT_BOOL(DisState.pCurInstr->fOpType & DISOPTYPE_RELATIVE_CONTROLFLOW), 1297 1397 &pFlowBb->AddrTarget); … … 1327 1427 1328 1428 /* Quit disassembling. */ 1329 if ( ( uOpc != OP_CALL1429 if ( ( !dbgfR3FlowDisOpcIsCall(uOpc) 1330 1430 || (pThis->fFlags & DBGF_FLOW_CREATE_F_CALL_INSN_SEPARATE_BB)) 1331 1431 || RT_FAILURE(rc)) -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-darwin-armv8.cpp
r106667 r106743 36 36 #define LOG_GROUP LOG_GROUP_NEM 37 37 #define VMCPU_INCL_CPUM_GST_CTX 38 #define VBOX_DIS_WITH_ARMV839 40 38 #include <VBox/vmm/nem.h> 41 39 #include <VBox/vmm/iem.h> -
trunk/src/VBox/VMM/include/DBGFInternal.h
r106362 r106743 1510 1510 DISOPPARAM Param3; 1511 1511 DISOPPARAM Param4; 1512 /** Architecture specific state. */ 1513 RT_GCC_EXTENSION union 1514 { 1515 /** x86/AMD64 specific state. */ 1516 DIS_STATE_X86_T x86; 1517 #if defined(VBOX_DIS_WITH_ARMV8) 1518 /** ARMv8 specific state. */ 1519 DIS_STATE_ARMV8_T armv8; 1520 #endif 1521 }; 1512 1522 } DBGFDISSTATE; 1513 1523 /** Pointer to a DBGF disassembler state. */
Note:
See TracChangeset
for help on using the changeset viewer.