From patchwork Mon Feb 19 14:41:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 128809 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3580640ljc; Mon, 19 Feb 2018 06:41:38 -0800 (PST) X-Google-Smtp-Source: AH8x227BcnXJVqegXnptg1Gt23RQW3gAfEKOJBuKsLOKRydYz7PAum5v/cWuo+vxHKH5yKMbo0BQ X-Received: by 2002:a17:902:d83:: with SMTP id 3-v6mr10131618plv.47.1519051298734; Mon, 19 Feb 2018 06:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519051298; cv=none; d=google.com; s=arc-20160816; b=y720S+R8jiLCabbpR+SZdP2DLNMxuU9ajV19SzbQEdxs/XJcWGwbjVzfbA7hnCgG49 srkBjX5fcknakKf1AphBO5N3J2UcIfALH5CJJo0fZVw8MciqELaMH2DGzmcKjAprS3/Q oEJhIAlYAvplqSOsyQvMnm87doMoH4g1O89myUehtWzJo/toMDOkDfCyNW8xul0yPZSY 0Lb+xytI+6LH5DNw/g5L5kZuYYy9yXP2nvSmRIj8VRTuOL88IMamClEsOa+aB/p6x6GO 0FPAG1Efn/hjREXjPJFYpPPqNUD//Lc8B/kAevUgnXK2Ibo1d03Vv+SHu4pGwSVquOzb CIrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wo6XIgpucIcF6B2pNoQ4XniGpTY01VaWwwyJ8DEA8Bo=; b=O/tblJt1X+MqCvYDpSWezeZgSfNuQYYUxuTRCAZxiApAv/WAmCMf6PKwhML8B8zVCN Gstahcm7zFNRHjH/+VERe1jDgjnzYisNmhVWeaEhqs0CLKsHqcs26pI9c1umZwtvsZOF Ak5WlMNr5dP6oambsgb6BVAvNqP0r+2Nd4rd0tqgkqBJ3DWKoGbeaDS2zrm1rtMA0Jfk FlBana4fhnKg9bbu/A+qD1VFnXLADHO1pchrLrpWiP7DcANMY39Dm/YyWBqCkvnL0rtx Juzku8HIp2FZl2xYl85n74/703n9PKOEjeu5mLEPRPYLpxvzxtADD0Ec60JBSB1xH7XR xtNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 r26si6743995pgd.654.2018.02.19.06.41.38; Mon, 19 Feb 2018 06:41:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752306AbeBSOli (ORCPT + 10 others); Mon, 19 Feb 2018 09:41:38 -0500 Received: from foss.arm.com ([217.140.101.70]:59978 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbeBSOlh (ORCPT ); Mon, 19 Feb 2018 09:41:37 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 760301529; Mon, 19 Feb 2018 06:41:37 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 46A2A3F41F; Mon, 19 Feb 2018 06:41:37 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 3498D1AE11BC; Mon, 19 Feb 2018 14:41:46 +0000 (GMT) From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, Will Deacon , , Shanker Donthineni Subject: [PATCH] arm64: cpufeature: Fix CTR_EL0 field definitions Date: Mon, 19 Feb 2018 14:41:44 +0000 Message-Id: <1519051304-25141-1-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- arch/arm64/kernel/cpufeature.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.1.4 diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 29b1f873e337..2985a067fc13 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -199,9 +199,11 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr2[] = { }; 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