VirtualBox

Changeset 46670 in vbox for trunk/src


Ignore:
Timestamp:
Jun 19, 2013 3:46:40 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: AMD-V bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r46664 r46670  
    42374237    HMSVM_CHECK_EXIT_DUE_TO_EVENT_DELIVERY();
    42384238
    4239     /* -XXX- todo!!*/
    4240     return VERR_NOT_IMPLEMENTED;
    4241 }
    4242 
     4239    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitGuestDB);
     4240
     4241    /* This can be a fault-type #DB (instruction breakpoint) or a trap-type #DB (data breakpoint). However, for both cases
     4242       DR6 and DR7 are updated to what the exception handler expects. See AMD spec. 15.12.2 "#DB (Debug)". */
     4243    PVM pVM = pVCpu->CTX_SUFF(pVM);
     4244    rc = DBGFRZTrap01Handler(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), pCtx->dr[6]);
     4245    if (rc == VINF_EM_RAW_GUEST_TRAP)
     4246    {
     4247        /* X86_DR7_GD will be cleared if DRx accesses should be trapped inside the guest. */
     4248        pCtx->dr[7] &= ~X86_DR7_GD;
     4249
     4250        /* Paranoia. */
     4251        pCtx->dr[7] &= 0xffffffff;                                              /* Upper 32 bits MBZ. */
     4252        pCtx->dr[7] &= ~(RT_BIT(11) | RT_BIT(12) | RT_BIT(14) | RT_BIT(15));    /* MBZ. */
     4253        pCtx->dr[7] |= 0x400;                                                   /* MB1. */
     4254
     4255        PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb;
     4256        pVmcb->ctrl.u64VmcbCleanBits &= ~HMSVM_VMCB_CLEAN_DRX;
     4257
     4258        /* Reflect the exception back to the guest. */
     4259        SVMEVENT Event;
     4260        Event.u          = 0;
     4261        Event.n.u1Valid  = 1;
     4262        Event.n.u3Type   = SVM_EVENT_EXCEPTION;
     4263        Event.n.u8Vector = X86_XCPT_DB;
     4264        hmR0SvmSetPendingEvent(pVCpu, &Event, 0 /* GCPtrFaultAddress */);
     4265        rc = VINF_SUCCESS;
     4266    }
     4267
     4268    return rc;
     4269}
     4270
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