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: 10812021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB689922 for ; Thu, 14 Feb 2019 08:32:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8BCA28A89 for ; Thu, 14 Feb 2019 08:32:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCAD32D9C1; Thu, 14 Feb 2019 08:32:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5CF2C28A89 for ; Thu, 14 Feb 2019 08:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=i6EyyAtMQLnQURaxrjqKAJ3SvRUA1m8E1yOXtCpisqg=; b=hyauM8jypUYmLGDnYKVV0A4X4u hSqrjJxbdxqS5c9oC3igo9EgWbwZKBQaieJUxV/4AM+Mgt+i0joq2G0bMx6K7nCShnjdBk4wWiZzO X9UV9wEmJ4gOp7kO7AsUMkKyfct1OaaIVZ2vd5/coeSYiJu7vKccuDTB0Orml5ukbYEsbp+vQER0R QTsVhtFhBLEa47GPs5B572zTKFEyRpg6QiFn3PsZf9ss4MfQ4/tDABySj7ft5AwVf4+wk+IPEmNNB +y6jPJsGaw959YAd7bynMCLpr9tgEGtYEIih98WplFEuXpuDGhWlhnH2hZQgEvvhcTvDDfrK/qDeY JSfchqmA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guCRE-0001fK-Ja; Thu, 14 Feb 2019 08:32:08 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guCQw-0001S3-TP for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2019 08:31:53 +0000 Received: by mail-wr1-x441.google.com with SMTP id q18so5429185wrx.9 for ; Thu, 14 Feb 2019 00:31:50 -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=X2hGw7qV3Do5VKZaIneOoKQWW1s60BtnXgH2NfRVmEGbXeL2p58e+csumXx+0+wFft pxLnkOPwAzAOKlkUScyBvthclY4V6qliBEfDi9Rah0jiGvSt01dhotdfHdQ/dV60kiWC GcxZmpwcc4+ickqWnO3mYxKtMhSbzGjZsLjYfr6/a1Qj5Ju5kwzoikiM7kxBUtubGFCN yn2s0Q1sDTH6vbos8iBTSLq+kWQghz4TjtZ9toIZbqOZ7yxdPbCQl+fVp7LqSSyO0H+J ndCaJXjYSG0Pg3PHHmN/luPFpclSI2hU9jyasS+34SWgnMqMV9vC3o8iKwlLvIba7Dvc VqEw== X-Gm-Message-State: AHQUAuYkPNXOxahSXZE2obbvPuJsBovRwCB9HYjqWNK4mkuRU9GwXs7q KmJRg5gmzNgpS2U800eCTHK/vw== X-Google-Smtp-Source: AHgI3IZ7812mQTxIJVCEVVxJtGQDYnJ315u3RayMIzoSbYNk5JJxfsxdD/EDap23VT72W7ZwAyrpfQ== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190214_003151_079754_9942AEBB X-CRM114-Status: GOOD ( 12.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: benjamin.gaignard@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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: 10812023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2AB1813A4 for ; Thu, 14 Feb 2019 08:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19A2128A89 for ; Thu, 14 Feb 2019 08:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D5872D9C1; Thu, 14 Feb 2019 08:32:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B8EEB28A89 for ; Thu, 14 Feb 2019 08:32:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GZfwHqIrp77KGA8qB2AWOTVCb3SK4L2qP5fldFk4R1A=; b=K9PAwQHZDkpj3dVZyNz9+x5i2a cL4UT5BXWs+iRfP3FP5c5TJGv7W4Wnyp1BXGANNN99sZ8b2AvYtPRVXKJq4K2QacWM3wQHbpPty5Y Yi1ijE7kOrf+GpU3Wr1gYtoo3lUrRgluqG66xUWXaRZCIT8ley78gfjWXBH+DqzmoUvUQm+OhpwLj n+hyZpoV7tZ4BPw0IVJ3OKbePMYzh/0KASjQ7Q0jDc8vMcjfml3KUcnf0MvcMdhdFhJ9N4YfCCcBY 3Yx61IgrW1eo4/Snbea2gJXNuwLMelfHM8ofKnSLEyD5s9LF51Mup9CVwcjzUEA3Q20sjB5P02AQy +IqmfwRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guCRT-0001vN-OU; Thu, 14 Feb 2019 08:32:23 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guCQy-0001SU-Jq for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2019 08:31:55 +0000 Received: by mail-wr1-x443.google.com with SMTP id r2so5422650wrv.10 for ; Thu, 14 Feb 2019 00:31:52 -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=gpd9hj70kC+bG5RCS0dGBxBVrC+Cs88pySbNXZNubtNUPUFLy79KVN7y/X1qgpyqQi SWAlRplIPGq4A5vG3BqnDf8Q+lSzvb70BvJ2MYUIadh8pBXyHVReKAgrykp1evP79K1D ndm40BHeDVViyQka2egVghV5DsnKJuBqPGL0GNDXF8dYV8JNXlnzxeWxC1/52+v0Qxax 6IGILCjQW099rjaOMrI5sYW6g+BK+vs0VJsq827ywFI95VRrl2F62hynHimsyKppI81b fJlZiSXrElG4KBaVgPZTFhoRSRSc6GnKjHuPMeLLR5btuWC2/TRDax5ALjPKC5+UWLOL na7A== X-Gm-Message-State: AHQUAuYKHBouBbxBoNefvsnU+3j0nJ6Lrf4CJI1LXIudHLwfLz3Lysun 4XIF2c4QxwdXzwFGEmws/MidYg== X-Google-Smtp-Source: AHgI3IaI9HhYQJmJbOenn3Ox4CqhbhWHyAbXzyLYanlwbz04Bz2Dn0aY4MhXRu2LOGnrXyjzuYQWuA== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190214_003152_650579_96A87613 X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: benjamin.gaignard@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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