Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp118818imj; Wed, 13 Feb 2019 05:42:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IbG8nhWrhK5jgO5Pevc7jur660trEv2OlvUnAfuPBHUc7Q2ShUNBn7+6jbDtfTNGyGSaIXk X-Received: by 2002:a65:6483:: with SMTP id e3mr514329pgv.273.1550065364338; Wed, 13 Feb 2019 05:42:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550065364; cv=none; d=google.com; s=arc-20160816; b=SlrRJb0W64ONKLm1btBPu8dCxBojldR/ToseLseG6o0VDTLzYbP4ASYBlOHvSoHKKM hGFy6kJ6XX5cmFNryTl4Dik8NkCONEGTkWsCHyOMXEx10859hIsongrrfCQGzjCNDVvl 82WS6Upw8W5ZZN1OetmAGc7ibVbKX8m5zplAqOMRUQGM88AgV8/GOlaKKS6BMO6fviLG E2rMxaXduZSYJ+rAUmnwaJ2dkIe/pvwsH3VdQWyPdZZ1t2wSt227pUSQLvjcoLkrH67M m80DapksUyE+cz3uoI21QToNXJOp5w0etL+42IvFpxfpgpx5AfiVSXLdETul3lSlPfRM B7KA== 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 l27si6109581pgm.456.2019.02.13.05.42.26; Wed, 13 Feb 2019 05:42:44 -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 S2391440AbfBMJ4c (ORCPT + 99 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(+) 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 -- 2.15.0