Changeset 92727 in vbox
- Timestamp:
- Dec 3, 2021 12:33:33 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp
r92726 r92727 305 305 && !pUVM->dbgf.s.paBpLocL1R3) 306 306 { 307 DBGFBPINITREQ Req; 308 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 309 Req.Hdr.cbReq = sizeof(Req); 310 Req.paBpLocL1R3 = NULL; 311 int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_INIT, 0 /*u64Arg*/, &Req.Hdr); 312 AssertLogRelMsgRCReturn(rc, ("VMMR0_DO_DBGF_BP_INIT failed: %Rrc\n", rc), rc); 313 pUVM->dbgf.s.paBpLocL1R3 = Req.paBpLocL1R3; 307 if (!SUPR3IsDriverless()) 308 { 309 DBGFBPINITREQ Req; 310 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 311 Req.Hdr.cbReq = sizeof(Req); 312 Req.paBpLocL1R3 = NULL; 313 int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_INIT, 0 /*u64Arg*/, &Req.Hdr); 314 AssertLogRelMsgRCReturn(rc, ("VMMR0_DO_DBGF_BP_INIT failed: %Rrc\n", rc), rc); 315 pUVM->dbgf.s.paBpLocL1R3 = Req.paBpLocL1R3; 316 } 317 else 318 { 319 /* Driverless: Do dbgfR0BpInitWorker here, ring-3 style. */ 320 uint32_t const cbL1Loc = RT_ALIGN_32(UINT16_MAX * sizeof(uint32_t), PAGE_SIZE); 321 pUVM->dbgf.s.paBpLocL1R3 = (uint32_t *)RTMemPageAllocZ(cbL1Loc); 322 AssertLogRelMsgReturn(pUVM->dbgf.s.paBpLocL1R3, ("cbL1Loc=%#x\n", cbL1Loc), VERR_NO_PAGE_MEMORY); 323 } 314 324 } 315 325 … … 358 368 && !pUVM->dbgf.s.paBpLocPortIoR3) 359 369 { 360 DBGFBPINITREQ Req; 361 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 362 Req.Hdr.cbReq = sizeof(Req); 363 Req.paBpLocL1R3 = NULL; 364 int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_PORTIO_INIT, 0 /*u64Arg*/, &Req.Hdr); 365 AssertLogRelMsgRCReturn(rc, ("VMMR0_DO_DBGF_BP_PORTIO_INIT failed: %Rrc\n", rc), rc); 366 pUVM->dbgf.s.paBpLocPortIoR3 = Req.paBpLocL1R3; 370 if (!SUPR3IsDriverless()) 371 { 372 DBGFBPINITREQ Req; 373 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 374 Req.Hdr.cbReq = sizeof(Req); 375 Req.paBpLocL1R3 = NULL; 376 int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_PORTIO_INIT, 0 /*u64Arg*/, &Req.Hdr); 377 AssertLogRelMsgRCReturn(rc, ("VMMR0_DO_DBGF_BP_PORTIO_INIT failed: %Rrc\n", rc), rc); 378 pUVM->dbgf.s.paBpLocPortIoR3 = Req.paBpLocL1R3; 379 } 380 else 381 { 382 /* Driverless: Do dbgfR0BpPortIoInitWorker here, ring-3 style. */ 383 uint32_t const cbPortIoLoc = RT_ALIGN_32(UINT16_MAX * sizeof(uint32_t), PAGE_SIZE); 384 pUVM->dbgf.s.paBpLocPortIoR3 = (uint32_t *)RTMemPageAllocZ(cbPortIoLoc); 385 AssertLogRelMsgReturn(pUVM->dbgf.s.paBpLocPortIoR3, ("cbPortIoLoc=%#x\n", cbPortIoLoc), VERR_NO_PAGE_MEMORY); 386 } 367 387 } 368 388 … … 421 441 if (pUVM->dbgf.s.pbmBpOwnersAllocR3) 422 442 { 423 DBGFBPOWNERINITREQ Req; 424 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 425 Req.Hdr.cbReq = sizeof(Req); 426 Req.paBpOwnerR3 = NULL; 427 rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_OWNER_INIT, 0 /*u64Arg*/, &Req.Hdr); 428 AssertLogRelMsgRC(rc, ("VMMR0_DO_DBGF_BP_OWNER_INIT failed: %Rrc\n", rc)); 429 if (RT_SUCCESS(rc)) 430 { 431 pUVM->dbgf.s.paBpOwnersR3 = (PDBGFBPOWNERINT)Req.paBpOwnerR3; 432 return VINF_SUCCESS; 443 if (!SUPR3IsDriverless()) 444 { 445 DBGFBPOWNERINITREQ Req; 446 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 447 Req.Hdr.cbReq = sizeof(Req); 448 Req.paBpOwnerR3 = NULL; 449 rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_OWNER_INIT, 0 /*u64Arg*/, &Req.Hdr); 450 if (RT_SUCCESS(rc)) 451 { 452 pUVM->dbgf.s.paBpOwnersR3 = (PDBGFBPOWNERINT)Req.paBpOwnerR3; 453 return VINF_SUCCESS; 454 } 455 AssertLogRelMsgRC(rc, ("VMMR0_DO_DBGF_BP_OWNER_INIT failed: %Rrc\n", rc)); 456 } 457 else 458 { 459 /* Driverless: Do dbgfR0BpOwnerInitWorker here, ring-3 style. */ 460 uint32_t const cbBpOwnerR3 = RT_ALIGN_32(DBGF_BP_OWNER_COUNT_MAX * sizeof(DBGFBPOWNERINT), PAGE_SIZE); 461 pUVM->dbgf.s.paBpLocPortIoR3 = (uint32_t *)RTMemPageAllocZ(cbBpOwnerR3); 462 if (pUVM->dbgf.s.paBpLocPortIoR3) 463 return VINF_SUCCESS; 464 AssertLogRelMsgFailed(("cbBpOwnerR3=%#x\n", cbBpOwnerR3)); 465 rc = VERR_NO_PAGE_MEMORY; 433 466 } 434 467 … … 577 610 if (RT_LIKELY(pbmAlloc)) 578 611 { 579 DBGFBPCHUNKALLOCREQ Req; 580 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 581 Req.Hdr.cbReq = sizeof(Req); 582 Req.idChunk = idChunk; 583 Req.pChunkBaseR3 = NULL; 584 rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_CHUNK_ALLOC, 0 /*u64Arg*/, &Req.Hdr); 585 AssertLogRelMsgRC(rc, ("VMMR0_DO_DBGF_BP_CHUNK_ALLOC failed: %Rrc\n", rc)); 612 if (!SUPR3IsDriverless()) 613 { 614 DBGFBPCHUNKALLOCREQ Req; 615 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 616 Req.Hdr.cbReq = sizeof(Req); 617 Req.idChunk = idChunk; 618 Req.pChunkBaseR3 = NULL; 619 rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_CHUNK_ALLOC, 0 /*u64Arg*/, &Req.Hdr); 620 if (RT_SUCCESS(rc)) 621 pBpChunk->pBpBaseR3 = (PDBGFBPINT)Req.pChunkBaseR3; 622 else 623 AssertLogRelMsgRC(rc, ("VMMR0_DO_DBGF_BP_CHUNK_ALLOC failed: %Rrc\n", rc)); 624 } 625 else 626 { 627 /* Driverless: Do dbgfR0BpChunkAllocWorker here, ring-3 style. */ 628 uint32_t const cbShared = RT_ALIGN_32(DBGF_BP_COUNT_PER_CHUNK * sizeof(DBGFBPINT), PAGE_SIZE); 629 pBpChunk->pBpBaseR3 = (PDBGFBPINT)RTMemPageAllocZ(cbShared); 630 AssertLogRelMsgStmt(pBpChunk->pBpBaseR3, ("cbShared=%#x\n", cbShared), rc = VERR_NO_PAGE_MEMORY); 631 } 586 632 if (RT_SUCCESS(rc)) 587 633 { 588 pBpChunk->pBpBaseR3 = (PDBGFBPINT)Req.pChunkBaseR3;589 634 pBpChunk->pbmAlloc = (void volatile *)pbmAlloc; 590 635 pBpChunk->cBpsFree = DBGF_BP_COUNT_PER_CHUNK; … … 787 832 if (RT_LIKELY(pbmAlloc)) 788 833 { 789 DBGFBPL2TBLCHUNKALLOCREQ Req; 790 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 791 Req.Hdr.cbReq = sizeof(Req); 792 Req.idChunk = idChunk; 793 Req.pChunkBaseR3 = NULL; 794 rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_L2_TBL_CHUNK_ALLOC, 0 /*u64Arg*/, &Req.Hdr); 795 AssertLogRelMsgRC(rc, ("VMMR0_DO_DBGF_BP_L2_TBL_CHUNK_ALLOC failed: %Rrc\n", rc)); 834 if (!SUPR3IsDriverless()) 835 { 836 DBGFBPL2TBLCHUNKALLOCREQ Req; 837 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 838 Req.Hdr.cbReq = sizeof(Req); 839 Req.idChunk = idChunk; 840 Req.pChunkBaseR3 = NULL; 841 rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_DBGF_BP_L2_TBL_CHUNK_ALLOC, 0 /*u64Arg*/, &Req.Hdr); 842 if (RT_SUCCESS(rc)) 843 pL2Chunk->pL2BaseR3 = (PDBGFBPL2ENTRY)Req.pChunkBaseR3; 844 else 845 AssertLogRelMsgRC(rc, ("VMMR0_DO_DBGF_BP_L2_TBL_CHUNK_ALLOC failed: %Rrc\n", rc)); 846 } 847 else 848 { 849 /* Driverless: Do dbgfR0BpL2TblChunkAllocWorker here, ring-3 style. */ 850 uint32_t const cbTotal = RT_ALIGN_32(DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK * sizeof(DBGFBPL2ENTRY), PAGE_SIZE); 851 pL2Chunk->pL2BaseR3 = (PDBGFBPL2ENTRY)RTMemPageAllocZ(cbTotal); 852 AssertLogRelMsgStmt(pL2Chunk->pL2BaseR3, ("cbTotal=%#x\n", cbTotal), rc = VERR_NO_PAGE_MEMORY); 853 } 796 854 if (RT_SUCCESS(rc)) 797 855 { 798 pL2Chunk->pL2BaseR3 = (PDBGFBPL2ENTRY)Req.pChunkBaseR3;799 856 pL2Chunk->pbmAlloc = (void volatile *)pbmAlloc; 800 857 pL2Chunk->cFree = DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK;
Note:
See TracChangeset
for help on using the changeset viewer.