VirtualBox

Changeset 42776 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Aug 11, 2012 8:21:47 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79995
Message:

TRPMForwardTrap: Logging/Assertions.

File:
1 edited

Legend:

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

    r42463 r42776  
    402402    }
    403403# endif /* VBOX_STRICT || LOG_ENABLED */
     404#ifdef IN_RC
     405    AssertReturn(CPUMIsGuestInRawMode(pVCpu), VINF_EM_RESCHEDULE);
     406#endif
    404407
    405408    /* Retrieve the eflags including the virtualized bits. */
     
    657660                    /* Mask away dangerous flags for the trap/interrupt handler. */
    658661                    eflags.u32 &= ~(X86_EFL_TF | X86_EFL_VM | X86_EFL_RF | X86_EFL_NT);
     662
     663                    /* Turn off interrupts for interrupt gates. */
     664                    if (GuestIdte.Gen.u5Type2 == VBOX_IDTE_TYPE2_INT_32)
     665                        eflags.Bits.u1IF = 0;
     666
     667                    CPUMRawSetEFlags(pVCpu, eflags.u32);
     668
    659669#ifdef DEBUG
    660670                    for (int j = idx; j < 0; j++)
     
    670680#endif
    671681
    672                     Log(("PATM Handler %RRv Adjusted stack %08X new EFLAGS=%08X idx=%d dpl=%d cpl=%d\n", pVM->trpm.s.aGuestTrapHandler[iGate], esp_r0, eflags.u32, idx, dpl, cpl));
     682                    Log(("TRPM: PATM Handler %RRv Adjusted stack %08X new EFLAGS=%08X/%08x idx=%d dpl=%d cpl=%d\n",
     683                         pVM->trpm.s.aGuestTrapHandler[iGate], esp_r0, eflags.u32, CPUMRawGetEFlags(pVCpu), idx, dpl, cpl));
    673684
    674685                    /* Make sure the internal guest context structure is up-to-date. */
     
    677688
    678689#ifdef IN_RC
    679                     /* Turn off interrupts for interrupt gates. */
    680                     if (GuestIdte.Gen.u5Type2 == VBOX_IDTE_TYPE2_INT_32)
    681                         CPUMRawSetEFlags(pVCpu, eflags.u32 & ~X86_EFL_IF);
    682 
    683                     /* The virtualized bits must be removed again!! */
     690                    /* paranoia */
     691                    Assert(pRegFrame->eflags.Bits.u1IF == 1);
    684692                    eflags.Bits.u1IF   = 1;
     693                    Assert(pRegFrame->eflags.Bits.u2IOPL == 0);
    685694                    eflags.Bits.u2IOPL = 0;
    686695
     
    697706                    /* does not return */
    698707#else
    699                     /* Turn off interrupts for interrupt gates. */
    700                     if (GuestIdte.Gen.u5Type2 == VBOX_IDTE_TYPE2_INT_32)
    701                         eflags.Bits.u1IF = 0;
    702 
     708
     709                    Assert(!CPUMIsGuestInRawMode(pVCpu));
    703710                    pRegFrame->eflags.u32 = eflags.u32;
    704 
    705711                    pRegFrame->eip        = pVM->trpm.s.aGuestTrapHandler[iGate];
    706712                    pRegFrame->cs.Sel     = GuestIdte.Gen.u16SegSel;
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