Skip to content

Commit a6a468f

Browse files
brooniewilldeacon
authored andcommitted
arm64/hwcap: Support FEAT_EBF16
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 <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 60c868e commit a6a468f

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

Documentation/arm64/elf_hwcaps.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ HWCAP2_WFXT
301301

302302
Functionality implied by ID_AA64ISAR2_EL1.WFXT == 0b0010.
303303

304+
HWCAP2_EBF16
305+
306+
Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0010.
307+
304308
4. Unused AT_HWCAP bits
305309
-----------------------
306310

arch/arm64/include/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
#define KERNEL_HWCAP_SME_F32F32 __khwcap2_feature(SME_F32F32)
119119
#define KERNEL_HWCAP_SME_FA64 __khwcap2_feature(SME_FA64)
120120
#define KERNEL_HWCAP_WFXT __khwcap2_feature(WFXT)
121+
#define KERNEL_HWCAP_EBF16 __khwcap2_feature(EBF16)
121122

122123
/*
123124
* This yields a mask that user programs can use to figure out what

arch/arm64/include/uapi/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,6 @@
9191
#define HWCAP2_SME_F32F32 (1 << 29)
9292
#define HWCAP2_SME_FA64 (1 << 30)
9393
#define HWCAP2_WFXT (1UL << 31)
94+
#define HWCAP2_EBF16 (1UL << 32)
9495

9596
#endif /* _UAPI__ASM_HWCAP_H */

arch/arm64/kernel/cpufeature.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
26412641
HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_FRINTTS_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FRINT),
26422642
HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_SB_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_SB),
26432643
HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_BF16_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_BF16),
2644+
HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_BF16_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_EBF16),
26442645
HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_DGH_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DGH),
26452646
HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_I8MM_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_I8MM),
26462647
HWCAP_CAP(SYS_ID_AA64MMFR2_EL1, ID_AA64MMFR2_AT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_USCAT),

arch/arm64/kernel/cpuinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static const char *const hwcap_str[] = {
107107
[KERNEL_HWCAP_SME_F32F32] = "smef32f32",
108108
[KERNEL_HWCAP_SME_FA64] = "smefa64",
109109
[KERNEL_HWCAP_WFXT] = "wfxt",
110+
[KERNEL_HWCAP_EBF16] = "ebf16",
110111
};
111112

112113
#ifdef CONFIG_COMPAT

0 commit comments

Comments
 (0)