VirtualBox

Changeset 18723 in vbox for trunk/src


Ignore:
Timestamp:
Apr 5, 2009 5:33:22 PM (16 years ago)
Author:
vboxsync
Message:

TRPMGCHandlers.cpp: Logging and a couple of todos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMGC/TRPMGCHandlers.cpp

    r18617 r18723  
    144144#ifdef VBOX_HIGH_RES_TIMERS_HACK
    145145    /*
    146      * Occationally we should poll timers.
     146     * We should poll the timers occationally.
    147147     * We must *NOT* do this too frequently as it adds a significant overhead
    148148     * and it'll kill us if the trap load is high. (See #1354.)
     
    259259    RTGCUINTREG uDr6 = ASMGetAndClearDR6();
    260260    PVM pVM = TRPM2VM(pTrpm);
    261     LogFlow(("TRPMGCTrap01Handler: cs:eip=%04x:%08x uDr6=%RTreg\n", pRegFrame->cs, pRegFrame->eip, uDr6));
     261    LogFlow(("TRPMGC01: cs:eip=%04x:%08x uDr6=%RTreg\n", pRegFrame->cs, pRegFrame->eip, uDr6));
    262262
    263263    /*
     
    281281        CPUMSetGuestDR6(pVM, uDr6);
    282282
    283     return trpmGCExitTrap(pVM, rc, pRegFrame);
     283    rc = trpmGCExitTrap(pVM, rc, pRegFrame);
     284    Log6(("TRPMGC01: %Rrc (%04x:%08x %RTreg)\n", rc, pRegFrame->cs, pRegFrame->eip, uDr6));
     285    return rc;
    284286}
    285287
     
    318320DECLASM(int) TRPMGCTrap03Handler(PTRPM pTrpm, PCPUMCTXCORE pRegFrame)
    319321{
    320     LogFlow(("TRPMGCTrap03Handler: cs:eip=%04x:%08x\n", pRegFrame->cs, pRegFrame->eip));
     322    LogFlow(("TRPMGC03: %04x:%08x\n", pRegFrame->cs, pRegFrame->eip));
    321323    PVM pVM = TRPM2VM(pTrpm);
    322324    int rc;
     
    330332        rc = PATMHandleInt3PatchTrap(pVM, pRegFrame);
    331333        if (rc == VINF_SUCCESS || rc == VINF_EM_RAW_EMULATE_INSTR || rc == VINF_PATM_PATCH_INT3 || rc == VINF_PATM_DUPLICATE_FUNCTION)
    332             return trpmGCExitTrap(pVM, rc, pRegFrame);
     334        {
     335            rc = trpmGCExitTrap(pVM, rc, pRegFrame);
     336            Log6(("TRPMGC03: %Rrc (%04x:%08x) (PATM)\n", rc, pRegFrame->cs, pRegFrame->eip));
     337            return rc;
     338        }
    333339    }
    334340    rc = DBGFGCTrap03Handler(pVM, pRegFrame);
     341
    335342    /* anything we should do with this? Schedule it in GC? */
    336     return trpmGCExitTrap(pVM, rc, pRegFrame);
     343    rc = trpmGCExitTrap(pVM, rc, pRegFrame);
     344    Log6(("TRPMGC03: %Rrc (%04x:%08x)\n", rc, pRegFrame->cs, pRegFrame->eip));
     345    return rc;
    337346}
    338347
     
    351360DECLASM(int) TRPMGCTrap06Handler(PTRPM pTrpm, PCPUMCTXCORE pRegFrame)
    352361{
     362    LogFlow(("TRPMGC06: %04x:%08x efl=%x\n", pRegFrame->cs, pRegFrame->eip, pRegFrame->eflags.u32));
    353363    PVM pVM = TRPM2VM(pTrpm);
    354364    int rc;
    355 
    356     LogFlow(("TRPMGCTrap06Handler %08RX32 eflags=%x\n", pRegFrame->eip, pRegFrame->eflags.u32));
    357365
    358366    if (CPUMGetGuestCPL(pVM, pRegFrame) == 0)
     
    366374        {
    367375            Log(("TRPMGCTrap06Handler: Failed to convert %RTsel:%RX32 (cpl=%d) - rc=%Rrc !!\n", pRegFrame->cs, pRegFrame->eip, pRegFrame->ss & X86_SEL_RPL, rc));
    368             return trpmGCExitTrap(pVM, VINF_EM_RAW_GUEST_TRAP, pRegFrame);
     376            rc = trpmGCExitTrap(pVM, VINF_EM_RAW_GUEST_TRAP, pRegFrame);
     377            Log6(("TRPMGC06: %Rrc (%04x:%08x) (SELM)\n", rc, pRegFrame->cs, pRegFrame->eip));
     378            return rc;
    369379        }
    370380
     
    373383        rc = EMInterpretDisasOneEx(pVM, (RTGCUINTPTR)PC, pRegFrame, &Cpu, &cbOp);
    374384        if (RT_FAILURE(rc))
    375             return trpmGCExitTrap(pVM, VINF_EM_RAW_EMULATE_INSTR, pRegFrame);
     385        {
     386            rc = trpmGCExitTrap(pVM, VINF_EM_RAW_EMULATE_INSTR, pRegFrame);
     387            Log6(("TRPMGC06: %Rrc (%04x:%08x) (EM)\n", rc, pRegFrame->cs, pRegFrame->eip));
     388            return rc;
     389        }
    376390
    377391        /*
     
    382396        {
    383397            rc = PATMGCHandleIllegalInstrTrap(pVM, pRegFrame);
     398            /** @todo  These tests are completely unnecessary, should just follow the
     399             *         flow and return at the end of the function. */
    384400            if (    rc == VINF_SUCCESS
    385401                ||  rc == VINF_EM_RAW_EMULATE_INSTR
     
    387403                ||  rc == VINF_PATM_PENDING_IRQ_AFTER_IRET
    388404                ||  rc == VINF_EM_RESCHEDULE)
    389                 return trpmGCExitTrap(pVM, rc, pRegFrame);
     405            {
     406                rc = trpmGCExitTrap(pVM, rc, pRegFrame);
     407                Log6(("TRPMGC06: %Rrc (%04x:%08x) (PATM)\n", rc, pRegFrame->cs, pRegFrame->eip));
     408                return rc;
     409            }
    390410        }
    391411        /*
     
    423443    }
    424444
    425     return trpmGCExitTrap(pVM, rc, pRegFrame);
     445    rc = trpmGCExitTrap(pVM, rc, pRegFrame);
     446    Log6(("TRPMGC06: %Rrc (%04x:%08x)\n", rc, pRegFrame->cs, pRegFrame->eip));
     447    return rc;
    426448}
    427449
     
    442464DECLASM(int) TRPMGCTrap07Handler(PTRPM pTrpm, PCPUMCTXCORE pRegFrame)
    443465{
     466    LogFlow(("TRPMGC07: %04x:%08x\n", pRegFrame->cs, pRegFrame->eip));
    444467    PVM pVM = TRPM2VM(pTrpm);
    445468
    446     LogFlow(("TRPMTrap07HandlerGC: eip=%08RX32\n", pRegFrame->eip));
    447     return CPUMHandleLazyFPU(pVM, VMMGetCpu(pVM));
     469    int rc = CPUMHandleLazyFPU(pVM, VMMGetCpu(pVM));
     470    Log6(("TRPMGC07: %Rrc (%04x:%08x)\n", rc, pRegFrame->cs, pRegFrame->eip));
     471    return rc; /** @todo call trpmGCExitTrap! (after 2.2.0) */
    448472}
    449473
     
    462486DECLASM(int) TRPMGCTrap0bHandler(PTRPM pTrpm, PCPUMCTXCORE pRegFrame)
    463487{
    464     LogFlow(("TRPMGCTrap0bHandler: eip=%08RX32\n", pRegFrame->eip));
     488    LogFlow(("TRPMGC0b: %04x:%08x\n", pRegFrame->cs, pRegFrame->eip));
    465489    PVM pVM = TRPM2VM(pTrpm);
    466490
     
    534558             */
    535559            pTrpm->uActiveVector = ~0;
     560            Log6(("TRPMGC0b: %Rrc (%04x:%08x) (CG)\n", VINF_EM_RAW_RING_SWITCH, pRegFrame->cs, pRegFrame->eip));
    536561            return VINF_EM_RAW_RING_SWITCH;
    537562        }
     
    541566     * Pass trap 0b as is to the recompiler in all other cases.
    542567     */
     568    Log6(("TRPMGC0b: %Rrc (%04x:%08x)\n", VINF_EM_RAW_GUEST_TRAP, pRegFrame->cs, pRegFrame->eip));
    543569    return VINF_EM_RAW_GUEST_TRAP;
    544570}
     
    885911DECLASM(int) TRPMGCTrap0dHandler(PTRPM pTrpm, PCPUMCTXCORE pRegFrame)
    886912{
    887     LogFlow(("TRPMGCTrap0dHandler: eip=%08RX32\n", pRegFrame->eip));
     913    LogFlow(("TRPMGC0d: %04x:%08x err=%x\n", pRegFrame->cs, pRegFrame->eip, (uint32_t)pTrpm->uActiveErrorCode));
    888914    PVM pVM = TRPM2VM(pTrpm);
    889915
     
    920946            break;
    921947        }
     948    Log6(("TRPMGC0d: %Rrc (%04x:%08x)\n", rc, pRegFrame->cs, pRegFrame->eip));
    922949    return rc;
    923950}
     
    940967DECLASM(int) TRPMGCTrap0eHandler(PTRPM pTrpm, PCPUMCTXCORE pRegFrame)
    941968{
    942     LogBird(("TRPMGCTrap0eHandler: eip=%08RX32\n", pRegFrame->eip));
     969    LogFlow(("TRPMGC0e: %04x:%08x err=%x cr2=%08x\n", pRegFrame->cs, pRegFrame->eip, (uint32_t)pTrpm->uActiveErrorCode, (uint32_t)pTrpm->uActiveCR2));
    943970    PVM pVM = TRPM2VM(pTrpm);
    944971
     972
    945973    /*
    946974     * This is all PGM stuff.
    947975     */
    948976    int rc = PGMTrap0eHandler(pVM, pTrpm->uActiveErrorCode, pRegFrame, (RTGCPTR)pTrpm->uActiveCR2);
    949 
    950977    switch (rc)
    951978    {
     
    9891016            break;
    9901017    }
    991     return trpmGCExitTrap(pVM, rc, pRegFrame);
     1018    rc = trpmGCExitTrap(pVM, rc, pRegFrame);
     1019    Log6(("TRPMGC0e: %Rrc (%04x:%08x)\n", rc, pRegFrame->cs, pRegFrame->eip));
     1020    return rc;
    9921021}
    9931022
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