Changeset 55895 in vbox for trunk/src/VBox/VMM/VMMRC
- Timestamp:
- May 17, 2015 7:42:38 PM (10 years ago)
- Location:
- trunk/src/VBox/VMM/VMMRC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMRC/CSAMRC.cpp
r45620 r55895 46 46 #include <iprt/string.h> 47 47 48 49 48 50 /** 49 51 * \#PF Handler callback for virtual access handler ranges. (CSAM self-modifying … … 61 63 * @param offRange The offset of the access into this range. 62 64 * (If it's a EIP range this is the EIP, if not it's pvFault.) 65 * @param pvUser Ignored. 63 66 */ 64 VMMRCDECL(int) CSAMGCCodePageWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 67 DECLEXPORT(int) csamRCCodePageWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 68 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 65 69 { 66 70 PPATMGCSTATE pPATMGCState; … … 81 85 82 86 Assert(pPATMGCState->fPIF || fPatchCode); 83 /* *When patch code is executing instructions that must complete, then we must *never* interrupt it. */87 /* When patch code is executing instructions that must complete, then we must *never* interrupt it. */ 84 88 if (!pPATMGCState->fPIF && fPatchCode) 85 89 { 86 Log((" CSAMGCCodePageWriteHandler: fPIF=0 -> stack fault in patch generated code at %08RX32!\n", pRegFrame->eip));90 Log(("csamRCCodePageWriteHandler: fPIF=0 -> stack fault in patch generated code at %08RX32!\n", pRegFrame->eip)); 87 91 /** @note there are cases when pages previously used for code are now used for stack; patch generated code will fault (pushf)) 88 92 * Just make the page r/w and continue. … … 104 108 cpl = (pRegFrame->ss.Sel & X86_SEL_RPL); 105 109 106 Log((" CSAMGCCodePageWriteHandler: code page write at %RGv original address %RGv (cpl=%d)\n", pvFault, (RTGCUINTPTR)pvRange + offRange, cpl));110 Log(("csamRCCodePageWriteHandler: code page write at %RGv original address %RGv (cpl=%d)\n", pvFault, (RTGCUINTPTR)pvRange + offRange, cpl)); 107 111 108 112 /* If user code is modifying one of our monitored pages, then we can safely make it r/w as it's no longer being used for supervisor code. */ … … 131 135 * Make this particular page R/W. The VM_FF_CSAM_FLUSH_DIRTY_PAGE handler will reset it to readonly again. 132 136 */ 133 Log((" CSAMGCCodePageWriteHandler: enabled r/w for page %RGv\n", pvFault));137 Log(("csamRCCodePageWriteHandler: enabled r/w for page %RGv\n", pvFault)); 134 138 rc = PGMShwMakePageWritable(pVCpu, pvFault, PGM_MK_PG_IS_WRITE_FAULT); 135 139 AssertMsgRC(rc, ("PGMShwModifyPage -> rc=%Rrc\n", rc)); -
trunk/src/VBox/VMM/VMMRC/PATMRC.cpp
r45485 r55895 57 57 * (If it's a EIP range this is the EIP, if not it's pvFault.) 58 58 */ 59 VMMRCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 59 DECLEXPORT(int) patmRCVirtPagePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 60 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 60 61 { 61 62 NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); -
trunk/src/VBox/VMM/VMMRC/SELMRC.cpp
r49914 r55895 223 223 224 224 225 226 225 /** 227 226 * \#PF Virtual Handler callback for Guest write access to the Guest's own GDT. … … 236 235 * (If it's a EIP range this is the EIP, if not it's pvFault.) 237 236 */ 238 VMMRCDECL(int) selmRCGuestGDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 237 DECLEXPORT(int) selmRCGuestGDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 238 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 239 239 { 240 240 PVMCPU pVCpu = VMMGetCpu0(pVM); 241 LogFlow(("selmRCGuestGDTWrite Handler errcode=%x fault=%RGv offRange=%08x\n", (uint32_t)uErrorCode, pvFault, offRange));242 NOREF(pvRange); 241 LogFlow(("selmRCGuestGDTWritePfHandler errcode=%x fault=%RGv offRange=%08x\n", (uint32_t)uErrorCode, pvFault, offRange)); 242 NOREF(pvRange); NOREF(pvUser); 243 243 244 244 /* … … 328 328 * @param offRange The offset of the access into this range. 329 329 * (If it's a EIP range this is the EIP, if not it's pvFault.) 330 */ 331 VMMRCDECL(int) selmRCGuestLDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 330 * @param pvUser Unused. 331 */ 332 DECLEXPORT(int) selmRCGuestLDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 333 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 332 334 { 333 335 /** @todo To be implemented. */ 334 336 ////LogCom(("selmRCGuestLDTWriteHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 335 NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); 337 NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 336 338 337 339 VMCPU_FF_SET(VMMGetCpu0(pVM), VMCPU_FF_SELM_SYNC_LDT); … … 381 383 * @param offRange The offset of the access into this range. 382 384 * (If it's a EIP range this is the EIP, if not it's pvFault.) 383 */ 384 VMMRCDECL(int) selmRCGuestTSSWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 385 * @param pvUser Unused. 386 */ 387 DECLEXPORT(int) selmRCGuestTSSWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 388 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 385 389 { 386 390 PVMCPU pVCpu = VMMGetCpu0(pVM); 387 LogFlow(("selmRCGuestTSSWrite Handler errcode=%x fault=%RGv offRange=%08x\n", (uint32_t)uErrorCode, pvFault, offRange));388 NOREF(pvRange); 391 LogFlow(("selmRCGuestTSSWritePfHandler errcode=%x fault=%RGv offRange=%08x\n", (uint32_t)uErrorCode, pvFault, offRange)); 392 NOREF(pvRange); NOREF(pvUser); 389 393 390 394 /* … … 409 413 ) 410 414 { 411 Log(("selmRCGuestTSSWrite Handler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv\n",415 Log(("selmRCGuestTSSWritePfHandler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv\n", 412 416 (RTSEL)(pVM->selm.s.Tss.ss1 & ~1), (RTGCPTR)pVM->selm.s.Tss.esp1, (RTSEL)pGuestTss->ss0, (RTGCPTR)pGuestTss->esp0)); 413 417 pVM->selm.s.Tss.esp1 = pGuestTss->esp0; … … 423 427 ) 424 428 { 425 Log(("selmRCGuestTSSWrite Handler: R1 stack: %RTsel:%RGv -> %RTsel:%RGv\n",429 Log(("selmRCGuestTSSWritePfHandler: R1 stack: %RTsel:%RGv -> %RTsel:%RGv\n", 426 430 (RTSEL)((pVM->selm.s.Tss.ss2 & ~2) | 1), (RTGCPTR)pVM->selm.s.Tss.esp2, (RTSEL)pGuestTss->ss1, (RTGCPTR)pGuestTss->esp1)); 427 431 pVM->selm.s.Tss.esp2 = pGuestTss->esp1; … … 447 451 ) 448 452 { 449 Log(("selmRCGuestTSSWrite Handler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv [x-page]\n",453 Log(("selmRCGuestTSSWritePfHandler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv [x-page]\n", 450 454 (RTSEL)(pVM->selm.s.Tss.ss1 & ~1), (RTGCPTR)pVM->selm.s.Tss.esp1, (RTSEL)s.ss0, (RTGCPTR)s.esp0)); 451 455 pVM->selm.s.Tss.esp1 = s.esp0; … … 534 538 * @param offRange The offset of the access into this range. 535 539 * (If it's a EIP range this is the EIP, if not it's pvFault.) 536 */ 537 VMMRCDECL(int) selmRCShadowGDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 538 { 539 LogRel(("FATAL ERROR: selmRCShadowGDTWriteHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 540 NOREF(pVM); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); 540 * @param pvUser Unused. 541 */ 542 DECLEXPORT(int) selmRCShadowGDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 543 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 544 { 545 LogRel(("FATAL ERROR: selmRCShadowGDTWritePfHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 546 NOREF(pVM); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 541 547 return VERR_SELM_SHADOW_GDT_WRITE; 542 548 } … … 556 562 * @param offRange The offset of the access into this range. 557 563 * (If it's a EIP range this is the EIP, if not it's pvFault.) 558 */ 559 VMMRCDECL(int) selmRCShadowLDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 560 { 561 LogRel(("FATAL ERROR: selmRCShadowLDTWriteHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 564 * @param pvUser Unused. 565 */ 566 DECLEXPORT(int) selmRCShadowLDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 567 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 568 { 569 LogRel(("FATAL ERROR: selmRCShadowLDTWritePfHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 562 570 Assert(pvFault - (uintptr_t)pVM->selm.s.pvLdtRC < (unsigned)(65536U + PAGE_SIZE)); 563 NOREF(pVM); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); 571 NOREF(pVM); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 564 572 return VERR_SELM_SHADOW_LDT_WRITE; 565 573 } … … 579 587 * @param offRange The offset of the access into this range. 580 588 * (If it's a EIP range this is the EIP, if not it's pvFault.) 581 */ 582 VMMRCDECL(int) selmRCShadowTSSWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 583 { 584 LogRel(("FATAL ERROR: selmRCShadowTSSWriteHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 585 NOREF(pVM); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); 589 * @param pvUser Unused. 590 */ 591 DECLEXPORT(int) selmRCShadowTSSWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 592 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 593 { 594 LogRel(("FATAL ERROR: selmRCShadowTSSWritePfHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 595 NOREF(pVM); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 586 596 return VERR_SELM_SHADOW_TSS_WRITE; 587 597 } -
trunk/src/VBox/VMM/VMMRC/TRPMRC.cpp
r44528 r55895 101 101 * @param offRange The offset of the access into this range. 102 102 * (If it's a EIP range this is the EIP, if not it's pvFault.) 103 * @param pvUser Unused. 103 104 */ 104 VMMRCDECL(int) trpmRCGuestIDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 105 DECLEXPORT(int) trpmRCGuestIDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 106 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 105 107 { 106 108 PVMCPU pVCpu = VMMGetCpu0(pVM); … … 114 116 AssertMsg(offRange < (uint32_t)cbIDT+1, ("pvFault=%RGv GCPtrIDT=%RGv-%RGv pvRange=%RGv\n", pvFault, GCPtrIDT, GCPtrIDTEnd, pvRange)); 115 117 Assert((RTGCPTR)(RTRCUINTPTR)pvRange == GCPtrIDT); 116 NOREF(uErrorCode); 118 NOREF(uErrorCode); NOREF(pvUser); 117 119 118 120 #if 0 … … 143 145 #endif 144 146 145 Log(("trpmRCGuestIDTWrite Handler: eip=%RGv write to gate %x offset %x\n", pRegFrame->eip, iGate, offRange));147 Log(("trpmRCGuestIDTWritePfHandler: eip=%RGv write to gate %x offset %x\n", pRegFrame->eip, iGate, offRange)); 146 148 147 149 /** @todo Check which IDT entry and keep the update cost low in TRPMR3SyncIDT() and CSAMCheckGates(). */ … … 164 166 * @param offRange The offset of the access into this range. 165 167 * (If it's a EIP range this is the EIP, if not it's pvFault.) 168 * @param pvUser Unused. 166 169 */ 167 VMMRCDECL(int) trpmRCShadowIDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 170 DECLEXPORT(int) trpmRCShadowIDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 171 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 168 172 { 169 173 PVMCPU pVCpu = VMMGetCpu0(pVM); 170 LogRel(("FATAL ERROR: trpmRCShadowIDTWrite Handler: eip=%08X pvFault=%RGv pvRange=%08RGv\r\n", pRegFrame->eip, pvFault, pvRange));171 NOREF(uErrorCode); NOREF(offRange); 174 LogRel(("FATAL ERROR: trpmRCShadowIDTWritePfHandler: eip=%08X pvFault=%RGv pvRange=%08RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 175 NOREF(uErrorCode); NOREF(offRange); NOREF(pvUser); 172 176 173 177 /*
Note:
See TracChangeset
for help on using the changeset viewer.