linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6] arm64: Work around Falkor erratum 1003
Date: Wed, 8 Feb 2017 16:34:41 +0000	[thread overview]
Message-ID: <20170208163441.GC32756@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <20170208003516.9519-1-cov@codeaurora.org>

On Tue, Feb 07, 2017 at 07:35:16PM -0500, Christopher Covington wrote:
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -480,6 +480,18 @@ config CAVIUM_ERRATUM_27456
>  
>  	  If unsure, say Y.
>  
> +config QCOM_FALKOR_ERRATUM_1003
> +	bool "Falkor E1003: Incorrect translation due to ASID change"
> +	default y
> +	select ARM64_PAN if ARM64_SW_TTBR0_PAN
> +	help
> +	  On Falkor v1, an incorrect ASID may be cached in the TLB when ASID
> +	  and BADDR are changed together in TTBRx_EL1. The workaround for this
> +	  issue is to use a reserved ASID in cpu_do_switch_mm() before
> +	  switching to the new ASID.
> +
> +	  If unsure, say Y.

It would be good to have a comment here on why PAN is selected.

> --- a/arch/arm64/mm/context.c
> +++ b/arch/arm64/mm/context.c
> @@ -79,6 +79,13 @@ void verify_cpu_asid_bits(void)
>  	}
>  }
>  
> +static void set_reserved_asid_bits(void)
> +{
> +	if (IS_ENABLED(CONFIG_QCOM_FALKOR_ERRATUM_1003) &&
> +	    cpus_have_cap(ARM64_WORKAROUND_QCOM_FALKOR_E1003))
> +		__set_bit(FALKOR_RESERVED_ASID, asid_map);
> +}

You should use cpus_have_const_cap() as it would be optimised using jump
labels.

-- 
Catalin

  reply	other threads:[~2017-02-08 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08  0:35 [PATCH v6] arm64: Work around Falkor erratum 1003 Christopher Covington
2017-02-08 16:34 ` Catalin Marinas [this message]
2017-02-08 20:09   ` Christopher Covington

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=20170208163441.GC32756@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@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).