VirtualBox

Ignore:
Timestamp:
Jun 16, 2010 6:31:42 PM (14 years ago)
Author:
vboxsync
Message:

VMM,REM: Only invalidate hidden registers when using raw-mode. Fixes save restore during mode switching code like the windows boot menu. (#5057)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxRecompiler.c

    r29333 r30263  
    17981798    TRPMEVENT               enmType;
    17991799    uint8_t                 u8TrapNo;
     1800    uint32_t                uCpl;
    18001801    int                     rc;
    18011802
     
    18051806    pVM->rem.s.Env.pVCpu = pVCpu;
    18061807    pCtx = pVM->rem.s.pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    1807     fHiddenSelRegsValid = CPUMAreHiddenSelRegsValid(pVM);
     1808    fHiddenSelRegsValid = CPUMAreHiddenSelRegsValid(pVCpu); /// @todo move this down and use fFlags.
    18081809
    18091810    Assert(!pVM->rem.s.fInREM);
     
    19271928     * Registers which are rarely changed and require special handling / order when changed.
    19281929     */
    1929     fFlags = CPUMGetAndClearChangedFlagsREM(pVCpu);
    1930     LogFlow(("CPUMGetAndClearChangedFlagsREM %x\n", fFlags));
     1930    fFlags = CPUMR3RemEnter(pVCpu, &uCpl);
     1931    LogFlow(("CPUMR3RemEnter %x %x\n", fFlags, uCpl));
    19311932    if (fFlags & (  CPUM_CHANGED_CR4  | CPUM_CHANGED_CR3  | CPUM_CHANGED_CR0
    19321933                  | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_LDTR
     
    20412042
    20422043        /* Set current CPL */
    2043         cpu_x86_set_cpl(&pVM->rem.s.Env, CPUMGetGuestCPL(pVCpu, CPUMCTX2CORE(pCtx)));
     2044        cpu_x86_set_cpl(&pVM->rem.s.Env, uCpl);
    20442045
    20452046        cpu_x86_load_seg_cache(&pVM->rem.s.Env, R_CS, pCtx->cs, pCtx->csHid.u64Base, pCtx->csHid.u32Limit, (pCtx->csHid.Attr.u << 8) & 0xFFFFFF);
     
    20572058            Log2(("REMR3State: SS changed from %04x to %04x!\n", pVM->rem.s.Env.segs[R_SS].selector, pCtx->ss));
    20582059
    2059             cpu_x86_set_cpl(&pVM->rem.s.Env, CPUMGetGuestCPL(pVCpu, CPUMCTX2CORE(pCtx)));
     2060            cpu_x86_set_cpl(&pVM->rem.s.Env, uCpl);
    20602061            sync_seg(&pVM->rem.s.Env, R_SS, pCtx->ss);
    20612062#ifdef VBOX_WITH_STATISTICS
     
    24752476     * We're not longer in REM mode.
    24762477     */
     2478    CPUMR3RemLeave(pVCpu,
     2479                      HWACCMIsEnabled(pVM)
     2480                   || (  pVM->rem.s.Env.segs[R_SS].newselector
     2481                       | pVM->rem.s.Env.segs[R_GS].newselector
     2482                       | pVM->rem.s.Env.segs[R_FS].newselector
     2483                       | pVM->rem.s.Env.segs[R_ES].newselector
     2484                       | pVM->rem.s.Env.segs[R_DS].newselector
     2485                       | pVM->rem.s.Env.segs[R_CS].newselector) == 0
     2486                   );
    24772487    VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED, VMCPUSTATE_STARTED_EXEC_REM);
    24782488    pVM->rem.s.fInREM    = false;
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