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 v2 4/4] arm64: document the cache policy behavior
Date: Fri, 30 Oct 2015 12:08:22 +0000	[thread overview]
Message-ID: <20151030120822.GH20030@arm.com> (raw)
In-Reply-To: <1446160842-25787-4-git-send-email-avanbrunt@nvidia.com>

On Thu, Oct 29, 2015 at 04:20:42PM -0700, Alex Van Brunt wrote:
> Add a comment that clairfies how the kernel should behave given the cache

clarifies

> policy reported by the CPU.
> 
> Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com>
> Cc: <stable@vger.kernel.org>
> ---
>  arch/arm64/kernel/cpuinfo.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index ae04ac1..bf7e5e2 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -49,6 +49,14 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)
>  	unsigned int cpu = smp_processor_id();
>  	u32 l1ip = CTR_L1IP(info->reg_ctr);
>  
> +	/*
> +	 * The ARM architecture defines PIPT, VIPT and AIVIVT in terms of the

-the

> +	 * the observable behavior not how the CPU implements the policy.

s/not/rather than/

> +	 * Specifically, the policies differentiate the correct way to
> +	 * invalidate the cache. The definitions say that the only
> +	 * architecturally guaranteed way to invalidate a VIPT or AIVIVT
> +	 * instruction cache is to invalidate the entire instruction cache.
> +	 */
>  	if (l1ip != ICACHE_POLICY_PIPT)
>  		set_bit(ICACHEF_ALIASING, &__icache_flags);
>  	if (l1ip == ICACHE_POLICY_AIVIVT)

With the minor cosmetic changes:

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

although I don't see how we can really apply this given that we're not
planning to revert the cache geometry stuff. Maybe you could spin a
separate series just addressing the aliasing I-cache detection, then we
can build on top of that?

Will

      reply	other threads:[~2015-10-30 12:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 23:20 [PATCH v2 1/4] Revert "arm64: kernel: add support for cpu cache information" Alex Van Brunt
2015-10-29 23:20 ` [PATCH v2 2/4] Revert "arm64: don't flag non-aliasing VIPT I-caches as aliasing" Alex Van Brunt
2015-10-29 23:20 ` [PATCH v2 3/4] Revert "arm64: add helper functions to read I-cache attributes" Alex Van Brunt
2015-10-29 23:20 ` [PATCH v2 4/4] arm64: document the cache policy behavior Alex Van Brunt
2015-10-30 12:08   ` Will Deacon [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=20151030120822.GH20030@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).