Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41972C43334 for ; Wed, 6 Jul 2022 07:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BTcjOwKZ/wUV0DsolsIzOfe4ECuJmvr0C3tBd5i0j9I=; b=o0ITVgdBqplpkF z01GJ+CsccI3aZbJyzEVG6+62r/afxCAZOJECgEnGrjgWVD3rgwTfiHrWf1FBnqv/HbBiJUFvmSBd elNBBbBVeT/usTk9TtZ0q4JHlOOMkDhC/ufOhPuTmwh1Fk3vrUbvxh666Um7l5dOEwbhSbRvY34Qs MMF+ThB/i3cAzD4zhLpWh39zQvcgvKZ5kdGYwG2qLG7ikemkbc72DkCEEn/FLBtgcbzp/pQeBf/Us Sxf8S6JwLM4NEI7yBdQSb2WYVTrkzkrXffIBoKPl7dMB5KHTQMZ8L5KbFPQ25fTntd2eRCT6xvRJK m+KkJa/4mQ1KNUGLp49w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8z5P-006vN2-Po; Wed, 06 Jul 2022 07:04:35 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8z50-006uwi-PL for linux-arm-kernel@lists.infradead.org; Wed, 06 Jul 2022 07:04:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 499441596; Wed, 6 Jul 2022 00:04:04 -0700 (PDT) Received: from [10.163.43.16] (unknown [10.163.43.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 698823F70D; Wed, 6 Jul 2022 00:04:02 -0700 (PDT) Message-ID: Date: Wed, 6 Jul 2022 12:33:59 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] arm64: errata: Add Cortex-A510 to the repeat tlbi list Content-Language: en-US To: James Morse , linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , Will Deacon References: <20220704155732.21216-1-james.morse@arm.com> From: Anshuman Khandual In-Reply-To: <20220704155732.21216-1-james.morse@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220706_000410_970544_F90EAF6E X-CRM114-Status: GOOD ( 24.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/4/22 21:27, James Morse wrote: > Cortex-A510 is affected by an erratum where in rare circumstances the > CPUs may not handle a race between a break-before-make sequence on one > CPU, and another CPU accessing the same page. This could allow a store > to a page that has been unmapped. > > Work around this by adding the affected CPUs to the list that needs > TLB sequences to be done twice. > > Signed-off-by: James Morse Reviewed-by: Anshuman Khandual > --- > I opted to add this as a new entry, as the writeup isn't the same as > the similar erratum on A76. > > Documentation/arm64/silicon-errata.rst | 2 ++ > arch/arm64/Kconfig | 17 +++++++++++++++++ > arch/arm64/kernel/cpu_errata.c | 8 +++++++- > 3 files changed, 26 insertions(+), 1 deletion(-) > > diff --git a/Documentation/arm64/silicon-errata.rst b/Documentation/arm64/silicon-errata.rst > index d27db84d585e..250306a37a65 100644 > --- a/Documentation/arm64/silicon-errata.rst > +++ b/Documentation/arm64/silicon-errata.rst > @@ -102,6 +102,8 @@ stable kernels. > +----------------+-----------------+-----------------+-----------------------------+ > | ARM | Cortex-A510 | #2077057 | ARM64_ERRATUM_2077057 | > +----------------+-----------------+-----------------+-----------------------------+ > +| ARM | Cortex-A510 | #2441009 | ARM64_ERRATUM_2441009 | > ++----------------+-----------------+-----------------+-----------------------------+ > | ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 | > +----------------+-----------------+-----------------+-----------------------------+ > | ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 | > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 1652a9800ebe..0ed35959b090 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -821,6 +821,23 @@ config ARM64_ERRATUM_2224489 > > If unsure, say Y. > > +config ARM64_ERRATUM_2441009 > + bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI" > + default y > + select ARM64_WORKAROUND_REPEAT_TLBI > + help > + This option adds a workaround for ARM Cortex-A510 erratum #2441009. > + > + Under very rare circumstances, affected Cortex-A510 CPUs > + may not handle a race between a break-before-make sequence on one > + CPU, and another CPU accessing the same page. This could allow a > + store to a page that has been unmapped. > + > + Work around this by adding the affected CPUs to the list that needs > + TLB sequences to be done twice. > + > + If unsure, say Y. > + > config ARM64_ERRATUM_2064142 > bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled" > depends on CORESIGHT_TRBE > diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c > index c05cc3b6162e..c846cf1814b7 100644 > --- a/arch/arm64/kernel/cpu_errata.c > +++ b/arch/arm64/kernel/cpu_errata.c > @@ -211,6 +211,12 @@ static const struct arm64_cpu_capabilities arm64_repeat_tlbi_list[] = { > /* Kryo4xx Gold (rcpe to rfpe) => (r0p0 to r3p0) */ > ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe), > }, > +#endif > +#ifdef CONFIG_ARM64_ERRATUM_2441009 > + { > + /* Cortex-A510 r0p0 -> r1p1. Fixed in r1p2 */ > + ERRATA_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1), > + }, > #endif > {}, > }; > @@ -480,7 +486,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { > #endif > #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI > { > - .desc = "Qualcomm erratum 1009, or ARM erratum 1286807", > + .desc = "Qualcomm erratum 1009, or ARM erratum 1286807, 2441009", > .capability = ARM64_WORKAROUND_REPEAT_TLBI, > .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, > .matches = cpucap_multi_entry_cap_matches, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel