VirtualBox

Changeset 60892 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 9, 2016 1:15:43 PM (9 years ago)
Author:
vboxsync
Message:

TRPMRCHandlerA.asm: Missed the other v8086 iret.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMRC/TRPMRCHandlersA.asm

    r60891 r60892  
    488488%endif
    489489
     490    ; For v8086 mode we must branch off before we enable write protection.
     491    test    dword [ebx + CPUMCTXCORE.eflags], X86_EFL_VM
     492    jnz     .gc_V86_return
     493
    490494    ; enable WP
    491495    mov     eax, cr0                    ;; @todo try elimiate this read.
     
    515519    mov     [%$STK_EIP], eax
    516520
    517     test    dword [ebx + CPUMCTXCORE.eflags], X86_EFL_VM
    518     jnz     .gc_V86_return
    519 
    520521    mov     ax, [ebx + CPUMCTXCORE.gs.Sel]
    521522    TRPM_NP_GP_HANDLER NAME(trpmRCTrapInGeneric), TRPM_TRAP_IN_MOV_GS
     
    544545ALIGNCODE(16)
    545546.gc_V86_return:
    546     mov     eax, dword [ebx + CPUMCTXCORE.es.Sel]
    547     mov     [%$STK_V86_ES], eax
    548     mov     eax, dword [ebx + CPUMCTXCORE.ds.Sel]
    549     mov     [%$STK_V86_DS], eax
    550     mov     eax, dword [ebx + CPUMCTXCORE.fs.Sel]
    551     mov     [%$STK_V86_FS], eax
    552     mov     eax, dword [ebx + CPUMCTXCORE.gs.Sel]
    553     mov     [%$STK_V86_GS], eax
    554 
    555     ; finally restore our scratch register eax and ebx.
    556     pop     ebx
    557     pop     eax
    558     add     esp, 16 + 8                 ; skip segregs, error code, and vector number.
    559 
    560     TRPM_NP_GP_HANDLER NAME(trpmRCTrapInGeneric), TRPM_TRAP_IN_IRET | TRPM_TRAP_IN_V86
    561     iret
     547    ;
     548    ; We may be returning to V8086 while having entered from protected mode!
     549    ; So, we have to push the whole stack frame.  There's code in CPUMRC that
     550    ; does exactly that, so call it instead of duplicating it.
     551    ;
     552    push    ebx
     553    extern  NAME(CPUMGCCallV86Code)
     554    call    NAME(CPUMGCCallV86Code)
     555    int3                                ; doesn't return...
     556
    562557
    563558    ;
     
    951946%endif
    952947
     948    ; For v8086 mode we must branch off before we enable write protection.
    953949    test    dword [ebx + CPUMCTXCORE.eflags], X86_EFL_VM
    954950    jnz     .gc_V86_return
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