Skip to content
  • Heiko Carstens's avatar
    s390/dumpstack: fix call chain walking · 1bca09f7
    Heiko Carstens authored
    
    
    dumpstack() did not always print a sane callchain when being called.
    The reason is that show_trace() accessed register 15 directly to get
    the current stack pointer and passed that pointer to __show_trace()
    which expects a valid stack frame pointer as argument.
    However due to tail call optimization the stack frame may not exist
    anymore when __show_trace() gets called and therefore an invalid
    stack frame pointer gets passed.
    To prevent that disable tail call optimization for call chain walking
    functions.
    So move all the show_* functions to a dumpstack.c file like other
    architectures have it already and add a -fno-optimize-sibling-calls
    compile flag to both dumpstack.c and stacktrace.c to prevent tail
    call optimization.
    
    Fixes callchains that looked e.g. like this:
    
    [   12.868258] Call Trace:
    [   12.868262] ([<0000000000008000>] 0x8000)
    
    Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    1bca09f7