From patchwork Wed Aug 31 10:31:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 75067 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp257926qga; Wed, 31 Aug 2016 03:33:57 -0700 (PDT) X-Received: by 10.66.181.139 with SMTP id dw11mr15777357pac.2.1472639637861; Wed, 31 Aug 2016 03:33:57 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ay6si50252917pab.279.2016.08.31.03.33.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 03:33:57 -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 1bf2pH-0008AZ-37; Wed, 31 Aug 2016 10:32:59 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bf2oA-0007Nk-1c for linux-arm-kernel@lists.infradead.org; Wed, 31 Aug 2016 10:31:52 +0000 Received: by mail-wm0-x22a.google.com with SMTP id i5so81292955wmg.0 for ; Wed, 31 Aug 2016 03:31:29 -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=zARRud+XctDSnpBJxOnFQqrOQ0WzyYMLEhvyH6NkL+Q=; b=g4pB21xQPe48BAU4WwPKm+cV47F/F5KIjJBTLt2NZsD4wI2BwhdNAYmzuq4csit5M8 PQfxrBoeyPKNoSb8WXBu6sO7ry02I2yUOkYbCre+XzrbzCYmjOLU1gNzK1QbSQVua8LJ XbLo9EVWBTTsgu7vrjGZ0G0mc1V9wMcD8qA20= 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=zARRud+XctDSnpBJxOnFQqrOQ0WzyYMLEhvyH6NkL+Q=; b=SU5aU1nMiJiX5gJHA9tHabrb5bMKNX3wkMncNSDdyUnRacUDHgPXaBo2t+kwhPf16m ThIn0pRV9VuGq+xDrKIIfCFsZIsyZONpOvYj/G0U84fHDgTsr9P6F/c7Eief/k6RgAlc IUcA0pmwCs/F5JGYJIwqYhdsEUIfTpHMA88IN7q2ruXMaKYUAnpTX6FlOJNRGpS3vPHg uiKo+iwwjJmDPNrnRuTni/9pWCJAAQHTHvGLOWPvbmyu1nkBR+6YgNb9OZ704PGsxydt flX4Nhsoflot+Ujaw9f/vKM1YDE5saeLezNbtVDI7xYJeKwVOcDsgO4gZrIwz1UHAzsE DH9g== X-Gm-Message-State: AE9vXwMdpwh6kS/DNdi6yPT6lA3ICIyLZNN4X4dtSgXzwy7B/2tB5f84YuTH1MbF7yp6+l45 X-Received: by 10.28.185.202 with SMTP id j193mr20168134wmf.78.1472639488121; Wed, 31 Aug 2016 03:31:28 -0700 (PDT) Received: from localhost.localdomain ([160.169.158.74]) by smtp.gmail.com with ESMTPSA id x6sm43838946wjk.26.2016.08.31.03.31.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Aug 2016 03:31:27 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com Subject: [PATCH v2 3/3] arm64: cpufeature: expose arm64_ftr_reg struct for CTR_EL0 Date: Wed, 31 Aug 2016 11:31:10 +0100 Message-Id: <1472639470-28224-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472639470-28224-1-git-send-email-ard.biesheuvel@linaro.org> References: <1472639470-28224-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160831_033150_441468_6618BCA1 X-CRM114-Status: GOOD ( 12.62 ) 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:22a 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: catalin.marinas@arm.com, Ard Biesheuvel , suzuki.poulose@arm.com 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 covering CTR_EL0 outside of cpufeature.o so that other code can refer to it directly (i.e., without performing the binary search) Reviewed-by: Suzuki K Poulose 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..c07c5d1cd04a 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -78,6 +78,8 @@ struct arm64_ftr_reg { const struct arm64_ftr_bits *ftr_bits; }; +extern struct arm64_ftr_reg arm64_ftr_reg_ctrel0; + /* scope of capability check */ enum { SCOPE_SYSTEM, diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index cc7451a27d94..c3d7ae48f92d 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 arm64_ftr_reg_ctrel0 = { + .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, &arm64_ftr_reg_ctrel0 }, ARM64_FTR_REG(SYS_DCZID_EL0, ftr_dczid), /* Op1 = 3, CRn = 14, CRm = 0 */