From patchwork Mon Aug 5 17:13:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 170610 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4551875ile; Mon, 5 Aug 2019 10:13:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYLeloq3dNmSyHhQdJ3GldeRoP6o4eqWx2hlQ6wXf0SpYL8icnFoSTp/qvwfCPZF9zK3h8 X-Received: by 2002:a62:2b81:: with SMTP id r123mr71590500pfr.108.1565025198871; Mon, 05 Aug 2019 10:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565025198; cv=none; d=google.com; s=arc-20160816; b=tBzFb7jF/GTTwyaecuwM+/gVme3wvM2cD6bX3kqJpKmaNxY8aY/96KwgYHvUaJwnaj xuS/MvpIlNwVa+E7aewmpj/5aPT1d+vTVWFo63SAfbRXqDhWOE5yHLYkmdJHGo3LUW09 IOiDf+0l4lqVaoTe2pWDxyAxJlGwPoQ6AWXeKKU2VYb9J/aLAPyTsi6C0/Dpd3X0Ki4v 50U3qA/DVD8vtQZuzjML3Al2kFFx6xWnPUlD02KTcZ8useofUXMkthm8pff4nT+GfGMJ 6xSHjnijNW53XlLuzqNk2+6hpFLxqNtbu1QRARKknY/sm7m8XOPuS43X2+j297yQYaUe TPoQ== 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=wbTDxNIadyZkRprmaJ6Gpor5gBQ+aLq5DTscl6ciV7A=; b=VrzhU4X4rg/V7W8uA79+bzxkWYLvq19tE07Z84OCKN320D3cHF6p7tC0gXADZTSoHr SYrgDTYZ+L9JVriCJaNXhIB1s6DU8rHTeyMGvaozsZ/jqjsRQlvTKwRrAojv5AJktSpO QFk3NER88KGpgbZxGgnW1ofP2QD6Ay7wKWKRB6/b+7NUnjXgsUX/L1nKtXRjOeo6aYR3 7OulpP+ApsHmB80gcVM9xY/1ybYJHunYNVVQAHPq/aQZSJ3VBasPzOiBoen94sySw/Ty C2rpMj8gKASkHXdB6u4Y5/0+ESvs2sjHsAzFNina79aCZ2m6zaloPPrZ5tAioO7uoVPW AFpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vJlKKkHf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si46554505pfb.60.2019.08.05.10.13.18; Mon, 05 Aug 2019 10:13:18 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=vJlKKkHf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729889AbfHERNS (ORCPT + 14 others); Mon, 5 Aug 2019 13:13:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:48584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729539AbfHERNS (ORCPT ); Mon, 5 Aug 2019 13:13:18 -0400 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B8334208E3; Mon, 5 Aug 2019 17:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565025197; bh=5ISqReixmpEIQdd6aS7fvFeHnDIsx1DcPbm2MMGxbDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJlKKkHfSHiiGTL8Jy9tpe5e5JC72+LDU8RMHl/g9WEQA/cb+13d6vhOF2YCtRrmB P7rtvNaoXAgvpLk4KhdV8KzdwYPyiD19cKEJx6wAL+j3b+kT5H37Vjd0HTIBdbr++y FYoJUyi80ZqKTCId4GWrnBUDpoesIly8cwzd3EF8= From: Will Deacon To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Will Deacon , Shanker Donthineni , Will Deacon Subject: [PATCH 1/2] arm64: cpufeature: Fix CTR_EL0 field definitions Date: Mon, 5 Aug 2019 18:13:07 +0100 Message-Id: <20190805171308.19249-2-will@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190805171308.19249-1-will@kernel.org> References: <20190805171308.19249-1-will@kernel.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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: # 4.4.y only Cc: Shanker Donthineni Signed-off-by: Will Deacon Signed-off-by: Will Deacon --- arch/arm64/kernel/cpufeature.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index c1eddc07d996..fff0bf2f889e 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -126,10 +126,12 @@ static struct arm64_ftr_bits ftr_id_aa64mmfr1[] = { }; static struct arm64_ftr_bits ftr_ctr[] = { - U_ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RAO */ - ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 28, 3, 0), + U_ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */ + ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 30, 1, 0), + U_ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 29, 1, 1), /* DIC */ + U_ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 28, 1, 1), /* IDC */ U_ARM64_FTR_BITS(FTR_STRICT, FTR_HIGHER_SAFE, 24, 4, 0), /* CWG */ - U_ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 20, 4, 0), /* ERG */ + U_ARM64_FTR_BITS(FTR_STRICT, FTR_HIGHER_SAFE, 20, 4, 0), /* ERG */ U_ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */ /* * Linux can handle differing I-cache policies. Userspace JITs will