VirtualBox

Changeset 73471 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Aug 3, 2018 12:11:07 PM (6 years ago)
Author:
vboxsync
Message:

VMM,DBGF: Improved unwinding of ring-0 assertion stacks, making the new unwind info stuff deal correctly with ring-0 pointers and such. bugref:3897

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm

    r71222 r73471  
    1919;* Header Files                                                                *
    2020;*******************************************************************************
     21%define RT_ASM_WITH_SEH64
    2122%include "VBox/asmdefs.mac"
    2223%include "VMMInternal.mac"
     
    6263    ;
    6364    push    rbp
     65    SEH64_PUSH_xBP
    6466    mov     rbp, rsp
     67    SEH64_SET_FRAME_xBP 0
    6568 %ifdef ASM_CALL64_MSC
    6669    sub     rsp, 30h + STACK_FUZZ_SIZE  ; (10h is used by resume (??), 20h for callee spill area)
     70    SEH64_ALLOCATE_STACK 30h + STACK_FUZZ_SIZE
     71SEH64_END_PROLOGUE
    6772    mov     r11, rdx                    ; pfn
    6873    mov     rdx, rcx                    ; pJmpBuf;
    6974 %else
    7075    sub     rsp, 10h + STACK_FUZZ_SIZE  ; (10h is used by resume (??))
     76    SEH64_ALLOCATE_STACK 10h + STACK_FUZZ_SIZE
     77SEH64_END_PROLOGUE
    7178    mov     r8, rdx                     ; pvUser1 (save it like MSC)
    7279    mov     r9, rcx                     ; pvUser2 (save it like MSC)
     
    302309    ;
    303310    push    rbp
     311    SEH64_PUSH_xBP
    304312    mov     rbp, rsp
     313    SEH64_SET_FRAME_xBP 0
    305314    push    r15
     315    SEH64_PUSH_GREG r15
    306316    push    r14
     317    SEH64_PUSH_GREG r14
    307318    push    r13
     319    SEH64_PUSH_GREG r13
    308320    push    r12
     321    SEH64_PUSH_GREG r12
    309322%ifdef ASM_CALL64_MSC
    310323    push    rdi
     324    SEH64_PUSH_GREG rdi
    311325    push    rsi
     326    SEH64_PUSH_GREG rsi
    312327%endif
    313328    push    rbx
     329    SEH64_PUSH_GREG rbx
    314330    pushf
     331    SEH64_ALLOCATE_STACK 8
    315332%ifdef RT_OS_WINDOWS
    316333    sub     rsp, 0a0h
     334    SEH64_ALLOCATE_STACK 0a0h
    317335    movdqa  [rsp + 000h], xmm6
    318336    movdqa  [rsp + 010h], xmm7
     
    328346%ifdef VBOX_STRICT
    329347    push    RESUME_MAGIC
    330 %endif
     348    SEH64_ALLOCATE_STACK 8
     349%endif
     350SEH64_END_PROLOGUE
    331351
    332352    ;
     
    373393
    374394 %endif ; !VMM_R0_SWITCH_STACK
     395
     396    ; Save a PC and return PC here to assist unwinding.
     397.unwind_point:
     398    lea     rcx, [.unwind_point wrt RIP]
     399    mov     [xDX + VMMR0JMPBUF.SavedEipForUnwind], rcx
     400    mov     rcx, [xDX + VMMR0JMPBUF.rbp]
     401    lea     rcx, [rcx + 8]
     402    mov     [xDX + VMMR0JMPBUF.UnwindRetPcLocation], rcx
     403    mov     rcx, [rcx]
     404    mov     [xDX + VMMR0JMPBUF.UnwindRetPcValue], rcx
    375405
    376406    ; Save RSP & RBP to enable stack dumps
     
    452482; @cproto VMMR0DECL(void) vmmR0LoggerWrapper(const char *pszFormat, ...)
    453483;
    454 EXPORTEDNAME vmmR0LoggerWrapper
     484BEGINPROC_EXPORTED vmmR0LoggerWrapper
     485SEH64_END_PROLOGUE
    455486    int3
    456487    int3
  • trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-x86.asm

    r71222 r73471  
    334334%endif ; !VMM_R0_SWITCH_STACK
    335335
     336    ; Save a PC here to assist unwinding.
     337.unwind_point:
     338    mov     dword [xDX + VMMR0JMPBUF.SavedEipForUnwind], .unwind_point
     339    mov     ecx, [xDX + VMMR0JMPBUF.ebp]
     340    lea     ecx, [ecx + 4]
     341    mov     [xDX + VMMR0JMPBUF.UnwindRetPcLocation], ecx
     342
    336343    ; Save ESP & EBP to enable stack dumps
    337344    mov     ecx, ebp
     
    353360    mov     ebp, [xDX + VMMR0JMPBUF.ebp]
    354361    mov     ecx, [xDX + VMMR0JMPBUF.eip]
     362    mov     [xDX + VMMR0JMPBUF.UnwindRetPcValue], ecx
    355363    mov     esp, [xDX + VMMR0JMPBUF.esp]
    356364    push    dword [xDX + VMMR0JMPBUF.eflags]
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