VirtualBox

Changeset 77902 in vbox


Ignore:
Timestamp:
Mar 27, 2019 8:49:11 AM (6 years ago)
Author:
vboxsync
Message:

VMM: Fix HMSvmEventToTrpmEventType to convert #BP and #OF to TRPM_SOFTWARE_INT.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/hm.h

    r76993 r77902  
    166166 * in CPUM.
    167167 * @{ */
    168 VMM_INT_DECL(TRPMEVENT)         HMSvmEventToTrpmEventType(PCSVMEVENT pSvmEvent);
     168VMM_INT_DECL(TRPMEVENT)         HMSvmEventToTrpmEventType(PCSVMEVENT pSvmEvent, uint8_t uVector);
    169169/** @} */
    170170
  • trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp

    r77714 r77902  
    437437 *
    438438 * @param   pEvent       Pointer to the SVM event.
    439  */
    440 VMM_INT_DECL(TRPMEVENT) HMSvmEventToTrpmEventType(PCSVMEVENT pEvent)
     439 * @param   uVector      The vector associated with the event.
     440 */
     441VMM_INT_DECL(TRPMEVENT) HMSvmEventToTrpmEventType(PCSVMEVENT pEvent, uint8_t uVector)
    441442{
    442443    uint8_t const uType = pEvent->n.u3Type;
     
    445446        case SVM_EVENT_EXTERNAL_IRQ:    return TRPM_HARDWARE_INT;
    446447        case SVM_EVENT_SOFTWARE_INT:    return TRPM_SOFTWARE_INT;
     448        case SVM_EVENT_NMI:             return TRPM_TRAP;
    447449        case SVM_EVENT_EXCEPTION:
    448         case SVM_EVENT_NMI:             return TRPM_TRAP;
     450        {
     451            if (   uVector == X86_XCPT_BP
     452                || uVector == X86_XCPT_OF)
     453                return TRPM_SOFTWARE_INT;
     454            return TRPM_TRAP;
     455        }
    449456        default:
    450457            break;
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h

    r76993 r77902  
    769769        {
    770770            uint8_t   const uVector    = pEventInject->n.u8Vector;
    771             TRPMEVENT const enmType    = HMSvmEventToTrpmEventType(pEventInject);
     771            TRPMEVENT const enmType    = HMSvmEventToTrpmEventType(pEventInject, uVector);
    772772            uint16_t  const uErrorCode = pEventInject->n.u1ErrorCodeValid ? pEventInject->n.u32ErrorCode : 0;
    773773
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r77281 r77902  
    35873587    uint8_t   uVector     = Event.n.u8Vector;
    35883588    uint8_t   uVectorType = Event.n.u3Type;
    3589     TRPMEVENT enmTrapType = HMSvmEventToTrpmEventType(&Event);
     3589    TRPMEVENT enmTrapType = HMSvmEventToTrpmEventType(&Event, uVector);
    35903590
    35913591    Log4(("HM event->TRPM: uVector=%#x enmTrapType=%d\n", uVector, uVectorType));
     
    35973597        TRPMSetErrorCode(pVCpu, Event.n.u32ErrorCode);
    35983598
    3599     if (   uVectorType == SVM_EVENT_EXCEPTION
     3599    if (   enmTrapType == TRPM_TRAP
    36003600        && uVector     == X86_XCPT_PF)
    36013601    {
     
    36033603        Assert(pVCpu->hm.s.Event.GCPtrFaultAddress == CPUMGetGuestCR2(pVCpu));
    36043604    }
    3605     else if (uVectorType == SVM_EVENT_SOFTWARE_INT)
    3606     {
    3607         AssertMsg(   uVectorType == SVM_EVENT_SOFTWARE_INT
    3608                   || (uVector == X86_XCPT_BP || uVector == X86_XCPT_OF),
    3609                   ("Invalid vector: uVector=%#x uVectorType=%#x\n", uVector, uVectorType));
     3605    else if (enmTrapType == TRPM_SOFTWARE_INT)
    36103606        TRPMSetInstrLength(pVCpu, pVCpu->hm.s.Event.cbInstr);
    3611     }
    36123607    pVCpu->hm.s.Event.fPending = false;
    36133608}
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