linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Rich Wiley <rwiley@nvidia.com>
Cc: will@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: kernel: disable CNP on Carmel
Date: Wed, 17 Feb 2021 11:25:12 +0000	[thread overview]
Message-ID: <20210217112512.GE17184@arm.com> (raw)
In-Reply-To: <20210217013151.30351-1-rwiley@nvidia.com>

On Tue, Feb 16, 2021 at 05:31:51PM -0800, Rich Wiley wrote:
> On NVIDIA Carmel cores, CNP behaves differently than it does on standard
> ARM cores. On Carmel, if two cores have CNP enabled and share an L2 TLB
> entry created by core0 for a specific ASID, a non-shareable TLBI from
> core1 may still see the shared entry. On standard ARM cores, that TLBI
> will invalidate the shared entry as well.
> 
> This causes issues with patchsets that attempt to do local TLBIs based
> on cpumasks instead of broadcast TLBIs. Avoid these issues by disabling
> CNP support for NVIDIA Carmel cores.
> 
> Signed-off-by: Rich Wiley <rwiley@nvidia.com>
> ---
>  arch/arm64/kernel/cpufeature.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 9fac745aa7bb..2aa38a430f6a 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -986,6 +986,12 @@ static bool has_cache_dic(const struct arm64_cpu_capabilities *entry,
>  	return ctr & BIT(CTR_DIC_SHIFT);
>  }
>  
> +static bool cpu_has_broken_cnp(void)
> +{
> +	const struct midr_range range = MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL);
> +	return is_midr_in_range(read_cpuid_id(), &range);
> +}

Since this is a CPU erratum, can you please implement it as other errata
workarounds we have in the kernel? You'd need to provide an erratum
number for this CPU as well. You could make the .capability definition
of the erratum entry more generic like ARM64_WORKAROUND_BROKEN_CNP.

Thanks.

-- 
Catalin

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

  parent reply	other threads:[~2021-02-17 11:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  1:31 [PATCH] arm64: kernel: disable CNP on Carmel Rich Wiley
2021-02-17  5:13 ` Anshuman Khandual
2021-02-17 11:22   ` Catalin Marinas
2021-02-17 11:25 ` Catalin Marinas [this message]
2021-02-17 18:06   ` 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=20210217112512.GE17184@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=rwiley@nvidia.com \
    --cc=will@kernel.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).