From patchwork Thu Feb 14 08:31:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 158328 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1075713jaa; Thu, 14 Feb 2019 00:31:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IbbV0058r4wJzQXSCP/lkQ4r3n0jsg4u2eOvekVt0nlWEyrkXfby+5HDoDUKA1nk4ayM1R3 X-Received: by 2002:a17:902:b690:: with SMTP id c16mr2968217pls.230.1550133115720; Thu, 14 Feb 2019 00:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550133115; cv=none; d=google.com; s=arc-20160816; b=m/Hzz4Ef4FjMA5gthmgDsnzlXImAmH8O/03V5DUESvu5BoGqKngmuj+psflrx3JJnR T9G70JjXKioJOFQ/BeEV9hLmHbd8HrpcHm0seDHUEMbs/nDcWxzqlqtqayXgsLvvtKJv 25/wDlC34Qs4tB7jg73+trYlcBI+BkUk6iLEORmiJrIxLrIjfoaR+463c+ctsvZZHjRE gu5sAUCo/bW/bzLWNz+bSHANOjfZJJ+bjIJ9vmrDcHU+qXQKgQM3Vc4uuV657HZfPe0s RGGkqtAj8gyZ+SiZjhEzZtIrQJrbgBNl58t2h0GEwo2SB+i1uOOIwBAsnX66ig7R9Uz4 QdbA== 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=aETyhdkQkvHWXNSQya3Fc4RoQ2actTCZCaWOfp10vwA=; b=ZuSRvDpqvItCPFUq6memUeMvH6ivmTIgoXW7YAs1i6MPP6EKgGOVZNL1EZQbMYfzIw 4KtaIQ6Bu1J14eMizjbfq/hI68k9l9GTGCU0FKimUHVNLsFsrASkZyUdQ+p0bo1rlpaJ KvQeTBmHLeCTAW5FQJIioYNCpF9Xua/M7KXalD+jrOcmZMgRy/HyUHl4HIAZ0WLVwG00 DBaltks1sWvNBnk6iMdLqk5xjFxP5AQJc9vjjrxThIvruvkchLybldWYaLvhlEDOBKXw E38IE1zL2s+Jt1TR0ENOfgkbUb1CIUYCShym8UO+qBMmd9gMvZ1Sn5M+uJsbTjiBmi8O MQEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=anbCKvZm; 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 d75si1757147pga.403.2019.02.14.00.31.55; Thu, 14 Feb 2019 00:31:55 -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=anbCKvZm; 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 S2390019AbfBNIby (ORCPT + 31 others); Thu, 14 Feb 2019 03:31:54 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46627 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbfBNIbu (ORCPT ); Thu, 14 Feb 2019 03:31:50 -0500 Received: by mail-wr1-f67.google.com with SMTP id l9so5408587wrt.13 for ; Thu, 14 Feb 2019 00:31:49 -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=aETyhdkQkvHWXNSQya3Fc4RoQ2actTCZCaWOfp10vwA=; b=anbCKvZm/IP+ag09X8eJe+Ob9itm7kKokx4A+I+60wRIRJI5tbcKKXlGZyDZO2bTz5 9qC0Zy+6BnhiwnBF4cK9TxA0oM6nzTxvwxw0X3iC5hPIHZE5Fi5zefarkf7RMCObXIim 7ffZ18mf+myGq4RncGg4OZHd7ZdIlQKGKHZBtF2VHgIzKLBDTDGyG55VBytDjsxgsyCh 2pGhBSF9rRqaFHX2Q4fmBDZ/OPa/3DvtJkfSy9Or7dJMnnKY7UzT8cfF3oB1jaI9JWgP u/OpFhg7L1eoVShSIpeP4KRcK4AugdFl76ZxBbu0zaNgFt6EH/cJLEiaP7tnKKtJyIX7 fvyA== 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=aETyhdkQkvHWXNSQya3Fc4RoQ2actTCZCaWOfp10vwA=; b=aJwG8cs3VdzVKFmluMYHUMspHcNvDkej34VLMNR2qQzUfizTOa84wIvWaXVAanQQpq w/3DnBfZf5lPzb4nZxNvpN3OFw7W7FppUmIZV8ljpwO/EFyTswjNF2m7icJt8rg+RPYo u++z/Q2M04LRHUYyIPRaKh39q0/1czQgKm/xI2RN02QEfW3Uxj2+qP50z1OM8eTzzZ/p sbepiMGRjWarBCFUA29+6RGu0gqIax4LN1xfXbGb3G6NiXAEcBpPMDBKob0F+cbPmnQG K3vpAFh3Q59LQiDI8LZ16qlqwJIk09Qe8YMCP/FV+lXesmfbEV1A+swhgnSeuk+wzW5t a57g== X-Gm-Message-State: AHQUAuZQwNJnAetlOArCUSJUYlO1iHsnI9Sp/RiV6KPnxDcmJTxRw8Td oNn6yQheN12RTKz538aK3D9XmQ== X-Received: by 2002:adf:90af:: with SMTP id i44mr1721227wri.222.1550133109095; Thu, 14 Feb 2019 00:31:49 -0800 (PST) Received: from lmecxl0911.lme.st.com ([2a04:cec0:104b:51c7:1dcf:5141:50b9:8a8]) by smtp.gmail.com with ESMTPSA id q6sm944673wmq.4.2019.02.14.00.31.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Feb 2019 00:31:48 -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@linaro.org Subject: [PATCH v2 1/2] ARM: errata 814220-B-Cache maintenance by set/way operations can execute out of order. Date: Thu, 14 Feb 2019 09:31:44 +0100 Message-Id: <20190214083145.15148-2-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190214083145.15148-1-benjamin.gaignard@linaro.org> References: <20190214083145.15148-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 Acked-by: Arnd Bergmann --- version 2: - limite help lines to 80 columns. - Add Arnd Bergmann acks. arch/arm/Kconfig | 12 ++++++++++++ arch/arm/mm/cache-v7.S | 3 +++ 2 files changed, 15 insertions(+) -- 2.15.0 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 664e918e2624..72b6ed478d1e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1227,6 +1227,18 @@ 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 Thu Feb 14 08:31:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 158329 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1075775jaa; Thu, 14 Feb 2019 00:32:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IZCHZ/2IS6+ATR1O1jbNbtoeifD4N+U1ZzBFjnMWlz+F0qZPRNyQPNz/y6tympoXYzdTDto X-Received: by 2002:a62:b403:: with SMTP id h3mr2830202pfn.34.1550133120031; Thu, 14 Feb 2019 00:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550133120; cv=none; d=google.com; s=arc-20160816; b=kzCl0ck+7fRRd00sJquiH2k/UGnxsI6Y7kkRWpVnIagAkwy9o8DJrxXoRpYdTJWgqF j8NHl47ZaIB2APJ0++jz6G7IRdA4FsELJ2rWAdeSdozXXyvWbmoCVsHRErHF2SFFJIQg 4N1rycHbnnLi83MAfn5ZbCjB3yP4mMgkJxP9UGO6ben4c/0LYX3MDW2tFSW66zGhyhZ6 lY1sPSa2mCaoq7hkqV361tLJEEQbtQnLwGGpU5OaZJoXbjLJJlvSOnt7SzZ8MJe0kGCV ivMT5iA+6viU7z1wMcFYGKtNN/eELFM60rBncc9+YUTBkK3/k2Wf198TycG595uwCbvc SLAQ== 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=tD91WMqXaqgalqYQc7fEccQT9a1D1s8fFsgbNnR5LZI=; b=wiAjh9D8t36so5tbgskc2yCCciQpbgGAesoOtrUOPQgOLtVmWEO8g4DokO2dvenl7J Jty/tzy8pCSfb3rK8FfV8E8lQpAe552kORqNNAf9nXYClt1uvcwzOwCjVtaJU7SxED2i UAnf2+axzijcbw2BxRHsypJcGs9+7LJhn+U/BPmIqXaxvsAnNQZeFfCV8jfbQTL1qbXS reSsoGUHFfuR5o38vmjT1e4+OpRZIUsF1n5X+ysdTr27hhkKHcHZy00Gy83QEXu4BO94 Jvh3FDyy8vZCNp1CRsS6B5mTM+IeCd1nQq8IsTTYhr7YaBKdcEXl0X/vtDT02OqAtqRB XjQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CfCP86VN; 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 x9si1992322pfe.254.2019.02.14.00.31.59; Thu, 14 Feb 2019 00:32:00 -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=CfCP86VN; 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 S2437504AbfBNIb6 (ORCPT + 31 others); Thu, 14 Feb 2019 03:31:58 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46630 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731646AbfBNIbw (ORCPT ); Thu, 14 Feb 2019 03:31:52 -0500 Received: by mail-wr1-f68.google.com with SMTP id l9so5408644wrt.13 for ; Thu, 14 Feb 2019 00:31:51 -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=tD91WMqXaqgalqYQc7fEccQT9a1D1s8fFsgbNnR5LZI=; b=CfCP86VNJP3saEW8dXsAgGRyMQ77IFzw2YxFhxp6j2BsNIqLwq9QD1MBeT5t+raGYe Lei1SuLaf2xEvUhJ+A41lp85+8WixEnaa/pbuU+U+xoZVa+tejh8Yr5CCm+SyJ44XzXX aerNrCQdu5wKiL7FSfyUsXDxanH1x1hZMz4Ca9I2fRnB04sLWyj40nVcWTXoDB87+Kgk vgG/kr9VVvvCdWHOz10tO5zQBD/ZI8uKdYg60aD+daI5DFcKiruTramEDewzC5S5QbTX +ad3pr7CFMfrWbnz6Kqt7XOZN3O6jc0Leb/hjzvCoLuyLq9Nmtzv1gEqVKD+vWdN2kk7 x75w== 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=tD91WMqXaqgalqYQc7fEccQT9a1D1s8fFsgbNnR5LZI=; b=saZ/Jvz8VfoZNGfzpf7gLiktxoPkiUwIdapC5y6r0/glPeIbaMOLD9BeN5Uq6L4CCJ NrTBpsPtUSQT5gzhKFGinfNAlM39/FutM9iZTeLGarfhAffvSAYqg31vMsIr9j+KyoQO 3B9+oWkTuzzpXYsstddKycyeXStFIp7zSfyy4CwOWSKUxj3dmYeHi37YN6JpJzqz+Bqj +yjX/H1yoTw5OZkmDB73C9InfCoaVIwnzbdYv6jGI4+va/QrSCjW3ZtUB9IPDH5XFkOi a3n0fCH5SAuVly3IEAgt3kQe+CU8kLlFoP1oJv02vYmC4iEbqt+s6WugBRazSjoIOHQ0 XgbQ== X-Gm-Message-State: AHQUAuamPV4L1KC+7RJbGkoXR9q/xwOWyJjkJonx16GinmfKl+z/qP2I eIrdh7rwZz0p80y0goVnrNOs5A== X-Received: by 2002:adf:e706:: with SMTP id c6mr1798741wrm.278.1550133110672; Thu, 14 Feb 2019 00:31:50 -0800 (PST) Received: from lmecxl0911.lme.st.com ([2a04:cec0:104b:51c7:1dcf:5141:50b9:8a8]) by smtp.gmail.com with ESMTPSA id q6sm944673wmq.4.2019.02.14.00.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Feb 2019 00:31:50 -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@linaro.org Subject: [PATCH v2 2/2] ARM: stm32: select ARM errata 814220 Date: Thu, 14 Feb 2019 09:31:45 +0100 Message-Id: <20190214083145.15148-3-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190214083145.15148-1-benjamin.gaignard@linaro.org> References: <20190214083145.15148-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 Acked-by: Arnd Bergmann --- 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