VirtualBox

Changeset 55895 in vbox for trunk/src/VBox/VMM/VMMRC


Ignore:
Timestamp:
May 17, 2015 7:42:38 PM (10 years ago)
Author:
vboxsync
Message:

Added pvUser to the raw-mode context virtual handler callbacks.

Location:
trunk/src/VBox/VMM/VMMRC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMRC/CSAMRC.cpp

    r45620 r55895  
    4646#include <iprt/string.h>
    4747
     48
     49
    4850/**
    4951 * \#PF Handler callback for virtual access handler ranges. (CSAM self-modifying
     
    6163 * @param   offRange    The offset of the access into this range.
    6264 *                      (If it's a EIP range this is the EIP, if not it's pvFault.)
     65 * @param   pvUser      Ignored.
    6366 */
    64 VMMRCDECL(int) CSAMGCCodePageWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)
     67DECLEXPORT(int) csamRCCodePageWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,
     68                                             RTGCPTR pvRange, uintptr_t offRange, void *pvUser)
    6569{
    6670    PPATMGCSTATE pPATMGCState;
     
    8185
    8286    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. */
    8488    if (!pPATMGCState->fPIF && fPatchCode)
    8589    {
    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));
    8791        /** @note there are cases when pages previously used for code are now used for stack; patch generated code will fault (pushf))
    8892         *  Just make the page r/w and continue.
     
    104108        cpl = (pRegFrame->ss.Sel & X86_SEL_RPL);
    105109
    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));
    107111
    108112    /* 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. */
     
    131135     * Make this particular page R/W. The VM_FF_CSAM_FLUSH_DIRTY_PAGE handler will reset it to readonly again.
    132136     */
    133     Log(("CSAMGCCodePageWriteHandler: enabled r/w for page %RGv\n", pvFault));
     137    Log(("csamRCCodePageWriteHandler: enabled r/w for page %RGv\n", pvFault));
    134138    rc = PGMShwMakePageWritable(pVCpu, pvFault, PGM_MK_PG_IS_WRITE_FAULT);
    135139    AssertMsgRC(rc, ("PGMShwModifyPage -> rc=%Rrc\n", rc));
  • trunk/src/VBox/VMM/VMMRC/PATMRC.cpp

    r45485 r55895  
    5757 *                      (If it's a EIP range this is the EIP, if not it's pvFault.)
    5858 */
    59 VMMRCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)
     59DECLEXPORT(int) patmRCVirtPagePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,
     60                                        RTGCPTR pvRange, uintptr_t offRange, void *pvUser)
    6061{
    6162    NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange);
  • trunk/src/VBox/VMM/VMMRC/SELMRC.cpp

    r49914 r55895  
    223223
    224224
    225 
    226225/**
    227226 * \#PF Virtual Handler callback for Guest write access to the Guest's own GDT.
     
    236235 *                      (If it's a EIP range this is the EIP, if not it's pvFault.)
    237236 */
    238 VMMRCDECL(int) selmRCGuestGDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)
     237DECLEXPORT(int) selmRCGuestGDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,
     238                                             RTGCPTR pvRange, uintptr_t offRange, void *pvUser)
    239239{
    240240    PVMCPU pVCpu = VMMGetCpu0(pVM);
    241     LogFlow(("selmRCGuestGDTWriteHandler 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);
    243243
    244244    /*
     
    328328 * @param   offRange    The offset of the access into this range.
    329329 *                      (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 */
     332DECLEXPORT(int) selmRCGuestLDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,
     333                                             RTGCPTR pvRange, uintptr_t offRange, void *pvUser)
    332334{
    333335    /** @todo To be implemented. */
    334336    ////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);
    336338
    337339    VMCPU_FF_SET(VMMGetCpu0(pVM), VMCPU_FF_SELM_SYNC_LDT);
     
    381383 * @param   offRange    The offset of the access into this range.
    382384 *                      (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 */
     387DECLEXPORT(int) selmRCGuestTSSWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,
     388                                             RTGCPTR pvRange, uintptr_t offRange, void *pvUser)
    385389{
    386390    PVMCPU pVCpu = VMMGetCpu0(pVM);
    387     LogFlow(("selmRCGuestTSSWriteHandler 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);
    389393
    390394    /*
     
    409413           )
    410414        {
    411             Log(("selmRCGuestTSSWriteHandler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv\n",
     415            Log(("selmRCGuestTSSWritePfHandler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv\n",
    412416                 (RTSEL)(pVM->selm.s.Tss.ss1 & ~1), (RTGCPTR)pVM->selm.s.Tss.esp1, (RTSEL)pGuestTss->ss0, (RTGCPTR)pGuestTss->esp0));
    413417            pVM->selm.s.Tss.esp1 = pGuestTss->esp0;
     
    423427                )
    424428        {
    425             Log(("selmRCGuestTSSWriteHandler: R1 stack: %RTsel:%RGv -> %RTsel:%RGv\n",
     429            Log(("selmRCGuestTSSWritePfHandler: R1 stack: %RTsel:%RGv -> %RTsel:%RGv\n",
    426430                 (RTSEL)((pVM->selm.s.Tss.ss2 & ~2) | 1), (RTGCPTR)pVM->selm.s.Tss.esp2, (RTSEL)pGuestTss->ss1, (RTGCPTR)pGuestTss->esp1));
    427431            pVM->selm.s.Tss.esp2 = pGuestTss->esp1;
     
    447451               )
    448452            {
    449                 Log(("selmRCGuestTSSWriteHandler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv [x-page]\n",
     453                Log(("selmRCGuestTSSWritePfHandler: R0 stack: %RTsel:%RGv -> %RTsel:%RGv [x-page]\n",
    450454                     (RTSEL)(pVM->selm.s.Tss.ss1 & ~1), (RTGCPTR)pVM->selm.s.Tss.esp1, (RTSEL)s.ss0, (RTGCPTR)s.esp0));
    451455                pVM->selm.s.Tss.esp1 = s.esp0;
     
    534538 * @param   offRange    The offset of the access into this range.
    535539 *                      (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 */
     542DECLEXPORT(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);
    541547    return VERR_SELM_SHADOW_GDT_WRITE;
    542548}
     
    556562 * @param   offRange    The offset of the access into this range.
    557563 *                      (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 */
     566DECLEXPORT(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));
    562570    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);
    564572    return VERR_SELM_SHADOW_LDT_WRITE;
    565573}
     
    579587 * @param   offRange    The offset of the access into this range.
    580588 *                      (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 */
     591DECLEXPORT(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);
    586596    return VERR_SELM_SHADOW_TSS_WRITE;
    587597}
  • trunk/src/VBox/VMM/VMMRC/TRPMRC.cpp

    r44528 r55895  
    101101 * @param   offRange    The offset of the access into this range.
    102102 *                      (If it's a EIP range this is the EIP, if not it's pvFault.)
     103 * @param   pvUser      Unused.
    103104 */
    104 VMMRCDECL(int) trpmRCGuestIDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)
     105DECLEXPORT(int) trpmRCGuestIDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,
     106                                             RTGCPTR pvRange, uintptr_t offRange, void *pvUser)
    105107{
    106108    PVMCPU      pVCpu = VMMGetCpu0(pVM);
     
    114116    AssertMsg(offRange < (uint32_t)cbIDT+1, ("pvFault=%RGv GCPtrIDT=%RGv-%RGv pvRange=%RGv\n", pvFault, GCPtrIDT, GCPtrIDTEnd, pvRange));
    115117    Assert((RTGCPTR)(RTRCUINTPTR)pvRange == GCPtrIDT);
    116     NOREF(uErrorCode);
     118    NOREF(uErrorCode); NOREF(pvUser);
    117119
    118120#if 0
     
    143145#endif
    144146
    145     Log(("trpmRCGuestIDTWriteHandler: 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));
    146148
    147149    /** @todo Check which IDT entry and keep the update cost low in TRPMR3SyncIDT() and CSAMCheckGates(). */
     
    164166 * @param   offRange    The offset of the access into this range.
    165167 *                      (If it's a EIP range this is the EIP, if not it's pvFault.)
     168 * @param   pvUser      Unused.
    166169 */
    167 VMMRCDECL(int) trpmRCShadowIDTWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)
     170DECLEXPORT(int) trpmRCShadowIDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,
     171                                              RTGCPTR pvRange, uintptr_t offRange, void *pvUser)
    168172{
    169173    PVMCPU pVCpu = VMMGetCpu0(pVM);
    170     LogRel(("FATAL ERROR: trpmRCShadowIDTWriteHandler: 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);
    172176
    173177    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette