linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks
Date: Mon, 14 Feb 2011 12:12:05 -0000	[thread overview]
Message-ID: <000201cbcc40$6571c840$305558c0$@deacon@arm.com> (raw)
In-Reply-To: <20110214103738.5796.44268.stgit@e102109-lin.cambridge.arm.com>

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

  reply	other threads:[~2011-02-14 12:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 10:37 [PATCH 0/2] Preserve the VFP state across the fork() call Catalin Marinas
2011-02-14 10:37 ` [PATCH 1/2] ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks Catalin Marinas
2011-02-14 12:12   ` Will Deacon [this message]
2011-02-14 16:13     ` Russell King - ARM Linux
2011-02-14 10:37 ` [PATCH 2/2] ARM: Preserve the VFP state during fork Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000201cbcc40$6571c840$305558c0$@deacon@arm.com' \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).