VirtualBox

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


Ignore:
Timestamp:
Jun 27, 2013 11:18:49 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86773
Message:

VMM/HMSVMR0: AMD-V bits.

File:
1 edited

Legend:

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

    r46808 r46827  
    670670        pVmcb->ctrl.IntCtrl.n.u1VIrqMasking = 1;
    671671
    672         /* Ignore the priority in the TPR; we take into account the guest TPR anyway while delivering interrupts. */
     672        /* Ignore the priority in the TPR. This is necessary for delivering PIC style (ExtInt) interrupts and we currently
     673           deliver both PIC and APIC interrupts alike. See hmR0SvmInjectPendingEvent() */
    673674        pVmcb->ctrl.IntCtrl.n.u1IgnoreTPR   = 1;
    674675
     
    680681        pVmcb->ctrl.u64LBRVirt = 0;
    681682
    682         /* Initially set all VMCB clean bits to 0 indicating that everything should be loaded from memory. */
     683        /* Initially set all VMCB clean bits to 0 indicating that everything should be loaded from the VMCB in memory. */
    683684        pVmcb->ctrl.u64VmcbCleanBits = 0;
    684685
    685         /* The guest ASID MBNZ, set it to 1. The host uses 0. */
     686        /* The host ASID MBZ, for the guest start with 1. */
    686687        pVmcb->ctrl.TLBCtrl.n.u32ASID = 1;
    687688
     
    21552156        pVmcb->ctrl.u64VmcbCleanBits &= ~(HMSVM_VMCB_CLEAN_INTERCEPTS | HMSVM_VMCB_CLEAN_TPR);
    21562157
    2157         Log4(("Setting virtual interrupt intercept\n"));
     2158        Log4(("Setting virtual interrupt pending intercept\n"));
    21582159    }
    21592160}
     
    21722173
    21732174    const bool fIntShadow = !!hmR0SvmGetGuestIntrShadow(pVCpu, pCtx);
     2175    const bool fBlockInt  = !(pCtx->eflags.u32 & X86_EFL_IF);
    21742176    PSVMVMCB pVmcb        = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb;
    21752177
     
    21812183        Assert(Event.n.u1Valid);
    21822184        bool fInject = true;
    2183         if (   fIntShadow
    2184             && (   Event.n.u3Type == SVM_EVENT_EXTERNAL_IRQ
    2185                 || Event.n.u3Type == SVM_EVENT_NMI))
     2185        if (   Event.n.u3Type == SVM_EVENT_EXTERNAL_IRQ
     2186            && (   fBlockInt
     2187                || fIntShadow))
     2188        {
     2189            fInject = false;
     2190        }
     2191        else if (   Event.n.u3Type == SVM_EVENT_NMI
     2192                 && fIntShadow)
    21862193        {
    21872194            fInject = false;
     
    21952202        else
    21962203            hmR0SvmSetVirtIntrIntercept(pVmcb);
    2197     }                                                          /** @todo SMI. SMIs take priority over NMIs. */
     2204    }                                                              /** @todo SMI. SMIs take priority over NMIs. */
    21982205    else if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_NMI))   /* NMI. NMIs take priority over regular interrupts . */
    21992206    {
     
    22152222    {
    22162223        /* Check if there are guest external interrupts (PIC/APIC) pending and inject them, if the guest can receive them. */
    2217         const bool fBlockInt = !(pCtx->eflags.u32 & X86_EFL_IF);
    22182224        if (   !fBlockInt
    22192225            && !fIntShadow)
     
    25912597        || HMR0GetCurrentCpu()->idCpu != pVCpu->hm.s.idLastCpu)
    25922598    {
     2599        hmR0SvmUpdateTscOffsetting(pVCpu);
    25932600        pSvmTransient->fUpdateTscOffsetting = false;
    2594         hmR0SvmUpdateTscOffsetting(pVCpu);
    25952601    }
    25962602
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