From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/4] arm64: Work around Falkor erratum 1003
Date: Tue, 31 Jan 2017 12:37:36 +0000 [thread overview]
Message-ID: <20170131123735.GD11191@leverpostej> (raw)
In-Reply-To: <20170125155232.10277-2-cov@codeaurora.org>
On Wed, Jan 25, 2017 at 10:52:30AM -0500, Christopher Covington wrote:
> The Qualcomm Datacenter Technologies Falkor v1 CPU may allocate TLB entries
> using an incorrect ASID when TTBRx_EL1 is being updated. When the erratum
> is triggered, page table entries using the new translation table base
> address (BADDR) will be allocated into the TLB using the old ASID. All
> circumstances leading to the incorrect ASID being cached in the TLB arise
> when software writes TTBRx_EL1[ASID] and TTBRx_EL1[BADDR], a memory
> operation is in the process of performing a translation using the specific
> TTBRx_EL1 being written, and the memory operation uses a translation table
> descriptor designated as non-global. EL2 and EL3 code changing the EL1&0
> ASID is not subject to this erratum because hardware is prohibited from
> performing translations from an out-of-context translation regime.
>
> Consider the following pseudo code.
>
> write new BADDR and ASID values to TTBRx_EL1
>
> Replacing the above sequence with the one below will ensure that no TLB
> entries with an incorrect ASID are used by software.
>
> write reserved value to TTBRx_EL1[ASID]
> ISB
> write new value to TTBRx_EL1[BADDR]
> ISB
> write new value to TTBRx_EL1[ASID]
> ISB
>
> When the above sequence is used, page table entries using the new BADDR
> value may still be incorrectly allocated into the TLB using the reserved
> ASID. Yet this will not reduce functionality, since TLB entries incorrectly
> tagged with the reserved ASID will never be hit by a later instruction.
Based on my understanding that entries allocated to the reserved ASID
will not be used for subsequent page table walks (and so we don't have
asynchronous behaviour to contend with), this sounds fine to me.
Thanks for taking the time to clarify the details on that.
> Based on work by Shanker Donthineni <shankerd@codeaurora.org>
>
> Signed-off-by: Christopher Covington <cov@codeaurora.org>
> ---
> Documentation/arm64/silicon-errata.txt | 1 +
> arch/arm64/Kconfig | 11 +++++++++++
> arch/arm64/include/asm/assembler.h | 23 +++++++++++++++++++++++
> arch/arm64/include/asm/cpucaps.h | 3 ++-
> arch/arm64/include/asm/mmu_context.h | 8 +++++++-
> arch/arm64/kernel/cpu_errata.c | 7 +++++++
> arch/arm64/mm/context.c | 11 +++++++++++
> arch/arm64/mm/proc.S | 1 +
> 8 files changed, 63 insertions(+), 2 deletions(-)
Don't we need to use pre_ttbr0_update_workaround in <asm/asm-uaccess.h>
for CONFIG_ARM64_SW_TTBR0_PAN? We implicitly switch to the reserved ASID
for the empty table in __uaccess_ttbr0_disable.
That also means we have to invalidate the reserved ASID so as to not
accidentally hit while uaccess is disabled.
Thanks,
Mark.
next prev parent reply other threads:[~2017-01-31 12:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 15:52 [PATCH v4 1/4] arm64: Define Falkor v1 CPU Christopher Covington
2017-01-25 15:52 ` [PATCH v4 2/4] arm64: Work around Falkor erratum 1003 Christopher Covington
2017-01-27 14:38 ` Mark Rutland
2017-01-27 14:43 ` Mark Rutland
2017-01-27 21:52 ` Christopher Covington
2017-01-30 10:56 ` Mark Rutland
2017-01-30 22:09 ` Christopher Covington
2017-01-27 19:18 ` Timur Tabi
2017-01-31 12:37 ` Mark Rutland [this message]
2017-01-31 17:48 ` Christopher Covington
2017-01-31 17:56 ` Marc Zyngier
2017-02-01 16:29 ` Christopher Covington
2017-02-01 16:33 ` Will Deacon
2017-02-01 17:36 ` Catalin Marinas
2017-02-01 17:41 ` Will Deacon
2017-02-01 17:49 ` Catalin Marinas
2017-02-01 17:51 ` Catalin Marinas
2017-02-01 17:59 ` Will Deacon
2017-02-01 18:22 ` Catalin Marinas
2017-02-01 18:34 ` Will Deacon
2017-02-01 18:38 ` Catalin Marinas
2017-02-08 0:36 ` Christopher Covington
2017-01-25 15:52 ` [PATCH v4 3/4] arm64: Use __tlbi() macros in KVM code Christopher Covington
2017-01-25 19:39 ` Christoffer Dall
2017-01-27 13:53 ` Will Deacon
2017-02-01 17:02 ` Punit Agrawal
2017-02-01 17:08 ` Will Deacon
2017-02-01 17:14 ` Punit Agrawal
2017-01-27 15:03 ` Will Deacon
2017-01-25 15:52 ` [PATCH v4 4/4] arm64: Work around Falkor erratum 1009 Christopher Covington
2017-01-27 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=20170131123735.GD11191@leverpostej \
--to=mark.rutland@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).