Hi Al, On Thu, Sep 30, 2010 at 07:58, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
   ÂI've been trying to sort out what's going on with TIF_DELAYED_TRACE, but unfortunately neither User's Manual for 68040 nor Programmer's Reference Manual for 68k family cover tracing exceptions in enough details ;-/    Âa) regs.SR.T1 is cleared if you have created a sigframe; in addition, SIGTRAP is sent to yourself.    Âb) if you leave a syscall and see TIF_DELAYED_TRACE set, you do the same thing, signals or no signals.    Âc) if you leave an exception *and* no signal handlers are triggered, you leave T1 alone.    Âd) if you step into a tracing exception, you get SIGTRAP again, with si_code set to TRAP_TRACE (instead of SI_KERNEL); si_addr is set (unlike the previous cases).    Âe) TIF_DELAYED_TRACE is set when you ask for singlestepping; the same thing sets SR.T1.    Âf) PTRACE_POKEUSR can't change tracing bits in SR; neither can sigreturn.    Âg) if UM is clear on anything, it's that for TRAP the tracing exception is handled before entering the trap itself. So what's that SIGTRAP on exit from syscall in single-stepping mode for? I can understand doing that when we've set a signal handler up, but... There'd been some changes of behaviour in cset with rather uninformative commit message  Â[PATCH] M68k update (part 42)  ÂM68k task and thread updates and AFAICS until that point we had the same "send SIGTRAP and clear T1" on ret_from_exception, no matter what had led there. ÂWas that a bugfix or just an unintended change? BTW, there's a bunch of signal races in m68k, mostly parallel to similar crap I'd been fixing lately on other targets; I have fixes, but I'd rather understand what's going on with tracing in there before touching the more subtle ones...
Sorry, I don't know. I try to stay away from the signal code as much as possible. Perhaps Andreas knows? Anyway, thanks for looking into this! Gr{oetje,eeting}s, Â Â Â Â Â Â Â Â Â Â Â Â Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. Â Â Â Â Â Â Â Â Â Â Â Â Â ÂÂ ÂÂ -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html