VirtualBox

Changeset 61029 in vbox for trunk


Ignore:
Timestamp:
May 18, 2016 10:14:11 AM (8 years ago)
Author:
vboxsync
Message:

APIC: Just ignore the timer shift when loading old state, it's redundant anyway.

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

Legend:

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

    r61019 r61029  
    10211021IEM_CIMPL_DEF_4(iemCImpl_BranchCallGate, uint16_t, uSel, IEMBRANCH, enmBranch, IEMMODE, enmEffOpSize, PIEMSELDESC, pDesc)
    10221022{
     1023#define IEM_IMPLEMENTS_CALLGATE
    10231024#ifndef IEM_IMPLEMENTS_CALLGATE
    10241025    IEM_RETURN_ASPECT_NOT_IMPLEMENTED();
  • trunk/src/VBox/VMM/VMMR0/CPUMR0A.asm

    r57446 r61029  
    201201
    202202
    203 ;; Macro for FXSAVE for the guest FPU but tries to figure out whether to
     203;; Macro for FXSAVE/XSAVE for the guest FPU but tries to figure out whether to
    204204;  save the 32-bit FPU state or 64-bit FPU state.
    205205;
     
    207207; @param    %2      Pointer to XState.
    208208; @param    %3      Force AMD64
     209; @param    %4      Use XSAVE
    209210; @uses     xAX, xDX, EFLAGS, 20h of stack.
    210211;
    211 %macro SAVE_32_OR_64_FPU 3
     212%macro SAVE_32_OR_64_FPU 4
    212213%if CPUMR0_IS_AMD64 || %3
    213214        ; Save the guest FPU (32-bit or 64-bit), preserves existing broken state. See @bugref{7138}.
     
    215216        jnz     short %%save_long_mode_guest
    216217%endif
     218%if %4
     219        xsave   [pXState]
     220%else
    217221        fxsave  [pXState]
     222%endif
    218223%if CPUMR0_IS_AMD64 || %3
    219224        jmp     %%save_done_32bit_cs_ds
    220225
    221226%%save_long_mode_guest:
     227%if %4
     228        o64 xsave  [pXState]
     229%else
    222230        o64 fxsave [pXState]
     231%endif
    223232
    224233        xor     edx, edx
     
    266275        and     eax, ~CPUM_VOLATILE_XSAVE_GUEST_COMPONENTS ; Already saved in HMR0A.asm.
    267276%endif
    268 %ifdef RT_ARCH_AMD64
    269         o64 xsave [pXState]
    270 %else
    271         xsave   [pXState]
    272 %endif
     277        SAVE_32_OR_64_FPU pCpumCpu, pXState, 0, 1
    273278        jmp     %%guest_done
    274279
    275280        ; FXSAVE
    276281%%guest_fxsave:
    277         SAVE_32_OR_64_FPU pCpumCpu, pXState, 0
     282        SAVE_32_OR_64_FPU pCpumCpu, pXState, 0, 0
    278283
    279284%%guest_done:
     
    282287
    283288;;
    284 ; Wrapper for selecting 32-bit or 64-bit FXRSTOR according to what SAVE_32_OR_64_FPU did.
     289; Wrapper for selecting 32-bit or 64-bit FXRSTOR/XRSTOR according to what SAVE_32_OR_64_FPU did.
    285290;
    286291; @param    %1      Pointer to CPUMCPU.
    287292; @param    %2      Pointer to XState.
    288293; @param    %3      Force AMD64.
     294; @param    %4      Use XRSTOR
    289295; @uses     xAX, xDX, EFLAGS
    290296;
    291 %macro RESTORE_32_OR_64_FPU 3
     297%macro RESTORE_32_OR_64_FPU 4
    292298%if CPUMR0_IS_AMD64 || %3
    293299        ; Restore the guest FPU (32-bit or 64-bit), preserves existing broken state. See @bugref{7138}.
     
    298304%%restore_32bit_fpu:
    299305%endif
     306%if %4
     307        xrstor  [pXState]
     308%else
    300309        fxrstor [pXState]
     310%endif
    301311%if CPUMR0_IS_AMD64 || %3
    302312        ; TODO: Restore XMM8-XMM15!
    303313        jmp     short %%restore_fpu_done
    304314%%restore_64bit_fpu:
     315%if %4
     316        o64 xrstor  [pXState]
     317%else
    305318        o64 fxrstor [pXState]
     319%endif
    306320%%restore_fpu_done:
    307321%endif
     
    334348        and     eax, ~CPUM_VOLATILE_XSAVE_GUEST_COMPONENTS ; Will be loaded by HMR0A.asm.
    335349%endif
    336 %ifdef RT_ARCH_AMD64
    337         o64 xrstor [pXState]
    338 %else
    339         xrstor  [pXState]
    340 %endif
     350        RESTORE_32_OR_64_FPU pCpumCpu, pXState, 0, 1
    341351        jmp     %%guest_done
    342352
    343353        ; FXRSTOR
    344354%%guest_fxrstor:
    345         RESTORE_32_OR_64_FPU pCpumCpu, pXState, 0
     355        RESTORE_32_OR_64_FPU pCpumCpu, pXState, 0, 0
    346356
    347357%%guest_done:
  • trunk/src/VBox/VMM/VMMR3/APIC.cpp

    r60858 r61029  
    905905    SSMR3GetU32(pSSM, &u32TimerShift);
    906906    /* Old implementation may have left the timer shift uninitialized until
    907      * the timer configuration register was written. Fix that up.
    908      */
    909     if (!u32TimerShift)
    910         u32TimerShift = 1;
     907     * the timer configuration register was written. Unfortunately zero is
     908     * also a valid timer shift value, so we're just going to ignore it
     909     * completely. The shift count can always be derived from the DCR.
     910     */
    911911    uint8_t const uTimerShift = apicGetTimerShift(pXApicPage);
    912     AssertMsgReturn(u32TimerShift == uTimerShift, ("Timer shift invalid! Saved-state contains %u, expected %u\n", u32TimerShift,
    913                                                    uTimerShift), VERR_INVALID_STATE);
    914912
    915913    SSMR3GetU32(pSSM, &pXApicPage->timer_icr.u32InitialCount);
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