VirtualBox

Ignore:
Timestamp:
May 12, 2017 12:40:17 PM (8 years ago)
Author:
vboxsync
Message:

CPUM,HM: Added CPUMRZFpuStateActualizeAvxForRead and fixed missing MXCSR availability for the SSE variant. Should save MXCSR when VBOX_WITH_KERNEL_USING_XMM is define.

File:
1 edited

Legend:

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

    r65932 r66878  
    808808; @remarks      This is essentially the same code as hmR0SVMRunWrapXMM, only the parameters differ a little bit.
    809809;
     810; @remarks      Drivers shouldn't use AVX registers without saving+loading:
     811;                   https://msdn.microsoft.com/en-us/library/windows/hardware/ff545910%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
     812;               However the compiler docs have different idea:
     813;                   https://msdn.microsoft.com/en-us/library/9z1stfyw.aspx
     814;               We'll go with the former for now.
     815;
    810816; ASSUMING 64-bit and windows for now.
     817;
    811818ALIGNCODE(16)
    812819BEGINPROC hmR0VMXStartVMWrapXMM
    813820        push    xBP
    814821        mov     xBP, xSP
    815         sub     xSP, 0a0h + 040h        ; Don't bother optimizing the frame size.
     822        sub     xSP, 0b0h + 040h ; Don't bother optimizing the frame size.
    816823
    817824        ; spill input parameters.
     
    853860        movdqa  [rsp + 040h + 080h], xmm14
    854861        movdqa  [rsp + 040h + 090h], xmm15
     862        stmxcsr [rsp + 040h + 0a0h]
    855863
    856864        mov     r10, [xBP + 018h]       ; pCtx
     
    901909        movdqa  xmm14, [rsp + 040h + 080h]
    902910        movdqa  xmm15, [rsp + 040h + 090h]
     911        ldmxcsr        [rsp + 040h + 0a0h]
    903912        leave
    904913        ret
     
    926935        movdqa  xmm14, [r10 + XMM_OFF_IN_X86FXSTATE + 0e0h]
    927936        movdqa  xmm15, [r10 + XMM_OFF_IN_X86FXSTATE + 0f0h]
     937        ldmxcsr        [r10 + X86FXSTATE.MXCSR]
    928938
    929939        ; Make the call (same as in the other case ).
     
    940950        mov     r10, [xBP + 018h]       ; pCtx
    941951        mov     r10, [r10 + CPUMCTX.pXStateR0]
     952        stmxcsr [r10 + X86FXSTATE.MXCSR]
    942953        movdqa  [r10 + XMM_OFF_IN_X86FXSTATE + 000h], xmm0
    943954        movdqa  [r10 + XMM_OFF_IN_X86FXSTATE + 010h], xmm1
     
    976987; @remarks      This is essentially the same code as hmR0VMXStartVMWrapXMM, only the parameters differ a little bit.
    977988;
     989; @remarks      Drivers shouldn't use AVX registers without saving+loading:
     990;                   https://msdn.microsoft.com/en-us/library/windows/hardware/ff545910%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
     991;               However the compiler docs have different idea:
     992;                   https://msdn.microsoft.com/en-us/library/9z1stfyw.aspx
     993;               We'll go with the former for now.
     994;
    978995; ASSUMING 64-bit and windows for now.
    979996ALIGNCODE(16)
     
    981998        push    xBP
    982999        mov     xBP, xSP
    983         sub     xSP, 0a0h + 040h        ; Don't bother optimizing the frame size.
     1000        sub     xSP, 0b0h + 040h        ; Don't bother optimizing the frame size.
    9841001
    9851002        ; spill input parameters.
     
    10211038        movdqa  [rsp + 040h + 080h], xmm14
    10221039        movdqa  [rsp + 040h + 090h], xmm15
     1040        stmxcsr [rsp + 040h + 0a0h]
    10231041
    10241042        mov     r10, [xBP + 020h]       ; pCtx
     
    10691087        movdqa  xmm14, [rsp + 040h + 080h]
    10701088        movdqa  xmm15, [rsp + 040h + 090h]
     1089        ldmxcsr [rsp + 040h + 0a0h]
    10711090        leave
    10721091        ret
     
    10941113        movdqa  xmm14, [r10 + XMM_OFF_IN_X86FXSTATE + 0e0h]
    10951114        movdqa  xmm15, [r10 + XMM_OFF_IN_X86FXSTATE + 0f0h]
     1115        ldmxcsr        [r10 + X86FXSTATE.MXCSR]
    10961116
    10971117        ; Make the call (same as in the other case ).
     
    11081128        mov     r10, [xBP + 020h]       ; pCtx
    11091129        mov     r10, [r10 + CPUMCTX.pXStateR0]
     1130        stmxcsr [r10 + X86FXSTATE.MXCSR]
    11101131        movdqa  [r10 + XMM_OFF_IN_X86FXSTATE + 000h], xmm0
    11111132        movdqa  [r10 + XMM_OFF_IN_X86FXSTATE + 010h], xmm1
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