From patchwork Fri Aug 26 17:15:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 74825 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp471515qga; Fri, 26 Aug 2016 10:19:25 -0700 (PDT) X-Received: by 10.98.149.131 with SMTP id c3mr7938069pfk.73.1472231961283; Fri, 26 Aug 2016 10:19:21 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ta8si22135578pab.231.2016.08.26.10.19.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Aug 2016 10:19:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bdKls-0007aW-GA; Fri, 26 Aug 2016 17:18:24 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bdKlT-00078G-7Q for linux-arm-kernel@lists.infradead.org; Fri, 26 Aug 2016 17:18:00 +0000 Received: by mail-wm0-x231.google.com with SMTP id q128so1285510wma.1 for ; Fri, 26 Aug 2016 10:17:38 -0700 (PDT) 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=GNEwYKvX77jG3dXtXlBZ2W/8Dc7u/PFDCEqgQqWP55w=; b=O9PkPeMNoZfXELrX9VctZqBtbA/TVBzXJDSxhgN0D3jpKKGtBOvcCPgkb75YOfwgti XPSLSZHRgi+Y7u/9q3nNenOkPUcXZ7b3N+ZbdW8PB6YlqsPtfw1y/AiQjcB95BpgQiFN Yl/WcnfILg0qMqRaCOudlwCuY058wBKQqXe5E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GNEwYKvX77jG3dXtXlBZ2W/8Dc7u/PFDCEqgQqWP55w=; b=M5e7UFf66Z8zeix+j51PT836oJ0Aiw8dnjsTedyViQxNItJwd1M4UIRh0D5eEv3cVD B2GmvOztWSKx+xGEh2X6Jt0gCz1GorAW34xN42A3RpSVmGcsyDN0QlFAadQejyWeKUVv UlTfeROKz7/hWuQSNvtgf6w1yZRBY3JdH1nrfrexiGDkSvWgX63f0sem4lq/V/A0MHAK 89aNEr8c/DGKrUki0i595PXAE0IbXPbl3MHP/8jp7KcZxRxEXAyHGTsiQ8Wp3Y339Oe7 tESgXvkj89nka0zp73WRdAR4BjUQk1E7uKm4EyU4B96GhEsluVfZT9GpaVBCuJrss/ig IN4g== X-Gm-Message-State: AEkoousLXm/RtAerkeX2wbqs7Xzd8kDa2+q3FsVKNCs2eVxn2Os5IxProCwRCqHrMMtLjrVf X-Received: by 10.28.31.147 with SMTP id f141mr38453909wmf.69.1472231857094; Fri, 26 Aug 2016 10:17:37 -0700 (PDT) Received: from localhost.localdomain (dynrak234g-133-134-67-105.inwitelecom.net. [105.67.134.133]) by smtp.gmail.com with ESMTPSA id b130sm21504823wmg.19.2016.08.26.10.17.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Aug 2016 10:17:36 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, catalin.marinas@arm.com, suzuki.poulose@arm.com Subject: [RFC PATCH 3/3] arm64: cpufeature: expose arm64_ftr_reg struct for CTR_EL0 Date: Fri, 26 Aug 2016 18:15:42 +0100 Message-Id: <1472231742-13387-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472231742-13387-1-git-send-email-ard.biesheuvel@linaro.org> References: <1472231742-13387-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160826_101759_592388_DB2784CB X-CRM114-Status: GOOD ( 11.51 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:231 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Expose the arm64_ftr_reg struct outside of cpufeature.o so that other code can refer to it directly (i.e., without performing the binary search) Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/cpufeature.h | 2 ++ arch/arm64/kernel/cpufeature.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index 8bb4f1527b26..858d8d03a101 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -109,6 +109,8 @@ struct arm64_cpu_capabilities { extern DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS); +extern struct arm64_ftr_reg ctrel0_ftr_reg; + bool this_cpu_has_cap(unsigned int cap); static inline bool cpu_have_feature(unsigned int num) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 35a17487ffb9..3aa7ad6c5e60 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -155,6 +155,11 @@ static const struct arm64_ftr_bits ftr_ctr[] = { ARM64_FTR_END, }; +struct arm64_ftr_reg ctrel0_ftr_reg = { + .name = "SYS_CTR_EL0", + .ftr_bits = ftr_ctr +}; + static const struct arm64_ftr_bits ftr_id_mmfr0[] = { S_ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 28, 4, 0xf), /* InnerShr */ ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 24, 4, 0), /* FCSE */ @@ -318,7 +323,7 @@ static const struct __ftr_reg_entry { ARM64_FTR_REG(SYS_ID_AA64MMFR2_EL1, ftr_id_aa64mmfr2), /* Op1 = 3, CRn = 0, CRm = 0 */ - ARM64_FTR_REG(SYS_CTR_EL0, ftr_ctr), + { SYS_CTR_EL0, &ctrel0_ftr_reg }, ARM64_FTR_REG(SYS_DCZID_EL0, ftr_dczid), /* Op1 = 3, CRn = 14, CRm = 0 */