From patchwork Wed Feb 13 09:56:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 158201 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4858417jaa; Wed, 13 Feb 2019 01:56:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IbBUrfKUnXipDEcKPEErJfBUjcQHfT/oj6rSVkUXU5VlrKLmiPkiV4WZkLEAqq4z3T6XmmE X-Received: by 2002:a17:902:6681:: with SMTP id e1mr8809505plk.98.1550051793941; Wed, 13 Feb 2019 01:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051793; cv=none; d=google.com; s=arc-20160816; b=el3IHNacQU3Hum0+sOuMsCa4lA89V5MXK0lO7AnD5cEtT5ON2+varJJVxhmYjLtDmU IGOuO1lsD6jj1F7dcy5+36KzV3YdyFw64QVBaLorg3IHyG4JvJrfZlvTMOYOTtc9w7H9 6dRYhWY+2PGNKJFjUU4ketfNAf7M7iNh6EaAkA2CuickFt1q3JqId1MXN0GMJw09sT7u Gu6LpHrPrBrDjC0uclOgNS4VAhzrL67DQh8jQztxomEH0wesM5D9HGI3RJI/aGXTSaJ4 0g1TOLP9UjC+2KK+LFyUrazxID/yyfV9aL57QtA7H4HWhAIe96vXryy1zXsftoKL5YuT ShBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=fM3DtWzdm7lzNMZ5rtfBSNROL8nNsUNCCP9M4XkP7Cs=; b=Pj3dkn1j2oTvHsGr/R98lfdk+o8UT/oP5+xBuwVviqspaEsgSg2HB8iGKXhvGCYKl5 ddJbNhVh22Hw0Kc7NvxB3V/Lebqu0WAA7eO+UjpiV2+bUVvRQkAeCcThHazLTFAt3uR0 aHPnTPWSIcjlJh5iF49a4nlBdNzYwi/2CPkUlyRQObC9gE7+XI34tVxibnbjd4hpdY2v maFodIYWI737R1Ob/Z1QTbYKDNncq6JGE0XnJC/+zI2oQb4KN9xyPnk//zMmpQpvKo3n jFvDq+sGRtp3CikcXUoRQraXHzxD+NqTHMUv1w0bpqAMmscWCy9wpMhzmKGZ/Dxulxy4 56Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IS05PJ+A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i35si16300583plg.396.2019.02.13.01.56.33; Wed, 13 Feb 2019 01:56:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IS05PJ+A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391444AbfBMJ4c (ORCPT + 31 others); Wed, 13 Feb 2019 04:56:32 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34679 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388982AbfBMJ4U (ORCPT ); Wed, 13 Feb 2019 04:56:20 -0500 Received: by mail-wr1-f66.google.com with SMTP id f14so1765441wrg.1 for ; Wed, 13 Feb 2019 01:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fM3DtWzdm7lzNMZ5rtfBSNROL8nNsUNCCP9M4XkP7Cs=; b=IS05PJ+AujhhHNnbN/gJsZA9ubDgDZV+VgnzCvaP8/104J+n/9CKqBbRAO4lQVKcD/ aA9o+KITB2HYtwyAlhLrVwa4dGDCziuw/XmE9Ofkbn668lrGbMHQnB8aWRlEkuRDJ9pP p0SPNqcrS84DSGImVJnFSd2ERHyK+jV9nBAW8Et4eMxOXlTGSfuKNoX8kmXlXDUbTcF8 4NEEbl2oywDAaIADntO73bbsQCs5DtsXRsqHQ9PI1PzHqfdPlXXS45FIMFlcjkGIXgZd 7/AEL3HKvDB22qaxFuJZrmXjJnTV/EeY6i7G2MMSp2IS1kQUpYCIox87Mawy/RKkJrKS o1yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fM3DtWzdm7lzNMZ5rtfBSNROL8nNsUNCCP9M4XkP7Cs=; b=LQCXxLTM13U5Cw9UURY6HyfO2YQFNxJIj1Gp/GrhU4GidC+aDFQmXHaNmIeYgeqGT6 ACDP+BlaMe1uw5yvXYLmOtJ1+GCEuTmX/jgKwukkP40FG4NWeNnjFN32lTqEGR05sz2U W4NfrOj0UinflTwD9fn6xR1QhaA8H6xEDhdpP72D22FFMi0jvszrJMe798MSRlqoC2Sy A+/yN7TIKuCPlWriSIJTAYyZphbazEzD24PKnz3hGfIGn9rlN3eYM70VrJeQCzndutgl tt1eC1duXjGlovSMIBMnC0Nx7pVqmPwKKt9a9ked2RpwnJxR+WDkc30Pw41sXqY5auLi tdKw== X-Gm-Message-State: AHQUAuZ9xIWU9w2CHRkgfhnQV1ft/BP5BgjJuqKn4Rt0jIVSaFFrmLY5 XLgDnaCxzREctP2dsF/PjjaLKw== X-Received: by 2002:adf:8919:: with SMTP id s25mr6317360wrs.38.1550051778345; Wed, 13 Feb 2019 01:56:18 -0800 (PST) Received: from lmecxl0911.lme.st.com ([2a04:cec0:1008:7bdd:48fa:e18e:8893:ae85]) by smtp.gmail.com with ESMTPSA id 2sm41244909wrj.27.2019.02.13.01.56.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Feb 2019 01:56:17 -0800 (PST) From: Benjamin Gaignard To: linux@armlinux.org.uk, arnd@arndb.de, alexandre.torgue@st.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Benjamin Gaignard , Jason Liu Subject: [PATCH 1/2] ARM: errata 814220-B-Cache maintenance by set/way operations can execute out of order. Date: Wed, 13 Feb 2019 10:56:12 +0100 Message-Id: <20190213095613.31045-2-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190213095613.31045-1-benjamin.gaignard@linaro.org> References: <20190213095613.31045-1-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Description: The v7 ARM states that all cache and branch predictor maintenance operations that do not specify an address execute, relative to each other, in program order. However, because of this erratum, an L2 set/way cache maintenance operation can overtake an L1 set/way cache maintenance operation, this would cause the data corruption. This ERRATA affected the Cortex-A7 and present in r0p2, r0p3, r0p4, r0p5. This patch is the SW workaround by adding a DSB before changing cache levels as the ARM ERRATA: ARM/MP: 814220 told in the ARM ERRATA documentation. Signed-off-by: Jason Liu Signed-off-by: Benjamin Gaignard --- arch/arm/Kconfig | 10 ++++++++++ arch/arm/mm/cache-v7.S | 3 +++ 2 files changed, 13 insertions(+) -- 2.15.0 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 664e918e2624..6f608558e22a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1227,6 +1227,16 @@ config PCI_HOST_ITE8152 default y select DMABOUNCE +config ARM_ERRATA_814220 + bool "ARM errata: Cache maintenance by set/way operations can execute out of order" + depends on CPU_V7 + help + The v7 ARM states that all cache and branch predictor maintenance operations + that do not specify an address execute, relative to each other, in program order. + However, because of this erratum, an L2 set/way cache maintenance operation can + overtake an L1 set/way cache maintenance operation. This ERRATA only affected the + Cortex-A7 and present in r0p2, r0p3, r0p4, r0p5. + endmenu menu "Kernel Features" diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index 2149b47a0c5a..7ff7b4c197cc 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -163,6 +163,9 @@ loop2: skip: add r10, r10, #2 @ increment cache number cmp r3, r10 +#ifdef CONFIG_ARM_ERRATA_814220 + dsb +#endif bgt flush_levels finished: mov r10, #0 @ switch back to cache level 0 From patchwork Wed Feb 13 09:56:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 158200 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4858332jaa; Wed, 13 Feb 2019 01:56:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IZaU4htAfgNtv3ff+rF2FMR7AVrVoS1CoA17bjeHlfpra87cFuu79HmuLPraYLdYeGssaf2 X-Received: by 2002:a17:902:6b49:: with SMTP id g9mr8998427plt.291.1550051788977; Wed, 13 Feb 2019 01:56:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051788; cv=none; d=google.com; s=arc-20160816; b=kUVys5w6MKDfEqmD8RJEkyw8KCk9LivuMoP0kIKYzDq8svdgDs7VydyXQYCREFGsPT Ej7UgOtadJbEatmnYNcKyHymOi20lZCDEoLLI36n1unTD/QeW5sccKcemQc7oAR69jpv b6ddhzXxuFukn1ewGOoXZdGtDB7FBSJ83azRW3SFbPP4lgS5wgnO33ivXxFsapchmKmY UfOwZOxjVtFWgpOdYiGLSfC6AE9Hd7asjpYZEt/jJ3F/PNyvAKXlT55DZBp2SFCR0l9+ IXnHiT7aY5Q4fIPISh9qsZt56vxFGoH+aeOcB61wa41rRgchk4VtHIbzzN2k1it6Av/N tcPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=c+xpQ8Cv9S1rQLFgHBKpoTDBY527By8Ao8JL0Wyb+h4=; b=MKkbCqEmGVHcUypY6T8G8zTN76guR3wzpBTEKfDv5I4LwF3ZhWh3t819fYYL6FseU6 roQNGdigfiBRDhCHbAJvQGetI3T64UIXx4R0ixt9OCr+Wc8N4cpmzrV1iwbbUICpms6c NdZOAGi19pNMzJZTRPlIuIjR/cNvLxPpRFoVJAw/Nbywbi90jp+gI54wpMMpIQDYd+WL vWOGEX4zxKPfikP9TUmbFM81Up6KvVb3kfJLmLHZ7Rcu2GVPeqTT9+SVvcUfhrlBzK5s hg7e6dnSAvNyPBl9FgyqpyzEi40zecpDdqe8INQgkTwN1ivvNFL/W8K2JuZ0oWHkfH9v wTTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SPsLdv9/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i35si16300583plg.396.2019.02.13.01.56.28; Wed, 13 Feb 2019 01:56:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SPsLdv9/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388791AbfBMJ40 (ORCPT + 31 others); Wed, 13 Feb 2019 04:56:26 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35451 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388917AbfBMJ4V (ORCPT ); Wed, 13 Feb 2019 04:56:21 -0500 Received: by mail-wr1-f68.google.com with SMTP id t18so1759375wrx.2 for ; Wed, 13 Feb 2019 01:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c+xpQ8Cv9S1rQLFgHBKpoTDBY527By8Ao8JL0Wyb+h4=; b=SPsLdv9/2+cGVKRHeOMBZ4eo31XIm8OAw1Y41wWWkOhU+aMle8fRs6CTn9BD/1YM1s VMs/v78ereqECZ/4pomBUxpprLZ1+d8KsFBJX3JZ2pVpQ4THXwvdMwIpwz3p7ISTXSx0 4yFDVtGwfx2tCNm3oaSdMSBHfKAmVwRVQQFykWztlUtMrx5FZ9ckWt2GMvZvjhbcsJVj RQa1kZDBuWoN+UUFtwsEbIEBH0liNmSFny9F6+DdM6BzExUgHadT3libtRnyViEy8yQW 4WSJedEbO2VQFG/AvBXz/ufQpZbfWASrl0IT4k3NrELxcBMhFKxP9K9LavK+JAS+LMJ2 4SOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c+xpQ8Cv9S1rQLFgHBKpoTDBY527By8Ao8JL0Wyb+h4=; b=BQW0ccRNG1ButA7k0sy0+hj2cH/F1fRcFoa/WaMfrjm5AdRRvwkfbpyfrR4n4PsECq 7snicyovHmuKnM/HN3GVx5zyI2kW8SVWGRLwa+nsXMZM1WD75tOLzpITCKyyylzgPnf9 k3YtH1m2XtUmxWA/nbGGAQj1xgliULcqH/VJyxYjs7+0wRT8EX5zU/O/kuYwnJZJEwHg cCjaguZs//mHHV8LmrMuDge6HT/vny4VIRx0Zh8LKr0pdulcWojUP9/A6pfPQR2zNDpV C87O3gZQrMba0BQ/MPFeXVA9hc5510ZPMJUerag/AKFEIMgOcVCYpVQO7yaBEvxVn2Ry 7U8g== X-Gm-Message-State: AHQUAuZaWtxwt3IOGhn+n3ywPQtykliY+mu5MZrua5TmbZ42QkKq9KEv VsNmoLZroDihuj11pQsZhCjvFg== X-Received: by 2002:a5d:4a89:: with SMTP id o9mr6181198wrq.323.1550051779598; Wed, 13 Feb 2019 01:56:19 -0800 (PST) Received: from lmecxl0911.lme.st.com ([2a04:cec0:1008:7bdd:48fa:e18e:8893:ae85]) by smtp.gmail.com with ESMTPSA id 2sm41244909wrj.27.2019.02.13.01.56.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Feb 2019 01:56:18 -0800 (PST) From: Benjamin Gaignard To: linux@armlinux.org.uk, arnd@arndb.de, alexandre.torgue@st.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Benjamin Gaignard Subject: [PATCH 2/2] ARM: stm32: select ARM errata 814220 Date: Wed, 13 Feb 2019 10:56:13 +0100 Message-Id: <20190213095613.31045-3-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190213095613.31045-1-benjamin.gaignard@linaro.org> References: <20190213095613.31045-1-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure that ARM errata 814220 is selected by STM32MP157 SoC Signed-off-by: Benjamin Gaignard --- arch/arm/mach-stm32/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.15.0 diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig index 713c068b953f..be2403fa3deb 100644 --- a/arch/arm/mach-stm32/Kconfig +++ b/arch/arm/mach-stm32/Kconfig @@ -46,6 +46,7 @@ if ARCH_MULTI_V7 config MACH_STM32MP157 bool "STMicroelectronics STM32MP157" + select ARM_ERRATA_814220 default y endif # ARMv7-A