VirtualBox

Changeset 39996 in vbox


Ignore:
Timestamp:
Feb 4, 2012 3:55:51 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76107
Message:

tstX86-1: fxrstor (on intel) will #PF before committing any register changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/testcase/tstX86-1A.asm

    r39995 r39996  
    10101010BEGINPROC   x861_Test3
    10111011        SAVE_ALL_PROLOGUE
    1012 %if 0
    10131012        call    x861_LoadUniqueRegValuesSSE
    10141013        mov     xDI, REF_GLOBAL(g_pbEfExecPage)
     
    11411140        ShouldTrap X86_XCPT_GP, fxrstor [xDI + 14]
    11421141        ShouldTrap X86_XCPT_GP, fxrstor [xDI + 15]
    1143 %endif
    11441142
    11451143        ; Lets check what a FP in fxsave changes ... nothing on intel.
     
    11581156        mov     ecx, 512 / 4
    11591157        lea     xDI, [xSI + 512]
     1158        cld
    11601159        repz cmpsd
    1161         mov     eax, ebx
     1160        lea     xAX, [xBX + 20000]
    11621161        jnz     .return
    11631162
    11641163        add     ebx, 16
    11651164        cmp     ebx, 512
    1166         jb      .fxsave_pf_effect_loop
    1167 
     1165        jbe     .fxsave_pf_effect_loop
     1166
     1167        ; Lets check that a FP in fxrstor does not have any effect on the FPU or SSE state.
     1168        mov     xDI, REF_GLOBAL(g_pbEfExecPage)
     1169        mov     ecx, PAGE_SIZE / 4
     1170        mov     eax, 0ffaa33cch
     1171        cld
     1172        rep stosd
     1173
     1174        call    x861_LoadUniqueRegValuesSSE
     1175        mov     xDI, REF_GLOBAL(g_pbEfExecPage)
     1176        fxsave  [xDI]
     1177
     1178        call    x861_ClearRegistersSSE
     1179        mov     xDI, REF_GLOBAL(g_pbEfExecPage)
     1180        fxsave  [xDI + 512]
     1181
     1182        mov     ebx, 16
     1183.fxrstor_pf_effect_loop:
     1184        mov     xDI, REF_GLOBAL(g_pbEfExecPage)
     1185        mov     xSI, xDI
     1186        lea     xDI, [xDI + PAGE_SIZE - 512 + xBX]
     1187        mov     ecx, 512
     1188        sub     ecx, ebx
     1189        cld
     1190        rep movsb                       ; copy unique state to end of page.
     1191
     1192        push    xBX
     1193        call    x861_ClearRegistersSSE
     1194        pop     xBX
     1195        mov     xDI, REF_GLOBAL(g_pbEfExecPage)
     1196        ShouldTrap X86_XCPT_PF, fxrstor  [xDI + PAGE_SIZE - 512 + xBX] ; try load unique state
     1197
     1198        mov     xDI, REF_GLOBAL(g_pbEfExecPage)
     1199        lea     xSI, [xDI + 512]        ; point it to the clean state, which is what we expect.
     1200        lea     xDI, [xDI + 1024]
     1201        fxsave  [xDI]                   ; save whatever the fpu state currently is.
     1202        mov     ecx, 512 / 4
     1203        cld
     1204        repe cmpsd
     1205        lea     xAX, [xBX + 40000]
     1206        jnz     .return                 ; it shouldn't be modified by faulting fxrstor, i.e. a clean state.
     1207
     1208        add     ebx, 16
     1209        cmp     ebx, 512
     1210        jb      .fxrstor_pf_effect_loop
    11681211
    11691212.success:
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