VirtualBox

Changeset 103194 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Feb 5, 2024 7:23:40 AM (12 months ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:10318 Distinguish NMI vs. hardware exception 2 in TRPM (VMX and SVM have always made this subtle distinction).

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r102977 r103194  
    18501850# endif
    18511851                    {
    1852                         rc2 = TRPMAssertTrap(pVCpu, X86_XCPT_NMI, TRPM_TRAP);
     1852                        rc2 = TRPMAssertTrap(pVCpu, X86_XCPT_NMI, TRPM_NMI);
    18531853                        if (rc2 == VINF_SUCCESS)
    18541854                        {
  • trunk/src/VBox/VMM/VMMR3/TRPM.cpp

    r100140 r103194  
    114114*********************************************************************************************************************************/
    115115/** TRPM saved state version. */
    116 #define TRPM_SAVED_STATE_VERSION                10
     116#define TRPM_SAVED_STATE_VERSION                11
     117#define TRPM_SAVED_STATE_VERSION_PRE_NMI        10  /* NMI TRPM event type bumped the version */
    117118#define TRPM_SAVED_STATE_VERSION_PRE_ICEBP      9   /* INT1/ICEBP support bumped the version */
    118119#define TRPM_SAVED_STATE_VERSION_UNI            8   /* SMP support bumped the version */
     
    283284     */
    284285    if (    uVersion != TRPM_SAVED_STATE_VERSION
     286        &&  uVersion != TRPM_SAVED_STATE_VERSION_PRE_NMI
    285287        &&  uVersion != TRPM_SAVED_STATE_VERSION_PRE_ICEBP
    286288        &&  uVersion != TRPM_SAVED_STATE_VERSION_UNI)
     
    290292    }
    291293
    292     if (uVersion == TRPM_SAVED_STATE_VERSION)
     294    if (uVersion >= TRPM_SAVED_STATE_VERSION_PRE_NMI)
    293295    {
    294296        for (VMCPUID i = 0; i < pVM->cCpus; i++)
     
    350352         */
    351353        SSMR3SkipToEndOfUnit(pSSM);
     354    }
     355
     356    /*
     357     * For saved-state verions prior to introducing NMI as a separate type, convert
     358     * traps with vector 2 as NMI since the rest of VirtualBox code now expects this.
     359     */
     360    if (uVersion <= TRPM_SAVED_STATE_VERSION_PRE_NMI)
     361    {
     362        for (VMCPUID i = 0; i < pVM->cCpus; i++)
     363        {
     364            PTRPMCPU pTrpmCpu = &pVM->apCpusR3[i]->trpm.s;
     365            AssertLogRelMsgReturn(pTrpmCpu->enmActiveType != TRPM_NMI,
     366                                  ("TRPM event type (%#RX32) invalid for saved-state version %u!",
     367                                   pTrpmCpu->enmActiveType, uVersion), VERR_SSM_ENUM_VALUE_OUT_OF_RANGE);
     368            if (   pTrpmCpu->uActiveVector == X86_XCPT_NMI
     369                && pTrpmCpu->enmActiveType == TRPM_TRAP)
     370                pTrpmCpu->enmActiveType = TRPM_NMI;
     371        }
    352372    }
    353373
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