All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: perf: Check that current->mm is alive before getting user callchain
Date: Thu, 3 Jul 2014 18:53:07 +0100	[thread overview]
Message-ID: <20140703175306.GG17372@arm.com> (raw)
In-Reply-To: <1403881067-22690-2-git-send-email-jean.pihet@linaro.org>

On Fri, Jun 27, 2014 at 03:57:45PM +0100, Jean Pihet wrote:
> An event may occur when an mm is already released.
> 
> As per commit 20afc60f892d285fde179ead4b24e6a7938c2f1b
>  'x86, perf: Check that current->mm is alive before getting user callchain'
> 
> Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
> Cc: Will Deacon <will.deacon@arm.com>
> ---

Acked-by: Will Deacon <will.deacon@arm.com>

>  arch/arm/kernel/perf_event.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> index 4238bcb..6493c4c 100644
> --- a/arch/arm/kernel/perf_event.c
> +++ b/arch/arm/kernel/perf_event.c
> @@ -590,6 +590,10 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
>  	}
>  
>  	perf_callchain_store(entry, regs->ARM_pc);
> +
> +	if (!current->mm)
> +		return;
> +
>  	tail = (struct frame_tail __user *)regs->ARM_fp - 1;
>  
>  	while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
> -- 
> 1.8.1.2
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Jean Pihet <jean.pihet@linaro.org>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
	Sneha Priya <sneha.cse@hotmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@infradead.org>
Subject: Re: [PATCH 1/3] ARM: perf: Check that current->mm is alive before getting user callchain
Date: Thu, 3 Jul 2014 18:53:07 +0100	[thread overview]
Message-ID: <20140703175306.GG17372@arm.com> (raw)
In-Reply-To: <1403881067-22690-2-git-send-email-jean.pihet@linaro.org>

On Fri, Jun 27, 2014 at 03:57:45PM +0100, Jean Pihet wrote:
> An event may occur when an mm is already released.
> 
> As per commit 20afc60f892d285fde179ead4b24e6a7938c2f1b
>  'x86, perf: Check that current->mm is alive before getting user callchain'
> 
> Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
> Cc: Will Deacon <will.deacon@arm.com>
> ---

Acked-by: Will Deacon <will.deacon@arm.com>

>  arch/arm/kernel/perf_event.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> index 4238bcb..6493c4c 100644
> --- a/arch/arm/kernel/perf_event.c
> +++ b/arch/arm/kernel/perf_event.c
> @@ -590,6 +590,10 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
>  	}
>  
>  	perf_callchain_store(entry, regs->ARM_pc);
> +
> +	if (!current->mm)
> +		return;
> +
>  	tail = (struct frame_tail __user *)regs->ARM_fp - 1;
>  
>  	while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
> -- 
> 1.8.1.2
> 
> 

  reply	other threads:[~2014-07-03 17:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 14:57 [PATCH 0/3] ARM: perf: allow tracing with kernel tracepoints events Jean Pihet
2014-06-27 14:57 ` Jean Pihet
2014-06-27 14:57 ` [PATCH 1/3] ARM: perf: Check that current->mm is alive before getting user callchain Jean Pihet
2014-06-27 14:57   ` Jean Pihet
2014-07-03 17:53   ` Will Deacon [this message]
2014-07-03 17:53     ` Will Deacon
2014-06-27 14:57 ` [PATCH 2/3] ARM: perf: disable the pagefault handler when reading from user space Jean Pihet
2014-06-27 14:57   ` Jean Pihet
2014-07-03 17:52   ` Will Deacon
2014-07-03 17:52     ` Will Deacon
2014-07-07 13:40     ` Jean Pihet
2014-07-07 13:40       ` Jean Pihet
2014-06-27 14:57 ` [PATCH 3/3] ARM: perf: allow tracing with kernel tracepoints events Jean Pihet
2014-06-27 14:57   ` Jean Pihet
2014-07-03 17:54   ` Will Deacon
2014-07-03 17:54     ` Will Deacon
2014-07-07 13:42     ` Jean Pihet
2014-07-07 13:42       ` Jean Pihet
  -- strict thread matches above, loose matches on Subject: below --
2014-07-07 13:45 [PATCH 0/3] " Jean Pihet
2014-07-07 13:45 ` [PATCH 1/3] ARM: perf: Check that current->mm is alive before getting user callchain Jean Pihet
2014-07-07 13:45   ` Jean Pihet

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=20140703175306.GG17372@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 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.