VirtualBox

Changeset 48284 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Sep 5, 2013 12:32:23 AM (11 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Avoid calling PGM twice for reading just 4 consecutive bytes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r48262 r48284  
    68016801
    68026802            /* Check if the interrupt handler is present in the IVT (real-mode IDT). IDT limit is (4N - 1). */
    6803             const size_t cbIdtEntry = 4;
     6803            const size_t cbIdtEntry = sizeof(X86IDTR16);
    68046804            if (uVector * cbIdtEntry + (cbIdtEntry - 1) > pMixedCtx->idtr.cbIdt)
    68056805            {
     
    68306830
    68316831            /* Get the code segment selector and offset from the IDT entry for the interrupt handler. */
    6832             uint16_t offIdtEntry    = 0;
    6833             RTSEL    selIdtEntry    = 0;
     6832            X86IDTR16 IdtEntry;
    68346833            RTGCPHYS GCPhysIdtEntry = (RTGCPHYS)pMixedCtx->idtr.pIdt + uVector * cbIdtEntry;
    6835             rc  = PGMPhysSimpleReadGCPhys(pVM, &offIdtEntry, GCPhysIdtEntry,     sizeof(offIdtEntry));
    6836             rc |= PGMPhysSimpleReadGCPhys(pVM, &selIdtEntry, GCPhysIdtEntry + 2, sizeof(selIdtEntry));
     6834            rc = PGMPhysSimpleReadGCPhys(pVM, &IdtEntry, GCPhysIdtEntry, cbIdtEntry);
    68376835            AssertRCReturn(rc, rc);
    68386836
     
    68476845            {
    68486846                pMixedCtx->eflags.u32 &= ~(X86_EFL_IF | X86_EFL_TF | X86_EFL_RF | X86_EFL_AC);
    6849                 pMixedCtx->rip         = offIdtEntry;
    6850                 pMixedCtx->cs.Sel      = selIdtEntry;
    6851                 pMixedCtx->cs.u64Base  = selIdtEntry << cbIdtEntry;
     6847                pMixedCtx->rip         = IdtEntry.offSel;
     6848                pMixedCtx->cs.Sel      = IdtEntry.uSel;
     6849                pMixedCtx->cs.u64Base  = IdtEntry.uSel << cbIdtEntry;
    68526850                if (   uIntrType == VMX_EXIT_INTERRUPTION_INFO_TYPE_HW_XCPT
    68536851                    && uVector   == X86_XCPT_PF)
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