VirtualBox

Changeset 7507 in vbox


Ignore:
Timestamp:
Mar 20, 2008 2:16:51 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28969
Message:

Restore saved registers after returning from a call in vmmR0CallHostSetJmp. Otherwise after resume registers that you're not supposed to trash contain the values of the previous run. (esi contains the IRP pointer for instance)

File:
1 edited

Legend:

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

    r5999 r7507  
    7373    add     esp, 12
    7474    mov     edx, [esp + 4h]             ; pJmpBuf
     75
     76    ; restore the registers that we're not allowed to modify
     77    ; otherwise a resume might restore the wrong values (from the previous run)
     78    mov     edi, [edx + VMMR0JMPBUF.edi]
     79    mov     esi, [edx + VMMR0JMPBUF.esi]
     80    mov     ebx, [edx + VMMR0JMPBUF.ebx]
     81    mov     ebp, [edx + VMMR0JMPBUF.ebp]
     82
    7583    and     dword [edx + VMMR0JMPBUF.eip], byte 0 ; used for valid check.
    7684    ret
     
    171179    call    r11
    172180    mov     rdx, [rbp - 8]              ; pJmpBuf
     181
     182    ; restore the registers that we're not allowed to modify
     183    ; otherwise a resume might restore the wrong values (from the previous run)
     184    mov     rbx, [rdx + VMMR0JMPBUF.rbx]
     185 %ifdef ASM_CALL64_MSC
     186    mov     rsi, [rdx + VMMR0JMPBUF.rsi]
     187    mov     rdi, [rdx + VMMR0JMPBUF.rdi]
     188 %endif
     189    mov     r12, [rdx + VMMR0JMPBUF.r12]
     190    mov     r13, [rdx + VMMR0JMPBUF.r13]
     191    mov     r14, [rdx + VMMR0JMPBUF.r14]
     192    mov     r15, [rdx + VMMR0JMPBUF.r15]
     193
    173194    and     qword [rdx + VMMR0JMPBUF.rip], byte 0 ; used for valid check.
    174195    leave
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