VirtualBox

Changeset 45387 in vbox


Ignore:
Timestamp:
Apr 5, 2013 9:37:40 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84812
Message:

VMM/VMMR0: HM bits.

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

Legend:

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

    r45384 r45387  
    376376
    377377/**
    378  * Disables longjmps to ring-3.
    379  * @param   pVCpu       Pointer to the VMCPU.
    380  */
    381 DECLINLINE(void) hmR0VmxCallRing3Disable(PVMCPU pVCpu)
    382 {
    383     while (VMMRZCallRing3IsEnabled(pVCpu))
    384         VMMRZCallRing3Disable(pVCpu);
    385     Assert(VMMR0IsLogFlushDisabled(pVCpu));
    386 }
    387 
    388 
    389 /**
    390  * Enables longjmps to ring-3.
    391  * @param   pVCpu       Pointer to the VMCPU.
    392  */
    393 DECLINLINE(void) hmR0VmxCallRing3Enable(PVMCPU pVCpu)
    394 {
    395     while (!VMMRZCallRing3IsEnabled(pVCpu))
    396         VMMRZCallRing3Enable(pVCpu);
    397     Assert(!VMMR0IsLogFlushDisabled(pVCpu));
    398 }
    399 
    400 
    401 /**
    402378 * Updates the VM's last error record. If there was a VMX instruction error,
    403379 * reads the error data from the VMCS and updates VCPU's last error record as
     
    63386314    {
    63396315        ASMSetFlags(pVmxTransient->uEFlags);
    6340         STAM_COUNTER_INC(&pVCpu->hm.s.StatExitPreemptPending);
     6316        STAM_COUNTER_INC(&pVCpu->hm.s.StatPendingHostIrq);
    63416317        /* Don't use VINF_EM_RAW_INTERRUPT_HYPER as we can't assume the host does kernel preemption. Maybe some day? */
    63426318        return VINF_EM_RAW_INTERRUPT;
     
    63746350{
    63756351    Assert(!VMMRZCallRing3IsEnabled(pVCpu));
     6352    Assert(VMMR0IsLogFlushDisabled(pVCpu));
    63766353
    63776354#ifndef VBOX_WITH_VMMR0_DISABLE_PREEMPTION
     
    64866463
    64876464    VMMRZCallRing3SetNotification(pVCpu, hmR0VmxCallRing3Callback, pMixedCtx);
    6488     hmR0VmxCallRing3Enable(pVCpu);                              /* It is now safe to do longjmps to ring-3!!! */
     6465    VMMRZCallRing3Enable(pVCpu);                                /* It is now safe to do longjmps to ring-3!!! */
    64896466
    64906467    /* If the VMLAUNCH/VMRESUME failed, we can bail out early. This does -not- cover VMX_EXIT_ERR_*. */
     
    65546531         * This also disables flushing of the R0-logger instance (if any).
    65556532         */
    6556         hmR0VmxCallRing3Disable(pVCpu);
     6533        VMMRZCallRing3Disable(pVCpu);
    65576534        VMMRZCallRing3RemoveNotification(pVCpu);
    65586535        hmR0VmxPreRunGuestCommitted(pVM, pVCpu, pCtx, &VmxTransient);
     
    66416618{
    66426619    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
    6643     STAM_COUNTER_INC(&pVCpu->hm.s.StatPendingHostIrq);
     6620    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitExtInt);
    66446621    return VINF_SUCCESS;
    66456622}
     
    66556632    AssertRCReturn(rc, rc);
    66566633
    6657     uint8_t u8IntrType = VMX_EXIT_INTERRUPTION_INFO_TYPE(pVmxTransient->uExitIntrInfo);
     6634    uint32_t uIntrType = VMX_EXIT_INTERRUPTION_INFO_TYPE(pVmxTransient->uExitIntrInfo);
    66586635    Assert(   !(pVCpu->hm.s.vmx.u32ExitCtls & VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXT_INT)
    6659            && u8IntrType != VMX_EXIT_INTERRUPTION_INFO_TYPE_EXT_INT);
    6660 
    6661     if (u8IntrType == VMX_EXIT_INTERRUPTION_INFO_TYPE_NMI)
     6636           && uIntrType != VMX_EXIT_INTERRUPTION_INFO_TYPE_EXT_INT);
     6637
     6638    if (uIntrType == VMX_EXIT_INTERRUPTION_INFO_TYPE_NMI)
    66626639        return VINF_EM_RAW_INTERRUPT;
    6663 
    6664     uint32_t uExitIntrInfo = pVmxTransient->uExitIntrInfo;
    6665     Assert(VMX_EXIT_INTERRUPTION_INFO_VALID(uExitIntrInfo));
    66666640
    66676641    /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */
     
    66726646        return rc;
    66736647
    6674     uint32_t uVector = VMX_EXIT_INTERRUPTION_INFO_VECTOR(uExitIntrInfo);
    6675     switch (VMX_EXIT_INTERRUPTION_INFO_TYPE(uExitIntrInfo))
     6648    uint32_t uExitIntrInfo = pVmxTransient->uExitIntrInfo;
     6649    uint32_t uVector       = VMX_EXIT_INTERRUPTION_INFO_VECTOR(uExitIntrInfo);
     6650    switch (uIntrType)
    66766651    {
    66776652        case VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_XCPT:   /* Software exception. (#BP or #OF) */
     
    67106685                        Assert(pVM->hm.s.vmx.pRealModeTSS);
    67116686                        Assert(PDMVmmDevHeapIsEnabled(pVM));
    6712                         rc     = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    6713                         rc    |= hmR0VmxReadExitIntrErrorCodeVmcs(pVmxTransient);
     6687                        rc  = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
     6688                        rc |= hmR0VmxReadExitIntrErrorCodeVmcs(pVmxTransient);
    67146689                        AssertRCReturn(rc, rc);
    67156690                        rc = hmR0VmxInjectEventVmcs(pVM, pVCpu, pMixedCtx,
     
    75087483        case VMX_EXIT_QUALIFICATION_CRX_ACCESS_WRITE:       /* MOV to CRx */
    75097484        {
     7485#if 0
    75107486            /* EMInterpretCRxWrite() references a lot of guest state (EFER, RFLAGS, Segment Registers, etc.) Sync entire state */
    75117487            rc = hmR0VmxSaveGuestState(pVM, pVCpu, pMixedCtx);
     7488#else
     7489            rc  = hmR0VmxSaveGuestGprs(pVM, pVCpu, pMixedCtx);
     7490            rc |= hmR0VmxSaveGuestControlRegs(pVM, pVCpu, pMixedCtx);
     7491            rc |= hmR0VmxSaveGuestSegmentRegs(pVM, pVCpu, pMixedCtx);
     7492#endif
    75127493            AssertRCReturn(rc, rc);
    75137494
     
    75527533        {
    75537534            /* EMInterpretCRxRead() requires EFER MSR, CS. */
    7554             rc |= hmR0VmxSaveGuestSegmentRegs(pVM, pVCpu, pMixedCtx);
     7535            rc = hmR0VmxSaveGuestSegmentRegs(pVM, pVCpu, pMixedCtx);
    75557536            AssertRCReturn(rc, rc);
    75567537            Assert(   !pVM->hm.s.fNestedPaging
     
    75767557            rc |= EMInterpretCLTS(pVM, pVCpu);
    75777558            AssertRCReturn(rc, rc);
    7578             if (RT_LIKELY(rc == VINF_SUCCESS))
    7579                 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0;
     7559            pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0;
    75807560            STAM_COUNTER_INC(&pVCpu->hm.s.StatExitClts);
    75817561            Log(("CRX CLTS write rc=%d\n", rc));
     
    75867566        {
    75877567            rc  = hmR0VmxSaveGuestCR0(pVM, pVCpu, pMixedCtx);
    7588             rc |= EMInterpretLMSW(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), VMX_EXIT_QUALIFICATION_CRX_LMSW_DATA(uExitQualification));
    75897568            AssertRCReturn(rc, rc);
     7569            rc = EMInterpretLMSW(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), VMX_EXIT_QUALIFICATION_CRX_LMSW_DATA(uExitQualification));
    75907570            if (RT_LIKELY(rc == VINF_SUCCESS))
    75917571                pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0;
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r45305 r45387  
    13761376    if (RTThreadPreemptIsPending(NIL_RTTHREAD))
    13771377    {
    1378         STAM_COUNTER_INC(&pVCpu->hm.s.StatExitPreemptPending);
     1378        STAM_COUNTER_INC(&pVCpu->hm.s.StatPendingHostIrq);
    13791379        rc = VINF_EM_RAW_INTERRUPT;
    13801380        goto end;
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r45378 r45387  
    31503150    if (RTThreadPreemptIsPending(NIL_RTTHREAD))
    31513151    {
    3152         STAM_COUNTER_INC(&pVCpu->hm.s.StatExitPreemptPending);
     3152        STAM_COUNTER_INC(&pVCpu->hm.s.StatPendingHostIrq);
    31533153        rc = VINF_EM_RAW_INTERRUPT;
    31543154        goto end;
     
    35273527            Assert(exitReason == VMX_EXIT_EXT_INT);
    35283528            /* External interrupt; leave to allow it to be dispatched again. */
     3529            STAM_COUNTER_INC(&pVCpu->hm.s.StatExitExtInt);
    35293530            rc = VINF_EM_RAW_INTERRUPT;
    35303531            break;
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r45378 r45387  
    576576        HM_REG_COUNTER(&pVCpu->hm.s.StatExitIntWindow,          "/HM/CPU%d/Exit/IntWindow");
    577577        HM_REG_COUNTER(&pVCpu->hm.s.StatExitMaxResume,          "/HM/CPU%d/Exit/MaxResume");
    578         HM_REG_COUNTER(&pVCpu->hm.s.StatExitPreemptPending,     "/HM/CPU%d/Exit/PreemptPending");
     578        HM_REG_COUNTER(&pVCpu->hm.s.StatExitExtInt,             "/HM/CPU%d/Exit/ExtInt");
    579579        HM_REG_COUNTER(&pVCpu->hm.s.StatExitPreemptTimer,       "/HM/CPU%d/Exit/PreemptTimer");
    580580        HM_REG_COUNTER(&pVCpu->hm.s.StatExitTprBelowThreshold,  "/HM/CPU%d/Exit/TprBelowThreshold");
  • trunk/src/VBox/VMM/include/HMInternal.h

    r45378 r45387  
    854854    STAMCOUNTER             StatExitIntWindow;
    855855    STAMCOUNTER             StatExitMaxResume;
    856     STAMCOUNTER             StatExitPreemptPending;
     856    STAMCOUNTER             StatExitExtInt;
    857857    STAMCOUNTER             StatExitPreemptTimer;
    858858    STAMCOUNTER             StatExitTprBelowThreshold;
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