From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Chapman Date: Fri, 30 May 2003 14:18:39 +0000 Subject: [Linux-ia64] sigaltstack and ar.bspstore Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-ia64@vger.kernel.org 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