Changeset 105745 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 21, 2024 7:16:50 AM (5 months ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r105724 r105745 68 68 /** The address space for resolving symbol. */ 69 69 RTDBGAS hDbgAs; 70 #if !defined(VBOX_VMM_TARGET_ARMV8) 70 71 /** Pointer to the first byte in the segment. */ 71 72 RTGCUINTPTR GCPtrSegBase; … … 74 75 /** The size of the segment minus 1. */ 75 76 RTGCUINTPTR cbSegLimit; 77 #endif 76 78 /** The guest paging mode. */ 77 79 PGMMODE enmMode; … … 94 96 * Internal Functions * 95 97 *********************************************************************************************************************************/ 96 #if !defined(VBOX_VMM_TARGET_ARMV8)97 98 static FNDISREADBYTES dbgfR3DisasInstrRead; 98 99 … … 114 115 RTGCPTR GCPtr, uint32_t fFlags, PDBGFDISASSTATE pState) 115 116 { 117 #if !defined(VBOX_VMM_TARGET_ARMV8) 116 118 pState->GCPtrSegBase = pSelInfo->GCPtrBase; 117 119 pState->GCPtrSegEnd = pSelInfo->cbLimit + 1 + (RTGCUINTPTR)pSelInfo->GCPtrBase; 118 120 pState->cbSegLimit = pSelInfo->cbLimit; 121 pState->f64Bits = enmMode >= PGMMODE_AMD64 && pSelInfo->u.Raw.Gen.u1Long; 122 #else 123 RT_NOREF(pSelInfo); 124 125 pState->f64Bits = CPUMGetGuestCodeBits(pVCpu) == 64; 126 #endif 119 127 pState->enmMode = enmMode; 120 128 pState->GCPtrPage = 0; … … 124 132 pState->pVCpu = pVCpu; 125 133 pState->fLocked = false; 126 pState->f64Bits = enmMode >= PGMMODE_AMD64 && pSelInfo->u.Raw.Gen.u1Long;127 134 128 135 DISCPUMODE enmCpuMode; … … 133 140 RT_FALL_THRU(); 134 141 case DBGF_DISAS_FLAGS_DEFAULT_MODE: 135 enmCpuMode = pState->f64Bits 136 ? DISCPUMODE_64BIT 137 : pSelInfo->u.Raw.Gen.u1DefBig 138 ? DISCPUMODE_32BIT 139 : DISCPUMODE_16BIT; 142 enmCpuMode = CPUMGetGuestDisMode(pVCpu); 140 143 break; 144 #if !defined(VBOX_VMM_TARGET_ARMV8) 141 145 case DBGF_DISAS_FLAGS_16BIT_MODE: 142 146 case DBGF_DISAS_FLAGS_16BIT_REAL_MODE: … … 149 153 enmCpuMode = DISCPUMODE_64BIT; 150 154 break; 155 #else 156 case DBGF_DISAS_FLAGS_16BIT_MODE: /** @todo r=aeichner This is a bit abusive... */ 157 case DBGF_DISAS_FLAGS_16BIT_REAL_MODE: 158 enmCpuMode = DISCPUMODE_ARMV8_T32; 159 break; 160 case DBGF_DISAS_FLAGS_32BIT_MODE: 161 enmCpuMode = DISCPUMODE_ARMV8_A32; 162 break; 163 case DBGF_DISAS_FLAGS_64BIT_MODE: 164 enmCpuMode = DISCPUMODE_ARMV8_A64; 165 break; 166 #endif 151 167 } 152 168 … … 221 237 for (;;) 222 238 { 239 #if !defined(VBOX_VMM_TARGET_ARMV8) 223 240 RTGCUINTPTR GCPtr = pDis->uInstrAddr + offInstr + pState->GCPtrSegBase; 241 #else 242 RTGCUINTPTR GCPtr = pDis->uInstrAddr + offInstr; 243 #endif 224 244 225 245 /* … … 235 255 if (pState->fLocked) 236 256 PGMPhysReleasePageMappingLock(pState->pVM, &pState->PageMapLock); 237 if (pState->enmMode <= PGMMODE_PROTECTED) 257 if (PGMMODE_WITH_PAGING(pState->enmMode)) 258 rc = PGMPhysGCPtr2CCPtrReadOnly(pState->pVCpu, pState->GCPtrPage, &pState->pvPageR3, &pState->PageMapLock); 259 else 238 260 rc = PGMPhysGCPhys2CCPtrReadOnly(pState->pVM, pState->GCPtrPage, &pState->pvPageR3, &pState->PageMapLock); 239 else240 rc = PGMPhysGCPtr2CCPtrReadOnly(pState->pVCpu, pState->GCPtrPage, &pState->pvPageR3, &pState->PageMapLock);241 261 if (RT_SUCCESS(rc)) 242 262 pState->fLocked = true; … … 249 269 } 250 270 271 uint32_t cb = GUEST_PAGE_SIZE - (GCPtr & GUEST_PAGE_OFFSET_MASK); 272 #if !defined(VBOX_VMM_TARGET_ARMV8) 251 273 /* 252 274 * Check the segment limit. … … 258 280 * Calc how much we can read, maxing out the read. 259 281 */ 260 uint32_t cb = GUEST_PAGE_SIZE - (GCPtr & GUEST_PAGE_OFFSET_MASK);261 282 if (!pState->f64Bits) 262 283 { … … 265 286 cb = cbSeg; 266 287 } 288 #endif 267 289 if (cb > cbMaxRead) 268 290 cb = cbMaxRead; … … 298 320 DBGFADDRESS Addr; 299 321 int rc; 322 #if !defined(VBOX_VMM_TARGET_ARMV8) 300 323 /* Start with CS. */ 301 324 if ( DIS_FMT_SEL_IS_REG(u32Sel) … … 326 349 rc = VERR_SYMBOL_NOT_FOUND; 327 350 } 351 #else 352 RT_NOREF(pSelInfo, u32Sel); 353 354 DBGFR3AddrFromFlat(pState->pVM->pUVM, &Addr, uAddress); 355 rc = VINF_SUCCESS; 356 #endif 328 357 329 358 /* … … 353 382 return rc; 354 383 } 355 #endif /* VBOX_VMM_TARGET_ARMV8 */356 384 357 385 … … 383 411 384 412 #if defined(VBOX_VMM_TARGET_ARMV8) 385 RT_NOREF(pVM, pVCpu, Sel, GCPtr, rc, fFlags, pszOutput, cbOutput, pcbInstr, pDisState); 386 //AssertFailed(); /** @todo */ 387 return VERR_NOT_IMPLEMENTED; 413 DBGFSELINFO SelInfo; RT_ZERO(SelInfo); 414 const PGMMODE enmMode = PGMGetGuestMode(pVCpu); 415 const bool fRealModeAddress = false; 416 if (fFlags & DBGF_DISAS_FLAGS_CURRENT_GUEST) 417 GCPtr = CPUMGetGuestFlatPC(pVCpu); 388 418 #else 389 419 /* … … 428 458 SelInfo.GCPtrBase = pSRegCS->u64Base; 429 459 SelInfo.cbLimit = pSRegCS->u32Limit; 430 SelInfo.fFlags = PGMMODE_IS_ LONG_MODE(enmMode)460 SelInfo.fFlags = PGMMODE_IS_64BIT_MODE(enmMode) 431 461 ? DBGFSELINFO_FLAGS_LONG_MODE 432 462 : enmMode != PGMMODE_REAL && !pCtx->eflags.Bits.u1VM … … 452 482 SelInfo.GCPtrBase = 0; 453 483 SelInfo.cbLimit = ~(RTGCUINTPTR)0; 454 SelInfo.fFlags = PGMMODE_IS_ LONG_MODE(enmMode)484 SelInfo.fFlags = PGMMODE_IS_64BIT_MODE(enmMode) 455 485 ? DBGFSELINFO_FLAGS_LONG_MODE 456 486 : enmMode != PGMMODE_REAL … … 512 542 } 513 543 } 544 #endif 514 545 515 546 /* … … 531 562 */ 532 563 char szBuf[512]; 564 #if defined(VBOX_VMM_TARGET_ARMV8) 565 DISFormatArmV8Ex(&State.Dis, szBuf, sizeof(szBuf), 566 DIS_FMT_FLAGS_RELATIVE_BRANCH, 567 fFlags & DBGF_DISAS_FLAGS_NO_SYMBOLS ? NULL : dbgfR3DisasGetSymbol, 568 NULL); 569 #else 533 570 DISFormatYasmEx(&State.Dis, szBuf, sizeof(szBuf), 534 571 DIS_FMT_FLAGS_RELATIVE_BRANCH, 535 572 fFlags & DBGF_DISAS_FLAGS_NO_SYMBOLS ? NULL : dbgfR3DisasGetSymbol, 536 573 &SelInfo); 574 #endif 537 575 538 576 /* … … 548 586 else if (Sel == DBGF_SEL_FLAT) 549 587 { 550 if ( enmMode >= PGMMODE_AMD64)588 if (PGMMODE_IS_64BIT_MODE(enmMode)) 551 589 cch = RTStrPrintf(pszOutput, cbOutput, "%RGv %s", GCPtr, szBuf); 552 590 else … … 555 593 else 556 594 { 557 if ( enmMode >= PGMMODE_AMD64)595 if (PGMMODE_IS_64BIT_MODE(enmMode)) 558 596 cch = RTStrPrintf(pszOutput, cbOutput, "%04x:%RGv %s", Sel, GCPtr, szBuf); 559 597 else … … 576 614 else if (Sel == DBGF_SEL_FLAT) 577 615 { 578 if ( enmMode >= PGMMODE_AMD64)616 if (PGMMODE_IS_64BIT_MODE(enmMode)) 579 617 cch = RTStrPrintf(pszOutput, cbOutput, "%RGv %.*Rhxs%*s %s", 580 618 GCPtr, … … 589 627 else 590 628 { 591 if ( enmMode >= PGMMODE_AMD64)629 if (PGMMODE_IS_64BIT_MODE(enmMode)) 592 630 cch = RTStrPrintf(pszOutput, cbOutput, "%04x:%RGv %.*Rhxs%*s %s", 593 631 Sel, GCPtr, … … 617 655 dbgfR3DisasInstrDone(&State); 618 656 return VINF_SUCCESS; 619 #endif /* !VBOX_VMM_TARGET_ARMV8*/620 657 } 621 658 -
trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp
r105352 r105745 80 80 PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu); 81 81 PGMMODE enmMode = PGMGetGuestMode(pVCpu); 82 if ( enmMode == PGMMODE_REAL 83 || enmMode == PGMMODE_PROTECTED 82 if ( !PGMMODE_WITH_PAGING(enmMode) 84 83 || DBGFADDRESS_IS_PHYS(pAddress) 85 84 ) … … 98 97 if ( ( pAddress->FlatPtr >= _4G 99 98 || pAddress->FlatPtr + cbRange > _4G) 100 && enmMode != PGMMODE_AMD64 101 && enmMode != PGMMODE_AMD64_NX) 99 && !PGMMODE_IS_64BIT_MODE(enmMode)) 102 100 return VERR_DBGF_MEM_NOT_FOUND; 103 101 #endif … … 174 172 PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu); 175 173 PGMMODE enmMode = PGMGetGuestMode(pVCpu); 176 if ( enmMode == PGMMODE_REAL 177 || enmMode == PGMMODE_PROTECTED 178 || DBGFADDRESS_IS_PHYS(pAddress) ) 174 if ( !PGMMODE_WITH_PAGING(enmMode) 175 || DBGFADDRESS_IS_PHYS(pAddress)) 179 176 rc = PGMPhysSimpleReadGCPhys(pVM, pvBuf, pAddress->FlatPtr, cbRead); 180 177 else … … 183 180 if ( ( pAddress->FlatPtr >= _4G 184 181 || pAddress->FlatPtr + cbRead > _4G) 185 && enmMode != PGMMODE_AMD64 186 && enmMode != PGMMODE_AMD64_NX) 182 && !PGMMODE_IS_64BIT_MODE(enmMode)) 187 183 return VERR_PAGE_TABLE_NOT_PRESENT; 188 184 #endif … … 327 323 PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu); 328 324 PGMMODE enmMode = PGMGetGuestMode(pVCpu); 329 if ( enmMode == PGMMODE_REAL 330 || enmMode == PGMMODE_PROTECTED 331 || DBGFADDRESS_IS_PHYS(pAddress) ) 325 if ( !PGMMODE_WITH_PAGING(enmMode) 326 || DBGFADDRESS_IS_PHYS(pAddress)) 332 327 rc = PGMPhysSimpleWriteGCPhys(pVM, pAddress->FlatPtr, pvBuf, cbWrite); 333 328 else … … 336 331 if ( ( pAddress->FlatPtr >= _4G 337 332 || pAddress->FlatPtr + cbWrite > _4G) 338 && enmMode != PGMMODE_AMD64 339 && enmMode != PGMMODE_AMD64_NX) 333 && !PGMMODE_IS_64BIT_MODE(enmMode)) 340 334 return VERR_PAGE_TABLE_NOT_PRESENT; 341 335 #endif … … 512 506 switch (enmMode) 513 507 { 508 #if !defined(VBOX_VMM_TARGET_ARMV8) 514 509 case PGMMODE_32_BIT: 515 510 return DBGFPGDMP_FLAGS_PSE; … … 534 529 default: 535 530 AssertFailedReturn(UINT32_MAX); 531 #else 532 case PGMMODE_NONE: 533 return 0; 534 default: 535 AssertFailedReturn(UINT32_MAX); 536 #endif 536 537 } 537 538 } -
trunk/src/VBox/VMM/VMMR3/PGM-armv8.cpp
r104885 r105745 43 43 #include <VBox/vmm/pgm.h> 44 44 #include <VBox/vmm/cpum.h> 45 #include <VBox/vmm/cpum-armv8.h> 45 46 #include <VBox/vmm/iom.h> 46 47 #include <VBox/sup.h> … … 722 723 VMMDECL(PGMMODE) PGMGetGuestMode(PVMCPU pVCpu) 723 724 { 724 return pVCpu->pgm.s.enmGuestMode; 725 VMCPU_ASSERT_EMT(pVCpu); 726 727 bool fMmuEnabled = CPUMGetGuestMmuEnabled(pVCpu); 728 if (!fMmuEnabled) 729 return PGMMODE_NONE; 730 731 CPUMMODE enmCpuMode = CPUMGetGuestMode(pVCpu); 732 return enmCpuMode == CPUMMODE_ARMV8_AARCH64 733 ? PGMMODE_VMSA_V8_64 734 : PGMMODE_VMSA_V8_32; 725 735 } 726 736 … … 728 738 VMMDECL(PGMMODE) PGMGetShadowMode(PVMCPU pVCpu) 729 739 { 730 return pVCpu->pgm.s.enmShadowMode; 740 RT_NOREF(pVCpu); 741 return PGMMODE_NONE; /* NEM doesn't need any shadow paging. */ 731 742 } 732 743 … … 736 747 VMCPU_ASSERT_EMT(pVCpu); 737 748 Assert(pWalk); 738 AssertReleaseFailed();749 //AssertReleaseFailed(); 739 750 RT_NOREF(pVCpu, GCPtr, pWalk); 740 751 return VERR_NOT_IMPLEMENTED; -
trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp
r104840 r105745 1000 1000 */ 1001 1001 const bool fAllZero = ASMMemIsZero(pabNeedle, cbNeedle); 1002 RTGCPTR GCPtrMask = PGMMODE_IS_ LONG_MODE(enmMode) ? UINT64_MAX : UINT32_MAX;1002 RTGCPTR GCPtrMask = PGMMODE_IS_64BIT_MODE(enmMode) ? UINT64_MAX : UINT32_MAX; 1003 1003 uint8_t abPrev[MAX_NEEDLE_SIZE]; 1004 1004 size_t cbPrev = 0;
Note:
See TracChangeset
for help on using the changeset viewer.