All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Roland McGrath <roland@redhat.com>
Cc: torvalds@linux-foundation.org, mingo@elte.hu,
	linux-kernel@vger.kernel.org, shaohua.li@intel.com,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH] core dump: user_regset writeback
Date: Thu, 28 Feb 2008 20:45:22 +0000	[thread overview]
Message-ID: <20080228124522.3ae08f19.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080227200638.15D092700FD@magilla.localdomain>

On Wed, 27 Feb 2008 12:06:38 -0800 (PST)
Roland McGrath <roland@redhat.com> wrote:

> 
> This makes the user_regset-based core dump code call user_regset
> writeback hooks when available.  This is necessary groundwork to
> allow IA64 to set CORE_DUMP_USE_REGSET.
> 
> CC: Shaohua Li <shaohua.li@intel.com>
> Signed-off-by: Roland McGrath <roland@redhat.com>
> ---
>  fs/binfmt_elf.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
> index 41a958a..eb7cca3 100644
> --- a/fs/binfmt_elf.c
> +++ b/fs/binfmt_elf.c
> @@ -1424,6 +1424,18 @@ struct elf_note_info {
>  	int thread_notes;
>  };
>  
> +/*
> + * When a regset has a writeback hook, we call it on each thread before
> + * dumping user memory.  On register window machines, this makes sure the
> + * user memory backing the register data is up to date before we read it.
> + */
> +static void do_thread_regset_writeback(struct task_struct *task,
> +				       const struct user_regset *regset)
> +{
> +	if (regset->writeback)
> +		regset->writeback(task, regset, 1);
> +}
> +
>  static int fill_thread_core_info(struct elf_thread_core_info *t,
>  				 const struct user_regset_view *view,
>  				 long signr, size_t *total)
> @@ -1445,6 +1457,8 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
>  		  sizeof(t->prstatus), &t->prstatus);
>  	*total += notesize(&t->notes[0]);
>  
> +	do_thread_regset_writeback(t->task, &view->regsets[0]);
> +
>  	/*
>  	 * Each other regset might generate a note too.  For each regset
>  	 * that has no core_note_type or is inactive, we leave t->notes[i]
> @@ -1452,6 +1466,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
>  	 */
>  	for (i = 1; i < view->n; ++i) {
>  		const struct user_regset *regset = &view->regsets[i];
> +		do_thread_regset_writeback(t->task, regset);
>  		if (regset->core_note_type &&
>  		    (!regset->active || regset->active(t->task, regset))) {
>  			int ret;

Is there a need for this in 2.6.25?

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Roland McGrath <roland@redhat.com>
Cc: torvalds@linux-foundation.org, mingo@elte.hu,
	linux-kernel@vger.kernel.org, shaohua.li@intel.com,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH] core dump: user_regset writeback
Date: Thu, 28 Feb 2008 12:45:22 -0800	[thread overview]
Message-ID: <20080228124522.3ae08f19.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080227200638.15D092700FD@magilla.localdomain>

On Wed, 27 Feb 2008 12:06:38 -0800 (PST)
Roland McGrath <roland@redhat.com> wrote:

> 
> This makes the user_regset-based core dump code call user_regset
> writeback hooks when available.  This is necessary groundwork to
> allow IA64 to set CORE_DUMP_USE_REGSET.
> 
> CC: Shaohua Li <shaohua.li@intel.com>
> Signed-off-by: Roland McGrath <roland@redhat.com>
> ---
>  fs/binfmt_elf.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
> index 41a958a..eb7cca3 100644
> --- a/fs/binfmt_elf.c
> +++ b/fs/binfmt_elf.c
> @@ -1424,6 +1424,18 @@ struct elf_note_info {
>  	int thread_notes;
>  };
>  
> +/*
> + * When a regset has a writeback hook, we call it on each thread before
> + * dumping user memory.  On register window machines, this makes sure the
> + * user memory backing the register data is up to date before we read it.
> + */
> +static void do_thread_regset_writeback(struct task_struct *task,
> +				       const struct user_regset *regset)
> +{
> +	if (regset->writeback)
> +		regset->writeback(task, regset, 1);
> +}
> +
>  static int fill_thread_core_info(struct elf_thread_core_info *t,
>  				 const struct user_regset_view *view,
>  				 long signr, size_t *total)
> @@ -1445,6 +1457,8 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
>  		  sizeof(t->prstatus), &t->prstatus);
>  	*total += notesize(&t->notes[0]);
>  
> +	do_thread_regset_writeback(t->task, &view->regsets[0]);
> +
>  	/*
>  	 * Each other regset might generate a note too.  For each regset
>  	 * that has no core_note_type or is inactive, we leave t->notes[i]
> @@ -1452,6 +1466,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
>  	 */
>  	for (i = 1; i < view->n; ++i) {
>  		const struct user_regset *regset = &view->regsets[i];
> +		do_thread_regset_writeback(t->task, regset);
>  		if (regset->core_note_type &&
>  		    (!regset->active || regset->active(t->task, regset))) {
>  			int ret;

Is there a need for this in 2.6.25?

  reply	other threads:[~2008-02-28 20:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 20:06 [PATCH] core dump: user_regset writeback Roland McGrath
2008-02-27 20:06 ` Roland McGrath
2008-02-28 20:45 ` Andrew Morton [this message]
2008-02-28 20:45   ` Andrew Morton
2008-02-28 21:10   ` Roland McGrath
2008-02-28 21:10     ` Roland McGrath

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=20080228124522.3ae08f19.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=shaohua.li@intel.com \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.