Received: by 10.223.185.116 with SMTP id b49csp4188627wrg; Mon, 26 Feb 2018 12:51:00 -0800 (PST) X-Google-Smtp-Source: AH8x227gRIaOYzCePzs1ycPliXsNZhYUQUtqfz5kVU2A+doVmjakfiqFe/R+rROzJ1i+2Pe12EEE X-Received: by 10.98.190.3 with SMTP id l3mr11720287pff.155.1519678260245; Mon, 26 Feb 2018 12:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519678260; cv=none; d=google.com; s=arc-20160816; b=C9qYUclUjffiu+qWPQ3gv/EotEtkRFeN6EGo4UmnJEoROvvov45NxfC0BVdpQai0cI Ju+//zT73kiCzMsEbJPbHsmG0QKgTZ4Ss8T9Crs9wo4D1NlScujP5TNVOgbDdSpTzuNj WP0lEwHAO+k47M9lnpg2DZApchdvP6dO1WvRzTXx0AsN3OfnwmX7Qv5seRNJdcpx6g65 qadaQ8pnLMGpjdtV/1viJOu3+DgZlDLI+vpEZ5DQzkB2CJvL3tBjAYmTpd6qM0St1Kja kMnOC8mydPsYggUENC7HywWAxP4T7Cg54bH/volp0b/Ctgze2NFyfZyRaunoHvbI58da YEWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wXVW11F2Y0b1awvDAKpi3CRLwWbrIMsiflP8yzvwYhE=; b=SMRZpdCux71YKsKQzooxOuZiGIK0Svkq/MR//Td6P/QlfRKDD6MsAP4/wk2QOHWe4Z okK4OjbbrSLteQDC1srLsLgiu/JTWlbvJODAouqWyjstgBFfTzhoVObsf0mowGPJpUya mTeZrqw5Qhq02f4YKjeBSQYQUPW9THTEIDcG+QTLdl4OlBaVdMv8aoiPEV7c80lbpLKx XsRJNsZt7DWYre+SRWI0dUkjBU86g9aMjqoYFbHHoENnMiAgNUgzRDZKQvHnsWzogpJ8 pwiC3Cw9MxDnZsyhhVQpg0apF+4DEtyQaRZmo9KZ59LWQYNKetGH6+Dj3kBI0U1fI8FO 1x3w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si5958420pgc.482.2018.02.26.12.50.43; Mon, 26 Feb 2018 12:51: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055AbeBZUZA (ORCPT + 99 others); Mon, 26 Feb 2018 15:25:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35324 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159AbeBZUY6 (ORCPT ); Mon, 26 Feb 2018 15:24:58 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A5046FAD; Mon, 26 Feb 2018 20:24:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shanker Donthineni , Will Deacon , Catalin Marinas Subject: [PATCH 4.14 35/54] arm64: cpufeature: Fix CTR_EL0 field definitions Date: Mon, 26 Feb 2018 21:22:12 +0100 Message-Id: <20180226202146.129259164@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202144.375869933@linuxfoundation.org> References: <20180226202144.375869933@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon commit be68a8aaf925aaf35574260bf820bb09d2f9e07f upstream. Our field definitions for CTR_EL0 suffer from a number of problems: - The IDC and DIC fields are missing, which causes us to enable CTR trapping on CPUs with either of these returning non-zero values. - The ERG is FTR_LOWER_SAFE, whereas it should be treated like CWG as FTR_HIGHER_SAFE so that applications can use it to avoid false sharing. - [nit] A RES1 field is described as "RAO" This patch updates the CTR_EL0 field definitions to fix these issues. Cc: Cc: Shanker Donthineni Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpufeature.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -175,9 +175,11 @@ static const struct arm64_ftr_bits ftr_i }; static const struct arm64_ftr_bits ftr_ctr[] = { - ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RAO */ + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */ + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 29, 1, 1), /* DIC */ + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 28, 1, 1), /* IDC */ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 24, 4, 0), /* CWG */ - ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 20, 4, 0), /* ERG */ + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 20, 4, 0), /* ERG */ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */ /* * Linux can handle differing I-cache policies. Userspace JITs will