VirtualBox

Changeset 14109 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 11, 2008 7:39:53 PM (16 years ago)
Author:
vboxsync
Message:

Implemented NMI injection.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCM.cpp

    r14106 r14109  
    10851085VMMR3DECL(int)  HWACCMR3InjectNMI(PVM pVM)
    10861086{
     1087    pVM->hwaccm.s.fInjectNMI = true;
    10871088    return VINF_SUCCESS;
    10881089}
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r13912 r14109  
    186186    bool                        fAllowNestedPaging;
    187187
     188    /** Set if we're supposed to inject an NMI. */
     189    bool                        fInjectNMI;
     190
    188191    /** Explicit alignment padding to make 32-bit gcc align u64RegisterMask
    189192     *  naturally. */
    190     bool                        padding[2];
     193    bool                        padding[1];
    191194
    192195    /** And mask for copying register contents. */
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r13960 r14109  
    413413    }
    414414
     415    if (pVM->hwaccm.s.fInjectNMI)
     416    {
     417        SVM_EVENT Event;
     418
     419        Event.n.u8Vector     = X86_XCPT_NMI;
     420        Event.n.u1Valid      = 1;
     421        Event.n.u32ErrorCode = 0;
     422        Event.n.u3Type       = SVM_EVENT_NMI;
     423
     424        SVMR0InjectEvent(pVM, pVMCB, pCtx, &Event);
     425        pVM->hwaccm.s.fInjectNMI = false;
     426        return VINF_SUCCESS;
     427    }
     428
    415429    /* When external interrupts are pending, we should exit the VM when IF is set. */
    416430    if (    !TRPMHasTrap(pVM)
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r14091 r14109  
    662662
    663663        pVCpu->hwaccm.s.Event.fPending = false;
     664        return VINF_SUCCESS;
     665    }
     666
     667    if (pVM->hwaccm.s.fInjectNMI)
     668    {
     669        RTGCUINTPTR intInfo;
     670
     671        intInfo  = X86_XCPT_NMI;
     672        intInfo |= (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT);
     673        intInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_NMI << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT);
     674
     675        rc = VMXR0InjectEvent(pVM, pVCpu, pCtx, intInfo, 0, errCode);
     676        AssertRC(rc);
     677
     678        pVM->hwaccm.s.fInjectNMI = false;
    664679        return VINF_SUCCESS;
    665680    }
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