VirtualBox

Changeset 20035 in vbox


Ignore:
Timestamp:
May 26, 2009 12:56:35 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
47767
Message:

Some updates for AMD APIC accesses

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCM.cpp

    r20026 r20035  
    307307     * Register the saved state data unit.
    308308     */
    309     int rc = SSMR3RegisterInternal(pVM, "HWACCM", 0, HWACCM_SSM_VERSION, sizeof(HWACCM),
     309    int rc = SSMR3RegisterInternal(pVM, "HWACCM", 0, HWACCM_SSM_VERSION_3_0_X, sizeof(HWACCM),
    310310                                   NULL, hwaccmR3Save, NULL,
    311311                                   NULL, hwaccmR3Load, NULL);
     
    16971697    }
    16981698
     1699    rc = SSMR3PutBool(pSSM, pVM->hwaccm.s.svm.fTPRPatching);
     1700    AssertRCReturn(rc, rc);
     1701
    16991702    return VINF_SUCCESS;
    17001703}
     
    17171720     * Validate version.
    17181721     */
    1719     if (   u32Version != HWACCM_SSM_VERSION
    1720         && u32Version != HWACCM_SSM_VERSION_2_0_X)
     1722    if (   u32Version != HWACCM_SSM_VERSION_2_2_X
     1723        && u32Version != HWACCM_SSM_VERSION_2_0_X
     1724        && u32Version != HWACCM_SSM_VERSION_3_0_X)
    17211725    {
    17221726        AssertMsgFailed(("hwaccmR3Load: Invalid version u32Version=%d!\n", u32Version));
     
    17321736        AssertRCReturn(rc, rc);
    17331737
    1734         if (u32Version >= HWACCM_SSM_VERSION)
     1738        if (u32Version >= HWACCM_SSM_VERSION_2_2_X)
    17351739        {
    17361740            uint32_t val;
     
    17491753        }
    17501754    }
     1755
     1756    if (u32Version >= HWACCM_SSM_VERSION_3_0_X)
     1757    {
     1758        rc = SSMR3GetBool(pSSM, &pVM->hwaccm.s.svm.fTPRPatching);
     1759        AssertRCReturn(rc, rc);
     1760    }
     1761
    17511762    return VINF_SUCCESS;
    17521763}
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r20026 r20035  
    135135/** HWACCM SSM version
    136136 */
    137 #define HWACCM_SSM_VERSION                  4
     137#define HWACCM_SSM_VERSION_3_0_X            5
     138#define HWACCM_SSM_VERSION_2_2_X            4
    138139#define HWACCM_SSM_VERSION_2_0_X            3
    139140
     
    340341        /** Set if erratum 170 affects the AMD cpu. */
    341342        bool                        fAlwaysFlushTLB;
    342         /** Explicit alignment padding to make 32-bit gcc align u64RegisterMask
    343          *  naturally. */
    344         bool                        padding[1];
     343        /** Set if we're patching 32 bits guests to get rid of TPR access overhead. */
     344        bool                        fTPRPatching;
    345345
    346346        /** R0 memory object for the host VM control block (VMCB). */
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r20032 r20035  
    14311431                 * Forward the trap to the guest by injecting the exception and resuming execution.
    14321432                 */
    1433                 Log(("Guest page fault at %RGv cr2=%RGv error code %x rsp=%RGv\n", (RTGCPTR)pCtx->rip, uFaultAddress, errCode, (RTGCPTR)pCtx->rsp));
     1433                Log(("Guest page fault at %04X:%RGv cr2=%RGv error code %x rsp=%RGv\n", pCtx->cs, (RTGCPTR)pCtx->rip, uFaultAddress, errCode, (RTGCPTR)pCtx->rsp));
    14341434                STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitGuestPF);
    14351435
     
    14751475                    if (    rc == VINF_SUCCESS
    14761476                        &&  Cpu.pCurInstr->opcode == OP_MOV
    1477                         &&  cbOp == 6)
     1477                        &&  cbOp >= 5)
    14781478                    {
    14791479                        if (    (errCode & X86_TRAP_PF_RW)
    1480                             &&  Cpu.param1.parval == uFaultAddress)
     1480                            &&  Cpu.param1.disp32 == (uint32_t)uFaultAddress)
    14811481                        {
     1482                            pVM->hwaccm.s.svm.fTPRPatching = true;
    14821483                            Log(("Acceptable write candidate!\n"));
    14831484                        }
    14841485                        else
    1485                         if (Cpu.param2.parval == uFaultAddress)
     1486                        if (Cpu.param2.disp32 == (uint32_t)uFaultAddress)
    14861487                        {
     1488                            pVM->hwaccm.s.svm.fTPRPatching = true;
    14871489                            Log(("Acceptable read candidate!\n"));
    14881490                        }
    14891491                    }
    1490 
    14911492                }
    14921493            }
     
    15891590                Event.n.u1ErrorCodeValid    = 1;
    15901591                Event.n.u32ErrorCode        = pVMCB->ctrl.u64ExitInfo1; /* EXITINFO1 = error code */
     1592Assert(pCtx->cs != 0xffcf || pCtx->eip != 0x4315);
    15911593                break;
    15921594            case X86_XCPT_DE:
     
    16071609                break;
    16081610            }
    1609             Log(("Trap %x at %RGv esi=%x\n", vector, (RTGCPTR)pCtx->rip, pCtx->esi));
     1611            Log(("Trap %x at %04x:%RGv esi=%x\n", vector, pCtx->cs, (RTGCPTR)pCtx->rip, pCtx->esi));
    16101612            SVMR0InjectEvent(pVM, pVMCB, pCtx, &Event);
    16111613
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