VirtualBox

Changeset 38300 in vbox for trunk


Ignore:
Timestamp:
Aug 3, 2011 11:58:41 AM (13 years ago)
Author:
vboxsync
Message:

REM,PGM: Fix A20 syncing between the VMM and the recompiler.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/rem.h

    r35361 r38300  
    7171REMR3DECL(int)  REMR3StateBack(PVM pVM, PVMCPU pVCpu);
    7272REMR3DECL(void) REMR3StateUpdate(PVM pVM, PVMCPU pVCpu);
    73 REMR3DECL(void) REMR3A20Set(PVM pVM, PVMCPU pVCpu, bool fEnable);
    7473REMR3DECL(int)  REMR3DisasEnableStepping(PVM pVM, bool fEnable);
    7574REMR3DECL(void) REMR3ReplayHandlerNotifications(PVM pVM);
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r38080 r38300  
    36813681        pVCpu->pgm.s.fA20Enabled = fEnable;
    36823682        pVCpu->pgm.s.GCPhysA20Mask = ~(RTGCPHYS)(!fEnable << 20);
    3683         REMR3A20Set(pVCpu->pVMR3, pVCpu, fEnable);
    36843683        /** @todo we're not handling this correctly for VT-x / AMD-V. See #2911 */
    36853684    }
  • trunk/src/recompiler/VBoxREM.def

    r28800 r38300  
    55
    66;
    7 ; Copyright (C) 2006-2007 Oracle Corporation
     7; Copyright (C) 2006-2011 Oracle Corporation
    88;
    99; This file is part of VirtualBox Open Source Edition (OSE), as
     
    3131    REMR3StateBack
    3232    REMR3StateUpdate
    33     REMR3A20Set
    3433    REMR3DisasEnableStepping
    3534    REMR3ReplayHandlerNotifications
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r37693 r38300  
    361361static DECLCALLBACKPTR(int, pfnREMR3StateBack)(PVM, PVMCPU);
    362362static DECLCALLBACKPTR(void, pfnREMR3StateUpdate)(PVM, PVMCPU);
    363 static DECLCALLBACKPTR(void, pfnREMR3A20Set)(PVM, PVMCPU, bool);
    364363static DECLCALLBACKPTR(void, pfnREMR3ReplayHandlerNotifications)(PVM pVM);
    365364static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTGCPHYS, unsigned);
     
    11481147    { "REMR3StateBack",                         (void *)&pfnREMR3StateBack,                         &g_aArgsVMandVMCPU[0],                      RT_ELEMENTS(g_aArgsVMandVMCPU),                        REMFNDESC_FLAGS_RET_INT,    sizeof(int),    NULL },
    11491148    { "REMR3StateUpdate",                       (void *)&pfnREMR3StateUpdate,                       &g_aArgsVMandVMCPU[0],                      RT_ELEMENTS(g_aArgsVMandVMCPU),                        REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    1150     { "REMR3A20Set",                            (void *)&pfnREMR3A20Set,                            &g_aArgsA20Set[0],                          RT_ELEMENTS(g_aArgsA20Set),                            REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    11511149    { "REMR3ReplayHandlerNotifications",        (void *)&pfnREMR3ReplayHandlerNotifications,        &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    11521150    { "REMR3NotifyPhysRamRegister",             (void *)&pfnREMR3NotifyPhysRamRegister,             &g_aArgsNotifyPhysRamRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRamRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     
    23092307}
    23102308
    2311 REMR3DECL(void) REMR3A20Set(PVM pVM, PVMCPU pVCpu, bool fEnable)
    2312 {
    2313 #ifndef USE_REM_STUBS
    2314     Assert(VALID_PTR(pfnREMR3A20Set));
    2315     pfnREMR3A20Set(pVM, pVCpu, fEnable);
    2316 #endif
    2317 }
    2318 
    23192309REMR3DECL(void) REMR3ReplayHandlerNotifications(PVM pVM)
    23202310{
  • trunk/src/recompiler/VBoxRecompiler.c

    r37852 r38300  
    21602160
    21612161    /*
     2162     * Sync the A20 gate.
     2163     */
     2164    bool fA20State = PGMPhysIsA20Enabled(pVCpu);
     2165    if (fA20State != RT_BOOL(pVM->rem.s.Env.a20_mask & RT_BIT(20)))
     2166    {
     2167        ASMAtomicIncU32(&pVM->rem.s.cIgnoreAll);
     2168        cpu_x86_set_a20(&pVM->rem.s.Env, fA20State);
     2169        ASMAtomicDecU32(&pVM->rem.s.cIgnoreAll);
     2170    }
     2171
     2172    /*
    21622173     * Registers which are rarely changed and require special handling / order when changed.
    21632174     */
     
    29412952#undef LOG_GROUP
    29422953#define LOG_GROUP LOG_GROUP_REM
    2943 
    2944 
    2945 /**
    2946  * Notify the recompiler about Address Gate 20 state change.
    2947  *
    2948  * This notification is required since A20 gate changes are
    2949  * initialized from a device driver and the VM might just as
    2950  * well be in REM mode as in RAW mode.
    2951  *
    2952  * @param   pVM         VM handle.
    2953  * @param   pVCpu       VMCPU handle.
    2954  * @param   fEnable     True if the gate should be enabled.
    2955  *                      False if the gate should be disabled.
    2956  */
    2957 REMR3DECL(void) REMR3A20Set(PVM pVM, PVMCPU pVCpu, bool fEnable)
    2958 {
    2959     LogFlow(("REMR3A20Set: fEnable=%d\n", fEnable));
    2960     VM_ASSERT_EMT(pVM);
    2961 
    2962     ASMAtomicIncU32(&pVM->rem.s.cIgnoreAll);
    2963     cpu_x86_set_a20(&pVM->rem.s.Env, fEnable);
    2964     ASMAtomicDecU32(&pVM->rem.s.cIgnoreAll);
    2965 }
    29662954
    29672955
  • trunk/src/recompiler/softmmu_header.h

    r37689 r38300  
    8787    RES_TYPE res;
    8888    target_ulong addr;
     89#ifdef VBOX
     90    uintptr_t physaddr;
     91#else
    8992    unsigned long physaddr;
     93#endif
    9094    int mmu_idx;
    9195
     
    108112    int res, page_index;
    109113    target_ulong addr;
     114#ifdef VBOX
     115    uintptr_t physaddr;
     116#else
    110117    unsigned long physaddr;
     118#endif
    111119    int mmu_idx;
    112120
     
    133141    int page_index;
    134142    target_ulong addr;
     143#ifdef VBOX
     144    uintptr_t physaddr;
     145#else
    135146    unsigned long physaddr;
     147#endif
    136148    int mmu_idx;
    137149
     
    207219#undef MMUSUFFIX
    208220#undef ADDR_READ
     221
     222#include <iprt/assert.h>
     223AssertCompileSize(uint64_t,8);
     224AssertCompileSize(uint32_t,4);
     225AssertCompileSize(uint16_t,2);
     226AssertCompileSize(uint8_t,1);
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