VirtualBox

Changeset 47714 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 13, 2013 11:43:24 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87953
Message:

CPUMRecalcHyperDRx: Host single stepping in HM-mode fix.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r47706 r47714  
    21572157{
    21582158    pVCpu->cpum.s.Guest.dr[0] = uDr0;
    2159     return CPUMRecalcHyperDRx(pVCpu, 0);
     2159    return CPUMRecalcHyperDRx(pVCpu, 0, false);
    21602160}
    21612161
     
    21642164{
    21652165    pVCpu->cpum.s.Guest.dr[1] = uDr1;
    2166     return CPUMRecalcHyperDRx(pVCpu, 1);
     2166    return CPUMRecalcHyperDRx(pVCpu, 1, false);
    21672167}
    21682168
     
    21712171{
    21722172    pVCpu->cpum.s.Guest.dr[2] = uDr2;
    2173     return CPUMRecalcHyperDRx(pVCpu, 2);
     2173    return CPUMRecalcHyperDRx(pVCpu, 2, false);
    21742174}
    21752175
     
    21782178{
    21792179    pVCpu->cpum.s.Guest.dr[3] = uDr3;
    2180     return CPUMRecalcHyperDRx(pVCpu, 3);
     2180    return CPUMRecalcHyperDRx(pVCpu, 3, false);
    21812181}
    21822182
     
    21922192{
    21932193    pVCpu->cpum.s.Guest.dr[7] = uDr7;
    2194     return CPUMRecalcHyperDRx(pVCpu, 7);
     2194    return CPUMRecalcHyperDRx(pVCpu, 7, false);
    21952195}
    21962196
     
    22032203        iReg += 2;
    22042204    pVCpu->cpum.s.Guest.dr[iReg] = Value;
    2205     return CPUMRecalcHyperDRx(pVCpu, iReg);
     2205    return CPUMRecalcHyperDRx(pVCpu, iReg, false);
    22062206}
    22072207
     
    22342234 * @param   iGstReg     The guest debug register number that was modified.
    22352235 *                      UINT8_MAX if not guest register.
    2236  */
    2237 VMMDECL(int) CPUMRecalcHyperDRx(PVMCPU pVCpu, uint8_t iGstReg)
     2236 * @param   fForceHyper Used in HM to force hyper registers because of single
     2237 *                      stepping.
     2238 */
     2239VMMDECL(int) CPUMRecalcHyperDRx(PVMCPU pVCpu, uint8_t iGstReg, bool fForceHyper)
    22382240{
    22392241    PVM pVM = pVCpu->CTX_SUFF(pVM);
     
    22562258
    22572259    const RTGCUINTREG uDbgfDr7 = DBGFBpGetDR7(pVM);
    2258     if ((HMIsEnabled(pVCpu->CTX_SUFF(pVM)) ? uDbgfDr7 : (uGstDr7 | uDbgfDr7)) & X86_DR7_ENABLED_MASK)
     2260
     2261#ifdef IN_RING0
     2262    if (!fForceHyper && (pVCpu->cpum.s.fUseFlags & CPUM_USED_DEBUG_REGS_HYPER))
     2263        fForceHyper = true;
     2264#endif
     2265    if (( HMIsEnabled(pVCpu->CTX_SUFF(pVM)) && !fForceHyper ? uDbgfDr7 : (uGstDr7 | uDbgfDr7)) & X86_DR7_ENABLED_MASK)
    22592266    {
    22602267        Assert(!CPUMIsGuestDebugStateActive(pVCpu));
     
    24262433         * No active debug state any more.  In raw-mode this means we have to
    24272434         * make sure DR7 has everything disabled now, if we armed it already.
    2428          *
    2429          * In the ring-0 this only happens when we decided to lazy load the
    2430          * debug state because it wasn't active, and that didn't change with
    2431          * the latest changes, so nothing to do here.
     2435         * In ring-0 we might end up here when just single stepping.
    24322436         */
    2433 #if defined(IN_RC)
     2437#if defined(IN_RC) || defined(IN_RING0)
    24342438        if (pVCpu->cpum.s.fUseFlags & CPUM_USED_DEBUG_REGS_HYPER)
    24352439        {
     2440# ifdef IN_RC
    24362441            ASMSetDR7(X86_DR7_INIT_VAL);
     2442# endif
    24372443            if (pVCpu->cpum.s.Hyper.dr[0])
    24382444                ASMSetDR0(0);
     
    24452451            pVCpu->cpum.s.fUseFlags &= ~CPUM_USED_DEBUG_REGS_HYPER;
    24462452        }
    2447 
    2448 #elif defined(IN_RING0)
    2449         Assert(!CPUMIsHyperDebugStateActive(pVCpu)); /* (can only change while in ring-3) */
    24502453#endif
    24512454        pVCpu->cpum.s.fUseFlags &= ~CPUM_USE_DEBUG_REGS_HYPER;
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r47700 r47714  
    14131413    /* Recheck the guest DRx values in raw-mode. */
    14141414    for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++)
    1415         CPUMRecalcHyperDRx(&pVM->aCpus[iCpu], UINT8_MAX);
     1415        CPUMRecalcHyperDRx(&pVM->aCpus[iCpu], UINT8_MAX, false);
    14161416}
    14171417
  • trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp

    r47660 r47714  
    566566{
    567567    NOREF(pVM); NOREF(pvUser);
    568     return CPUMRecalcHyperDRx(pVCpu, UINT8_MAX);
     568    return CPUMRecalcHyperDRx(pVCpu, UINT8_MAX, false);
    569569}
    570570
Note: See TracChangeset for help on using the changeset viewer.

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