public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Incorrect unwind data in entry.S
@ 2000-12-21  3:42 Keith Owens
  2001-01-05 18:48 ` David Mosberger
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Keith Owens @ 2000-12-21  3:42 UTC (permalink / raw)
  To: linux-ia64

Either I have completely misunderstood the IA64 unwind data (quite
likely) or this code is wrong.

GLOBAL_ENTRY(ia64_prepare_handle_unaligned)
        //
        // r16 = fake ar.pfs, we simply need to make sure
        // privilege is still 0
        //
        PT_REGS_UNWIND_INFO(0)
        mov r16=r0
        UNW(.prologue)
        DO_SAVE_SWITCH_STACK
        br.call.sptk.few rp=ia64_handle_unaligned // stack frame setup in ivt
.ret21: .body
        DO_LOAD_SWITCH_STACK(PT_REGS_UNWIND_INFO(0))
        br.cond.sptk.many rp                      // goes to ia64_leave_kernel
END(ia64_prepare_handle_unaligned)

That preprocesses into

.global ia64_prepare_handle_unaligned; .align 32; .proc ia64_prepare_handle_unaligned; ia64_prepare_handle_unaligned:
        .prologue;			// prologue 1
        .unwabi @svr4, 'i';
        .fframe 400+16+(0);
        // assorted .spillsp directives
        .body
        mov r16=r0
        .prologue			// prologue 2
        movl r28\x1f;
        ;;
        .fframe 576;
        adds sp=-576,sp;
        mov b7=r28;
        // assorted .savesp and .spillsp directives
        br.cond.sptk.many save_switch_stack;
        1:
        br.call.sptk.few rp=ia64_handle_unaligned
.ret21: .body
        movl r28\x1f;
        ;;
        mov b7=r28;
        br.cond.sptk.many load_switch_stack;
        1: .restore sp;			// pop prologue 2
        .prologue;			// prologue 3
        .unwabi @svr4, 'i';
        .fframe 400+16+(0);
        .spillsp rp, (8 + 16)+(0);
        .spillsp ar.pfs, (16 + 16)+(0);
        .spillsp ar.unat, (24 + 16)+(0);
        .spillsp ar.fpsr, (312 + 16)+(0);
        .spillsp pr, (64 + 16)+(0);;
        .body;
        adds spW6,sp
        br.cond.sptk.many rp
.endp ia64_prepare_handle_unaligned

The prologue after .ret21 makes no sense.  Unwind claims that we are
increasing the stack by 416 and spilling registers to stack but we are
really removing the struct switch_stack.

The mismatch between unwind and the code does not cause any problems
because we hit .endp almost immediately.  I just want to get
confirmation that this really is an error.  AFAICT, prologue 3 should
be an epilog.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-01-17 20:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-21  3:42 [Linux-ia64] Incorrect unwind data in entry.S Keith Owens
2001-01-05 18:48 ` David Mosberger
2001-01-06  0:51 ` Keith Owens
2001-01-06  1:58 ` David Mosberger
2001-01-16 23:41 ` Cary Coutant
2001-01-17  1:34 ` David Mosberger
2001-01-17 18:54 ` Cary Coutant
2001-01-17 20:04 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox