All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Huichun Feng <foxhoundsk.tw@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: Does clocksource arch_sys_counter synchronize across CPUs?
Date: Mon, 10 Jan 2022 17:30:55 +0000	[thread overview]
Message-ID: <87fspvts4w.wl-maz@kernel.org> (raw)
In-Reply-To: <CAFbkdV3KOGA863+TV9_uVWnmg75v-60R3qT0r-+LgQiyHM6BtA@mail.gmail.com>

On Mon, 10 Jan 2022 16:51:14 +0000,
Huichun Feng <foxhoundsk.tw@gmail.com> wrote:
> 
> Hi list,
> 
> AFAIK, one of the clocksource in arm64 (armv8.3, Rpi4) --

RPI4 is ARMv8.0 (not that it matters here).

> arch_sys_counter, uses a per-core register CNTVCT as the accessor.
> 
> And comes to consistency of CNTVCT's, after searching some of the
> related manuals [0-2], I didn't find statements saying that it is
> synchronize across CPUs. However, I've found a recent patch [3] says
> that CNTVCT is synchronized in armv8.6.
> 
> So, does CNTVCT synchronize across CPUs in armv8.3?

CNTVCT_EL0 is guaranteed to be identical across CPUs as long as
CNTVOFF_EL2 is identical across CPUs. That's because all the CPUs
source their counters from the same source (see the architecture spec
in section D11 for the details).

The patch you mention makes use of the *self-synchronisation* feature
of the CNTVCTSS_EL0 instruction. which guarantees that the instruction
won't be reordered wrt to other instructions in the stream, avoiding
the use of an ISB instruction. Nothing to do with cross-CPU
synchronisation, which has always been guaranteed (there are broken
system integrations though).

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2022-01-10 17:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 16:51 Does clocksource arch_sys_counter synchronize across CPUs? Huichun Feng
2022-01-10 17:30 ` Marc Zyngier [this message]

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=87fspvts4w.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=foxhoundsk.tw@gmail.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.