Thread (5 messages) flat view 5 messages, 3 authors, 2011-02-14
STALE5652d

[PATCH 1/2] ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks

From: Will Deacon <hidden>
Date: 2011-02-14 12:12:05

Hi Catalin,
Subject: [PATCH 1/2] ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks

This patch adds THREAD_NOTIFY_COPY for colling registered handlers
during the copy_thread() function call. It also changes the VFP handler
to use a switch statement rather than if..else and ignore this event.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm/include/asm/thread_notify.h |    1 +
 arch/arm/kernel/process.c            |    2 ++
 arch/arm/vfp/vfpmodule.c             |   22 +++++++++++++++-------
 3 files changed, 18 insertions(+), 7 deletions(-)
This would be useful for the hw-breakpoint code, where we need to clear
(memset 0) the breakpoint structures in the child so that they don't get
unregistered later on.

However, we also need to flush (unregister) breakpoints in flush_thread
so that they don't persist across an exec. Ideally, we'd have a single
notifier block and act on THREAD_NOTIFY_{FLUSH,COPY} accordingly, but
the problem is that THREAD_NOTIFY_FLUSH is only notified *after* zeroing
most of the thread structure, so the call is currently inlined into
flush_thread and we don't use a notifier.

This could be solved by either notifying the FLUSH before zeroing the
various thread structures or by moving the zeroing of the debug struct
into the hw-breakpoint notifier. The latter probably makes more sense
once we've removed the single-step functionality from ptrace.

Will
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help