[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070224000851.C9884180076@magilla.sf.frob.com>
Date: Fri, 23 Feb 2007 16:08:51 -0800 (PST)
From: Roland McGrath <roland@...hat.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Prasanna S Panchamukhi <prasanna@...ibm.com>,
Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Kwatch: kernel watchpoints using CPU debug registers
> I think the best approach will be not to reset dr7 at all. Then there
> won't be any need to worry about restoring it. Leaving a userspace
> watchpoint enabled while running in the kernel ought not to matter; a
> system call shouldn't touch any address in userspace more than once or
> twice.
Hmm. That sounds reasonable. But I wonder why the old code clears %dr7.
It's been that way for a long time (since 2.4 at least).
> My idea was to put 4 hwbkpt structures in thread_struct, so they would
> always be available for use by ptrace. However it turned out not to be
> feasible to replace the debugreg array with something more sophisticated,
> because of conflicting declarations and problems with the ordering of
> #includes. So instead I have been forced to replace debugreg[] with a
> pointer to a structure which can be allocated as needed.
I think that's preferable anyway. Most tasks most of the time will never
need that storage, so why not make thread_struct a little smaller?
(There is also the potential for sharing, which I mentioned earlier.)
> This raises the possibility that a PTRACE syscall might fail because the
> allocation fails. Hopefully that won't be an issue?
It's not a new issue, anyway, after utrace. The utrace-based ptrace can
fail for PTRACE_ATTACH because of OOM too, which wasn't possible before.
I think it's survivable.
Thanks,
Roland
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists