VirtualBox

Changeset 42463 in vbox for trunk


Ignore:
Timestamp:
Jul 30, 2012 10:39:27 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79604
Message:

TRPMForwardTrap: Don't clobber CR2, only set it when dispatching a #PF!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp

    r42186 r42463  
    375375
    376376    switch (iGate) {
    377     case 14:
     377    case X86_XCPT_PF:
    378378        if (pRegFrame->eip == pVCpu->trpm.s.uActiveCR2)
    379379        {
    380             int rc;
    381380            RTGCPTR pCallerGC;
    382381#  ifdef IN_RC
    383             rc = MMGCRamRead(pVM, &pCallerGC, (void *)pRegFrame->esp, sizeof(pCallerGC));
     382            int rc = MMGCRamRead(pVM, &pCallerGC, (void *)pRegFrame->esp, sizeof(pCallerGC));
    384383#  else
    385             rc = PGMPhysSimpleReadGCPtr(pVCpu, &pCallerGC, (RTGCPTR)pRegFrame->esp, sizeof(pCallerGC));
     384            int rc = PGMPhysSimpleReadGCPtr(pVCpu, &pCallerGC, (RTGCPTR)pRegFrame->esp, sizeof(pCallerGC));
    386385#  endif
    387386            if (RT_SUCCESS(rc))
     
    389388        }
    390389        /* no break */
    391     case 8:
    392     case 10:
    393     case 11:
    394     case 12:
    395     case 13:
    396     case 17:
     390    case X86_XCPT_DF:
     391    case X86_XCPT_TS:
     392    case X86_XCPT_NP:
     393    case X86_XCPT_SS:
     394    case X86_XCPT_GP:
     395    case X86_XCPT_AC:
    397396        Assert(enmError == TRPM_TRAP_HAS_ERRORCODE || enmType == TRPM_SOFTWARE_INT);
    398397        break;
     
    674673
    675674                    /* Make sure the internal guest context structure is up-to-date. */
    676                     CPUMSetGuestCR2(pVCpu, pVCpu->trpm.s.uActiveCR2);
     675                    if (iGate == X86_XCPT_PF)
     676                        CPUMSetGuestCR2(pVCpu, pVCpu->trpm.s.uActiveCR2);
    677677
    678678#ifdef IN_RC
    679                     /* Note: shouldn't be necessary */
    680                     ASMSetCR2(pVCpu->trpm.s.uActiveCR2);
    681 
    682679                    /* Turn off interrupts for interrupt gates. */
    683680                    if (GuestIdte.Gen.u5Type2 == VBOX_IDTE_TYPE2_INT_32)
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