Re: [regression] x86/signal/64: Fix SS handling for signals delivered to 64-bit programs breaks dosemu
From: Stas Sergeev
Date: Thu Aug 13 2015 - 18:02:37 EST
14.08.2015 00:46, Linus Torvalds ÐÐÑÐÑ:
On Thu, Aug 13, 2015 at 2:42 PM, Raymond Jennings <shentino@xxxxxxxxx> wrote:
Unless you introduce some clever flag to explicitly request its restoring.
I am curious about what's supposed to happen normally on signal delivery.
What exactly does "supposed" mean?
Is SS a register that's supposed to be preserved like EIP/RIP and CS when a
signal is delivered?
On x86-64, we traditionally haven't touched SS, because it doesn't
really matter in 64-bit long mode. And apparently dosemu depended on
So clearly, we're not "supposed" to save/restore it. Because reality
matters a hell of a lot more than any theoretical arguments.
There is another problem as well which is that gcc assumes
FS base to point to TLS at function prolog. Since FS is not
restored too, the only suggestion I get is to write a sighandlers
in asm... I wonder if someone really should write a sighandler in
asm to restore FS base manually with a syscall.
So I think the reality is asking for a new flag. :)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/