From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7FAAC43334 for ; Mon, 20 Jun 2022 13:23:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ga5gEURRzsloUony36SP+j0YGCVsQx1DrIwAPM0Hc0M=; b=WQngad9sXr+xaN dTg3gga49lOaIYrx2GNu92B+KMpUQyYmMCah5Y4y164BmpN05aiXhMzgk1Yc69K4NYA1H9+CrYf3O bII69fF2dJ+k43kBAFBK40kDZq3yS/PjyPw0YpMCljvqVD0bZcF1pDAmwoyMs3+R58aZy6MncrIMI RS69gKRIzrOhLMKJ98mYuAXT9u9YL5nmaC4CXjRKYmpq8wAUVH65yXOA4Oudv1gt5bRL0DJhOKz4y wnDlBOvyPWAM5OpB1aC5dkf83/3p8jBzCp1iNIyhyuSFr/euwEiKHiU+XnmI8dwBP0ykXDSAk95kU 9NVQmNG69IdiVSP+Kc8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3HM5-000nPW-Dr; Mon, 20 Jun 2022 13:22:14 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3Gvs-000aZi-Ih for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2022 12:55:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 254CEB811B3; Mon, 20 Jun 2022 12:55:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 182D0C385A2; Mon, 20 Jun 2022 12:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655729705; bh=pGJjlu/R9tQJtV/CPSYKiFXyY/zzFos7c0k/nLUd0ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sCiv4WwFxvSWup26oJAS8c+/OshiuhXYIwpgV2zLWO3iSvrZPISJg5CYr8T5Tofjn EwgBJnrJ8W4yeqzz6J6H5ajppea0xr2WGHL3j1dc0rhX26gotZu6enlGMGvDWZL8mr InEwoDZp/2dtmw523Ke0oa831RiRpEQZ+wF1lHhD8lgx2KcRApB5NSP+Y0ARJYjW8j UD0ikUBliiP9VF57X+Gekn+mX1sIftr2sUh3gembOpwcI/rQFCNySNwD4FhA105b45 02UY2GmkrkPZJwPWIp3ZDsCZ+qGIB1FwEvwKOJrxkMwBwsVCyNnlDMv6rxd9QStNbb w+1G2IkX8nSdA== From: Mark Brown To: Catalin Marinas , Will Deacon , Eric Biederman , Kees Cook Cc: Suzuki K Poulose , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v2 4/4] arm64/hwcap: Support FEAT_EBF16 Date: Mon, 20 Jun 2022 13:54:51 +0100 Message-Id: <20220620125451.653507-5-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220620125451.653507-1-broonie@kernel.org> References: <20220620125451.653507-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3271; h=from:subject; bh=pGJjlu/R9tQJtV/CPSYKiFXyY/zzFos7c0k/nLUd0ho=; b=owGbwMvMwMWocq27KDak/QLjabUkhqQNeZKsP62NVgSyTWuz9Ttxc2byRPmw/HuOBptsS9Vehwvd f3S1k9GYhYGRi0FWTJFl7bOMVenhElvnP5r/CmYQKxPIFAYuTgGYiGwv+/8o3qOf7gZotu6aVabEdo a1ynqdsoDv8pR4ybauRZ0cT7TOJe6bLtfwzvHO5OuHdi+XW3r4+zelR6LqyepO4WaMRkod0id+sLte Wvg2Lv6EFuf3p9llgVEKD7WWZjwt29t10VIvf3tdhbqezarDP7/VpYonPZ58ONOLZd9M2ei5vz4HM5 /+tnDjl2BG7hPCJjFWjHyrF0gUN8WrvSxYdLbufdC7/xPzTs3N6eW4my1tfPlwU4CJqKSxrbeK7vPU R88YOFzkLD/xLfZzqnHT6BIIfMqtr9ifesaZo0vvSLrSFKcVysLcte/CrqfN2ShX3Ni+yky1OFndVI M168zVz/+lWnY+mBGxg/d/gas6AA== X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220620_055508_979952_FB6B8A99 X-CRM114-Status: GOOD ( 14.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The v9.2 feature FEAT_EBF16 provides support for an extended BFloat16 mode. Allow userspace to discover system support for this feature by adding a hwcap for it. Signed-off-by: Mark Brown --- Documentation/arm64/elf_hwcaps.rst | 4 ++++ arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/include/uapi/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 1 + arch/arm64/kernel/cpuinfo.c | 1 + 5 files changed, 8 insertions(+) diff --git a/Documentation/arm64/elf_hwcaps.rst b/Documentation/arm64/elf_hwcaps.rst index 5f4d89c4afe2..4dab74a70cc1 100644 --- a/Documentation/arm64/elf_hwcaps.rst +++ b/Documentation/arm64/elf_hwcaps.rst @@ -301,6 +301,10 @@ HWCAP2_WFXT Functionality implied by ID_AA64ISAR2_EL1.WFXT == 0b0010. +HWCAP3_EBF16 + + Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0010. + 4. Unused AT_HWCAP bits ----------------------- diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 1ef208ab6895..cf670e4afc16 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -123,6 +123,7 @@ #define KERNEL_HWCAP_WFXT __khwcap2_feature(WFXT) #define __khwcap3_feature(x) (const_ilog2(HWCAP3_ ## x) + KHWCAP_OFFSET(3)) +#define KERNEL_HWCAP_EBF16 __khwcap3_feature(EBF16) /* * This yields a mask that user programs can use to figure out what diff --git a/arch/arm64/include/uapi/asm/hwcap.h b/arch/arm64/include/uapi/asm/hwcap.h index 7b818f8fc01b..3b6644f0c07f 100644 --- a/arch/arm64/include/uapi/asm/hwcap.h +++ b/arch/arm64/include/uapi/asm/hwcap.h @@ -92,5 +92,6 @@ /* * HWCAP3 flags - for AT_HWCAP3 */ +#define HWCAP3_EBF16 (1 << 0) #endif /* _UAPI__ASM_HWCAP_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 7605b213d9db..79850a0cd563 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2623,6 +2623,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_FRINTTS_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FRINT), HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_SB_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_SB), HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_BF16_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_BF16), + HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_BF16_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_EBF16), HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_DGH_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DGH), HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_I8MM_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_I8MM), HWCAP_CAP(SYS_ID_AA64MMFR2_EL1, ID_AA64MMFR2_AT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_USCAT), diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 8eff0a34ffd4..2ca131243c30 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -107,6 +107,7 @@ static const char *const hwcap_str[] = { [KERNEL_HWCAP_SME_F32F32] = "smef32f32", [KERNEL_HWCAP_SME_FA64] = "smefa64", [KERNEL_HWCAP_WFXT] = "wfxt", + [KERNEL_HWCAP_EBF16] = "ebf16", }; #ifdef CONFIG_COMPAT -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel