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 2/2] ARM: perf: add required isbs() to ARMv7 backend
Date: Mon, 21 Mar 2011 18:22:04 -0000	[thread overview]
Message-ID: <002301cbe7f4$e1750450$a45f0cf0$@deacon@arm.com> (raw)
In-Reply-To: AANLkTinQJ_1Ym8jVHjRP80XzC0PKzR+o9-Fdk56WzEF8@mail.gmail.com

Hi Jean,

> > On Wed, Mar 16, 2011 at 4:38 PM, Will Deacon <will.deacon@arm.com> wrote:
> > > The ARMv7 architecture does not guarantee that effects from co-processor
> > > writes are immediately visible to following instructions.
> > >
> > > This patch adds two isbs to the ARMv7 perf code:
> > >
> > > (1) Immediately after selecting an event register, so that the PMU state
> > > ? ?following this instruction is consistent with the new event.
> > Ok
> >
> > >
> > > (2) Immediately before writing to the PMCR, so that any previous writes
> > > ? ?to the PMU have taken effect before (typically) enabling the
> > > ? ?counters.
> > Should the isb come _after_ the cp15 instruction so that the current
> > access is actually performed?
> 
> No. We want to ensure that the _other_ PMU registers are up-to-date before
> playing with the control register, otherwise we could end up in a horrible
> situation where we enable all the counters, but the writes to the counters
> themselves haven't yet made it.
> 
> The write to the control register will take effect before the next
> exception return, which is fine for what we want.

I'd like to submit this to the patch system if you're happy with it.
Are you OK with the barrier coming before the write to the PMCR?

Cheers,

Will

  parent reply	other threads:[~2011-03-21 18:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 15:38 [PATCH 1/2] ARM: perf: reset counters on all CPUs during initialisation Will Deacon
2011-03-16 15:38 ` [PATCH 2/2] ARM: perf: add required isbs() to ARMv7 backend Will Deacon
2011-03-16 16:00   ` Jean Pihet
2011-03-16 16:34     ` Will Deacon
2011-03-21 18:22     ` Will Deacon [this message]
     [not found]     ` <9133336726495377032@unknownmsgid>
2011-03-21 19:22       ` Jean Pihet
2011-03-22 13:24         ` Will Deacon
2011-03-16 15:58 ` [PATCH 1/2] ARM: perf: reset counters on all CPUs during initialisation Jean Pihet
2011-03-16 16:21   ` Will Deacon
2011-03-23 13:39   ` Will Deacon
     [not found]   ` <-7053270875332574934@unknownmsgid>
2011-03-23 15:01     ` Jean Pihet
2011-03-23 15:07       ` Will Deacon

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='002301cbe7f4$e1750450$a45f0cf0$@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).