[Linux-ia64] sigaltstack and ar.bspstore

From: Matt Chapman <matthewc_at_cse.unsw.edu.au>
Date: 2003-05-31 00:18:39
Currently when using an alternate stack for signal handling, the
trampoline code switches to the new register stack without saving
bspstore.  When returning to the original register stack, it calculates
the bspstore as:

  bspstore0 = rse_skip_regs(bsp0, -rse_num_regs(bsp1 - (loadrs >> 19), bsp1));
  where bsp0 is sc->sc_ar_bsp and bsp1 is the current bsp

Presumably the result should be the same as the original bspstore.
However, it isn't in the case when the original bspstore is pointing to
slot 63 (the RNAT word).  The new bspstore comes out pointing to slot 0
of the next group, and the RNAT bits never get written.  This happens
more often then you'd expect, since it seems that current
implementations make the optimisation of writing the RNAT word together
with the first word of the new group instead of the last word of the old
group (sensible because it potentially saves a write).

I'd propose that the trampoline code should save bspstore in the
sigcontext structure and restore it from there rather than recalculating
it.  I can send a patch, but first is there any reason why it shouldn't
be done that way?

Matt
Received on Fri May 30 07:18:45 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:15 EST