VirtualBox

Changeset 48539 in vbox for trunk


Ignore:
Timestamp:
Sep 19, 2013 3:31:53 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89084
Message:

VMM/CPUMR0A.asm: Yasm requires explicit REX prefix for fxsave/rstor. Don't corrupt the FPU state for 64-bit guests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/CPUMR0A.asm

    r44528 r48539  
    104104%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
    105105
    106     fxsave  [xDX + CPUMCPU.Host.fpu]    ; ASSUMES that all VT-x/AMD-V boxes sports fxsave/fxrstor (safe assumption)
     106%ifdef RT_ARCH_AMD64
     107    ; Use explicit REX prefix. See @bugref{6398}.
     108    o64 fxsave  [xDX + CPUMCPU.Host.fpu]    ; ASSUMES that all VT-x/AMD-V boxes sports fxsave/fxrstor (safe assumption)
     109    o64 fxrstor [xDX + CPUMCPU.Guest.fpu]
     110%else
     111    fxsave  [xDX + CPUMCPU.Host.fpu]        ; ASSUMES that all VT-x/AMD-V boxes sports fxsave/fxrstor (safe assumption)
    107112    fxrstor [xDX + CPUMCPU.Guest.fpu]
     113%endif
    108114
    109115%ifdef VBOX_WITH_KERNEL_USING_XMM
     
    133139.sixtyfourbit_mode:
    134140    and     edx, 0ffffffffh
    135     fxsave  [rdx + CPUMCPU.Host.fpu]
    136     fxrstor [rdx + CPUMCPU.Guest.fpu]
     141    o64 fxsave  [rdx + CPUMCPU.Host.fpu]
     142    o64 fxrstor [rdx + CPUMCPU.Guest.fpu]
    137143    jmp far [.fpret wrt rip]
    138144.fpret:                                 ; 16:32 Pointer to .the_end.
     
    217223%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
    218224
    219     fxsave  [xDX + CPUMCPU.Guest.fpu]   ; ASSUMES that all VT-x/AMD-V boxes support fxsave/fxrstor (safe assumption)
     225%ifdef RT_ARCH_AMD64
     226    ; Use explicit REX prefix. See @bugref{6398}.
     227    o64 fxsave  [xDX + CPUMCPU.Guest.fpu]   ; ASSUMES that all VT-x/AMD-V boxes support fxsave/fxrstor (safe assumption)
     228    o64 fxrstor [xDX + CPUMCPU.Host.fpu]
     229%else
     230    fxsave  [xDX + CPUMCPU.Guest.fpu]       ; ASSUMES that all VT-x/AMD-V boxes support fxsave/fxrstor (safe assumption)
    220231    fxrstor [xDX + CPUMCPU.Host.fpu]
     232%endif
    221233
    222234.done:
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