VirtualBox

Changeset 86730 in vbox for trunk/src


Ignore:
Timestamp:
Oct 28, 2020 10:44:37 AM (4 years ago)
Author:
vboxsync
Message:

VMM/DBGF: Move the DBGFRZ* part into VMMAll as the trap handlers will be required to work in Ring-3 before long to be able to support the IEM execute in Ring-3 and NEM cases, bugref:9837

Location:
trunk/src/VBox/VMM
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/Makefile.kmk

    r86699 r86730  
    506506        VMMRZ/CPUMRZ.cpp \
    507507        VMMRZ/CPUMRZA.asm \
    508         VMMRZ/DBGFRZ.cpp \
    509508        VMMRZ/VMMRZ.cpp \
    510509        VMMAll/APICAll.cpp \
     
    512511        VMMAll/CPUMAllMsrs.cpp \
    513512        VMMAll/DBGFAll.cpp \
     513        VMMAll/DBGFAllBp.cpp \
    514514        $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
    515515        VMMAll/EMAll.cpp \
  • trunk/src/VBox/VMM/VMMAll/DBGFAllBp.cpp

    r86729 r86730  
    11/* $Id$ */
    22/** @file
    3  * DBGF - Debugger Facility, RZ part.
     3 * DBGF - Debugger Facility, All Context breakpoint management part.
    44 */
    55
     
    6565    return &pBpChunk->paBpBaseSharedR0[idxEntry];
    6666}
    67 # endif
    6867
    6968
     
    7978 * @param   pBpR0       The ring-0 only breakpoint state.
    8079 */
    81 DECLINLINE(int) dbgfRZBpHit(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame,
     80DECLINLINE(int) dbgfR0BpHit(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame,
    8281                            DBGFBP hBp, PDBGFBPINT pBp, PDBGFBPINTR0 pBpR0)
    8382{
     
    103102 * @note The content of the resolved L2 table entry is not validated!.
    104103 */
    105 DECLINLINE(PCDBGFBPL2ENTRY) dbgfRZBpL2GetByIdx(PVMCC pVM, uint32_t idxL2)
     104DECLINLINE(PCDBGFBPL2ENTRY) dbgfR0BpL2GetByIdx(PVMCC pVM, uint32_t idxL2)
    106105{
    107106    uint32_t idChunk  = DBGF_BP_L2_IDX_GET_CHUNK_ID(idxL2);
     
    128127 * @param   GCPtrKey    The key to search for.
    129128 */
    130 static int dbgfRZBpL2Walk(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame,
    131                           uint32_t idxL2Root, RTGCUINTPTR GCPtrKey)
     129static int dbgfBpL2Walk(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame,
     130                        uint32_t idxL2Root, RTGCUINTPTR GCPtrKey)
    132131{
    133132    /** @todo We don't use the depth right now but abort the walking after a fixed amount of levels. */
    134133    uint8_t iDepth = 32;
    135     PCDBGFBPL2ENTRY pL2Entry = dbgfRZBpL2GetByIdx(pVM, idxL2Root);
     134    PCDBGFBPL2ENTRY pL2Entry = dbgfR0BpL2GetByIdx(pVM, idxL2Root);
    136135
    137136    while (RT_LIKELY(   iDepth-- > 0
     
    153152            if (   pBp
    154153                && DBGF_BP_PUB_GET_TYPE(pBp->Pub.fFlagsAndType) == DBGFBPTYPE_INT3)
    155                 return dbgfRZBpHit(pVM, pVCpu, pRegFrame, hBp, pBp, pBpR0);
     154                return dbgfR0BpHit(pVM, pVCpu, pRegFrame, hBp, pBp, pBpR0);
    156155
    157156            /* The entry got corrupted, just abort. */
     
    167166            return VINF_EM_RAW_GUEST_TRAP;
    168167
    169         pL2Entry = dbgfRZBpL2GetByIdx(pVM, idxL2Next);
     168        pL2Entry = dbgfR0BpL2GetByIdx(pVM, idxL2Next);
    170169    }
    171170
    172171    return VERR_DBGF_BP_L2_LOOKUP_FAILED;
    173172}
     173# endif /* !IN_RING0 */
    174174#endif /* !VBOX_WITH_LOTS_OF_DBGF_BPS */
    175175
     
    188188 * @param   fAltStepping    Alternative stepping indicator.
    189189 */
    190 VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6, bool fAltStepping)
     190VMM_INT_DECL(int) DBGFTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6, bool fAltStepping)
    191191{
    192192    /** @todo Intel docs say that X86_DR6_BS has the highest priority... */
     
    256256 * @param   pRegFrame   Pointer to the register frame for the trap.
    257257 */
    258 VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame)
     258VMM_INT_DECL(int) DBGFTrap03Handler(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame)
    259259{
    260260#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
     
    290290    }
    291291#else
     292#ifndef IN_RING0
     293# error "Todo"
     294#endif
    292295    if (pVM->dbgfr0.s.CTX_SUFF(paBpLocL1))
    293296    {
     
    317320                {
    318321                    if (pBp->Pub.u.Int3.GCPtr == (RTGCUINTPTR)GCPtrBp)
    319                         rc = dbgfRZBpHit(pVM, pVCpu, pRegFrame, hBp, pBp, pBpR0);
     322                        rc = dbgfR0BpHit(pVM, pVCpu, pRegFrame, hBp, pBp, pBpR0);
    320323                    /* else: Genuine guest trap. */
    321324                }
     
    324327            }
    325328            else if (u8Type == DBGF_BP_INT3_L1_ENTRY_TYPE_L2_IDX)
    326                 rc = dbgfRZBpL2Walk(pVM, pVCpu, pRegFrame, DBGF_BP_INT3_L1_ENTRY_GET_L2_IDX(u32L1Entry),
    327                                     DBGF_BP_INT3_L2_KEY_EXTRACT_FROM_ADDR((RTGCUINTPTR)GCPtrBp));
     329                rc = dbgfBpL2Walk(pVM, pVCpu, pRegFrame, DBGF_BP_INT3_L1_ENTRY_GET_L2_IDX(u32L1Entry),
     330                                  DBGF_BP_INT3_L2_KEY_EXTRACT_FROM_ADDR((RTGCUINTPTR)GCPtrBp));
    328331            else /* Some invalid type. */
    329332                rc = VERR_DBGF_BP_L1_LOOKUP_FAILED;
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r86186 r86730  
    74147414    PSVMVMCB pVmcb = pVCpu->hm.s.svm.pVmcb;
    74157415    PCPUMCTX pCtx  = &pVCpu->cpum.GstCtx;
    7416     int rc = DBGFRZTrap01Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx), pVmcb->guest.u64DR6, pVCpu->hm.s.fSingleInstruction);
     7416    int rc = DBGFTrap01Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx), pVmcb->guest.u64DR6, pVCpu->hm.s.fSingleInstruction);
    74177417    if (rc == VINF_EM_RAW_GUEST_TRAP)
    74187418    {
     
    74787478
    74797479    PCPUMCTX pCtx = &pVCpu->cpum.GstCtx;
    7480     int rc = DBGFRZTrap03Handler(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(pCtx));
     7480    int rc = DBGFTrap03Handler(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(pCtx));
    74817481    if (rc == VINF_EM_RAW_GUEST_TRAP)
    74827482    {
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r85974 r86730  
    1393813938
    1393913939    if (!pVmxTransient->fIsNestedGuest)
    13940         rc = DBGFRZTrap03Handler(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx));
     13940        rc = DBGFTrap03Handler(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx));
    1394113941    else
    1394213942        rc = VINF_EM_RAW_GUEST_TRAP;
     
    1399513995    if (!pVmxTransient->fIsNestedGuest)
    1399613996    {
    13997         rc = DBGFRZTrap01Handler(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(pCtx), uDR6, pVCpu->hm.s.fSingleInstruction);
     13997        rc = DBGFTrap01Handler(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(pCtx), uDR6, pVCpu->hm.s.fSingleInstruction);
    1399813998
    1399913999        /*
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