arm64: Expose compat Armv8 AArch32 features
v2 cover arm64: Expose compat Armv8 AArch32 features
Hi All,
This series advertises the Armv8 AArch32 features in arm64 kernel in compat mode. A similar series adding such features (fphp, asimdhp, dp, fhm, bf16, i8mm, sb and ssbs) in arm kernel was posted and merged earlier.
The entire series is divided feature wise as present in Armv8 manual. The details of these features can be found in Armv8 architecture reference manual available from
https://developer.arm.com/documentation/ddi0487/gb/?lang=en
All the changes have been tested on Arm FVP Base Revc model after adding necessary model parameters. The different hwcaps added are visible in /proc/cpuinfo in PER_LINUX32 personality mode.
The series is based on Linux v6.2-rc3.
Changes in V2:
* Dropped the patch "arm64: cpufeature: Fix the visibility of compat hwcaps" as it is merged.
* Rebased to 6.2-rc3.
* Few commit log modifications.
Thanks,
Amit Daniel
Amit Daniel Kachhap (7):
arm64: Add compat hwcap FPHP and ASIMDHP
arm64: Add compat hwcap ASIMDDP
arm64: Add compat hwcap ASIMDFHM
arm64: Add compat hwcap ASIMDBF16
arm64: Add compat hwcap I8MM
arm64: Add compat hwcap SB
arm64: Add compat hwcap SSBS
arch/arm64/include/asm/hwcap.h | 8 ++++++++ arch/arm64/kernel/cpufeature.c | 24 ++++++++++++++++-------- arch/arm64/kernel/cpuinfo.c | 8 ++++++++ 3 files changed, 32 insertions(+), 8 deletions(-)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 1/7 arm64: Add compat hwcap FPHP and ASIMDHP
These hwcaps were added earlier for 32-bit native arm kernel by commit c00a19c8b143 ("ARM: 9268/1: vfp: Add hwcap FPHP and ASIMDHP for FEAT_FP16") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar userspace interfaces.
Floating point half-precision (FPHP) and Advanced SIMD half-precision (ASIMDHP) represents the Armv8 FP16 feature extension and is already advertised in native arm64 kernel.
--- arch/arm64/include/asm/hwcap.h | 2 ++ arch/arm64/kernel/cpufeature.c | 6 ++++-- arch/arm64/kernel/cpuinfo.c | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-)
arch/arm64/include/asm/hwcap.h +2 -0
@@ -31,6 +31,8 @@#define COMPAT_HWCAP_VFPD32 (1 << 19)#define COMPAT_HWCAP_LPAE (1 << 20)#define COMPAT_HWCAP_EVTSTRM (1 << 21) +#define COMPAT_HWCAP_FPHP (1 << 22) +#define COMPAT_HWCAP_ASIMDHP (1 << 23)#define COMPAT_HWCAP2_AES (1 << 0)#define COMPAT_HWCAP2_PMULL (1 << 1)
arch/arm64/kernel/cpufeature.c +4 -2
@@ -444,8 +444,8 @@ static const struct arm64_ftr_bits ftr_mvfr0[] = {static const struct arm64_ftr_bits ftr_mvfr1[] = {ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,MVFR1_EL1_SIMDFMAC_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,MVFR1_EL1_FPHP_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,MVFR1_EL1_SIMDHP_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,MVFR1_EL1_FPHP_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,MVFR1_EL1_SIMDHP_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,MVFR1_EL1_SIMDSP_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE , MVFR1_EL1_SIMDInt_SHIFT,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,MVFR1_EL1_SIMDLS_SHIFT ,4 ,0 ),
@@ -2866,6 +2866,8 @@ static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = {/* Arm v8 mandates MVFR0.FPDP == {0, 2}. So, piggy back on this for the presence of VFP support */ HWCAP_CAP (SYS_MVFR0_EL1 ,MVFR0_EL1_FPDP_SHIFT ,4 ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_VFP ),HWCAP_CAP (SYS_MVFR0_EL1 ,MVFR0_EL1_FPDP_SHIFT ,4 ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP , COMPAT_HWCAP_VFPv3), +HWCAP_CAP (SYS_MVFR1_EL1 ,MVFR1_EL1_FPHP_SHIFT ,4 ,FTR_UNSIGNED ,3 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_FPHP ), +HWCAP_CAP (SYS_MVFR1_EL1 ,MVFR1_EL1_SIMDHP_SHIFT ,4 ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDHP ),HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_AES_SHIFT ,4 ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_PMULL ),HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_AES_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_AES ), HWCAP_CAP(SYS_ID_ISAR5_EL1, ID_ISAR5_EL1_SHA1_SHIFT, 4, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP2, COMPAT_HWCAP2_SHA1),
arch/arm64/kernel/cpuinfo.c +2 -0
@@ -146,6 +146,8 @@ static const char *const compat_hwcap_str[] = { [COMPAT_KERNEL_HWCAP(VFPD32)] = NULL, /* Not possible on arm64 */ [COMPAT_KERNEL_HWCAP(LPAE)] = "lpae", [COMPAT_KERNEL_HWCAP(EVTSTRM)] = "evtstrm", + [COMPAT_KERNEL_HWCAP(FPHP)] = "fphp", + [COMPAT_KERNEL_HWCAP(ASIMDHP)] = "asimdhp", };#define COMPAT_KERNEL_HWCAP2 (x) const_ilog2(COMPAT_HWCAP2_ ## x)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 2/7 arm64: Add compat hwcap ASIMDDP
In reply to Amit Daniel KachhapThis hwcap was added earlier for 32-bit native arm kernel by commit 62ea0d873af3 ("ARM: 9269/1: vfp: Add hwcap for FEAT_DotProd") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar user interfaces.
Advanced Dot product is a feature (FEAT_DotProd) present in both AArch32/AArch64 state for Armv8 and is already advertised in native arm64 kernel.
--- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 3 ++- arch/arm64/kernel/cpuinfo.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/include/asm/hwcap.h +1 -0
@@ -33,6 +33,7 @@#define COMPAT_HWCAP_EVTSTRM (1 << 21)#define COMPAT_HWCAP_FPHP (1 << 22)#define COMPAT_HWCAP_ASIMDHP (1 << 23) +#define COMPAT_HWCAP_ASIMDDP (1 << 24)#define COMPAT_HWCAP2_AES (1 << 0)#define COMPAT_HWCAP2_PMULL (1 << 1)
arch/arm64/kernel/cpufeature.c +2 -1
@@ -534,7 +534,7 @@ static const struct arm64_ftr_bits ftr_id_isar6[] = {ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SPECRES_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SB_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_DP_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_DP_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_JSCVT_SHIFT ,4 ,0 ), ARM64_FTR_END, };
@@ -2873,6 +2873,7 @@ static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_SHA1_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SHA1 ),HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_SHA2_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SHA2 ),HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_CRC32_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_CRC32 ), + HWCAP_CAP(SYS_ID_ISAR6_EL1, ID_ISAR6_EL1_DP_SHIFT, 4, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP, COMPAT_HWCAP_ASIMDDP), #endif {}, };
arch/arm64/kernel/cpuinfo.c +1 -0
@@ -148,6 +148,7 @@ static const char *const compat_hwcap_str[] = { [COMPAT_KERNEL_HWCAP(EVTSTRM)] = "evtstrm", [COMPAT_KERNEL_HWCAP(FPHP)] = "fphp", [COMPAT_KERNEL_HWCAP(ASIMDHP)] = "asimdhp", + [COMPAT_KERNEL_HWCAP(ASIMDDP)] = "asimddp", };#define COMPAT_KERNEL_HWCAP2 (x) const_ilog2(COMPAT_HWCAP2_ ## x)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 3/7 arm64: Add compat hwcap ASIMDFHM
In reply to Amit Daniel KachhapThis hwcap was added earlier for 32-bit native arm kernel by commit ce4835497c20 ("ARM: 9270/1: vfp: Add hwcap for FEAT_FHM") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar user interfaces.
Floating-point half-precision multiplication (FHM) is a feature present in AArch32/AArch64 state for Armv8. This hwcap is already advertised in native arm64 kernel.
--- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 3 ++- arch/arm64/kernel/cpuinfo.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/include/asm/hwcap.h +1 -0
@@ -34,6 +34,7 @@#define COMPAT_HWCAP_FPHP (1 << 22)#define COMPAT_HWCAP_ASIMDHP (1 << 23)#define COMPAT_HWCAP_ASIMDDP (1 << 24) +#define COMPAT_HWCAP_ASIMDFHM (1 << 25)#define COMPAT_HWCAP2_AES (1 << 0)#define COMPAT_HWCAP2_PMULL (1 << 1)
arch/arm64/kernel/cpufeature.c +2 -1
@@ -533,7 +533,7 @@ static const struct arm64_ftr_bits ftr_id_isar6[] = {ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SPECRES_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SB_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_DP_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_JSCVT_SHIFT ,4 ,0 ), ARM64_FTR_END,
@@ -2874,6 +2874,7 @@ static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_SHA2_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SHA2 ),HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_CRC32_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_CRC32 ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_DP_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDDP ), + HWCAP_CAP(SYS_ID_ISAR6_EL1, ID_ISAR6_EL1_FHM_SHIFT, 4, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP, COMPAT_HWCAP_ASIMDFHM), #endif {}, };
arch/arm64/kernel/cpuinfo.c +1 -0
@@ -149,6 +149,7 @@ static const char *const compat_hwcap_str[] = { [COMPAT_KERNEL_HWCAP(FPHP)] = "fphp", [COMPAT_KERNEL_HWCAP(ASIMDHP)] = "asimdhp", [COMPAT_KERNEL_HWCAP(ASIMDDP)] = "asimddp", + [COMPAT_KERNEL_HWCAP(ASIMDFHM)] = "asimdfhm", };#define COMPAT_KERNEL_HWCAP2 (x) const_ilog2(COMPAT_HWCAP2_ ## x)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 4/7 arm64: Add compat hwcap ASIMDBF16
In reply to Amit Daniel KachhapThis hwcap was added earlier for 32-bit native arm kernel by commit 23b6d4ad6e7a ("ARM: 9271/1: vfp: Add hwcap for FEAT_AA32BF16") and hence the corresponding changes added in 32-bit compat arm64 kernel.
Brain 16-bit floating-point storage format is a feature (FEAT_AA32BF16) present in AArch32 state for Armv8 and is represented by ISAR6.BF16 identification register. Similar feature (FEAT_BF16) exist for AArch64 state and is already advertised in native arm64 kernel.
--- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 3 ++- arch/arm64/kernel/cpuinfo.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/include/asm/hwcap.h +1 -0
@@ -35,6 +35,7 @@#define COMPAT_HWCAP_ASIMDHP (1 << 23)#define COMPAT_HWCAP_ASIMDDP (1 << 24)#define COMPAT_HWCAP_ASIMDFHM (1 << 25) +#define COMPAT_HWCAP_ASIMDBF16 (1 << 26)#define COMPAT_HWCAP2_AES (1 << 0)#define COMPAT_HWCAP2_PMULL (1 << 1)
arch/arm64/kernel/cpufeature.c +2 -1
@@ -530,7 +530,7 @@ static const struct arm64_ftr_bits ftr_id_mmfr5[] = {static const struct arm64_ftr_bits ftr_id_isar6[] = {ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_I8MM_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SPECRES_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SB_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,0 ),
@@ -2875,6 +2875,7 @@ static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_CRC32_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_CRC32 ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_DP_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDDP ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDFHM ), + HWCAP_CAP(SYS_ID_ISAR6_EL1, ID_ISAR6_EL1_BF16_SHIFT, 4, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP, COMPAT_HWCAP_ASIMDBF16), #endif {}, };
arch/arm64/kernel/cpuinfo.c +1 -0
@@ -150,6 +150,7 @@ static const char *const compat_hwcap_str[] = { [COMPAT_KERNEL_HWCAP(ASIMDHP)] = "asimdhp", [COMPAT_KERNEL_HWCAP(ASIMDDP)] = "asimddp", [COMPAT_KERNEL_HWCAP(ASIMDFHM)] = "asimdfhm", + [COMPAT_KERNEL_HWCAP(ASIMDBF16)] = "asimdbf16", };#define COMPAT_KERNEL_HWCAP2 (x) const_ilog2(COMPAT_HWCAP2_ ## x)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 5/7 arm64: Add compat hwcap I8MM
In reply to Amit Daniel KachhapThis hwcap was added earlier for 32-bit native arm kernel by commit 956ca3a4eb81 ("ARM: 9272/1: vfp: Add hwcap for FEAT_AA32I8MM") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar user interfaces.
Int8 matrix multiplication is a feature (FEAT_AA32I8MM) present in AArch32 state of Armv8 and is identified by ISAR6.I8MM register. Similar feature(FEAT_I8MM) exist for AArch64 state and is already advertised in arm64 kernel.
--- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 3 ++- arch/arm64/kernel/cpuinfo.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/include/asm/hwcap.h +1 -0
@@ -36,6 +36,7 @@#define COMPAT_HWCAP_ASIMDDP (1 << 24)#define COMPAT_HWCAP_ASIMDFHM (1 << 25)#define COMPAT_HWCAP_ASIMDBF16 (1 << 26) +#define COMPAT_HWCAP_I8MM (1 << 27)#define COMPAT_HWCAP2_AES (1 << 0)#define COMPAT_HWCAP2_PMULL (1 << 1)
arch/arm64/kernel/cpufeature.c +2 -1
@@ -529,7 +529,7 @@ static const struct arm64_ftr_bits ftr_id_mmfr5[] = { };static const struct arm64_ftr_bits ftr_id_isar6[] = { -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_I8MM_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_I8MM_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SPECRES_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SB_SHIFT ,4 ,0 ),
@@ -2876,6 +2876,7 @@ static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_DP_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDDP ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDFHM ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDBF16 ), + HWCAP_CAP(SYS_ID_ISAR6_EL1, ID_ISAR6_EL1_I8MM_SHIFT, 4, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP, COMPAT_HWCAP_I8MM), #endif {}, };
arch/arm64/kernel/cpuinfo.c +1 -0
@@ -151,6 +151,7 @@ static const char *const compat_hwcap_str[] = { [COMPAT_KERNEL_HWCAP(ASIMDDP)] = "asimddp", [COMPAT_KERNEL_HWCAP(ASIMDFHM)] = "asimdfhm", [COMPAT_KERNEL_HWCAP(ASIMDBF16)] = "asimdbf16", + [COMPAT_KERNEL_HWCAP(I8MM)] = "i8mm", };#define COMPAT_KERNEL_HWCAP2 (x) const_ilog2(COMPAT_HWCAP2_ ## x)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 7/7 arm64: Add compat hwcap SSBS
In reply to Amit Daniel KachhapThis hwcap was added for 32-bit native arm kernel by commit fea53546be57 ("ARM: 9274/1: Add hwcap for Speculative Store Bypassing Safe") and hence the corresponding changes added in 32-bit compat arm64 for similar user interfaces.
Speculative Store Bypass Safe is a feature(FEAT_SSBS) present in AArch32/AArch64 state for Armv8 and can be identified by PFR2.SSBS identification register. This hwcap is already advertised in native arm64 kernel.
--- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 3 ++- arch/arm64/kernel/cpuinfo.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/include/asm/hwcap.h +1 -0
@@ -44,6 +44,7 @@#define COMPAT_HWCAP2_SHA2 (1 << 3)#define COMPAT_HWCAP2_CRC32 (1 << 4)#define COMPAT_HWCAP2_SB (1 << 5) +#define COMPAT_HWCAP2_SSBS (1 << 6)#ifndef __ASSEMBLY__#include <linux/log2.h>
arch/arm64/kernel/cpufeature.c +2 -1
@@ -562,7 +562,7 @@ static const struct arm64_ftr_bits ftr_id_pfr1[] = { };static const struct arm64_ftr_bits ftr_id_pfr2[] = { -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_PFR2_EL1_SSBS_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_PFR2_EL1_SSBS_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_PFR2_EL1_CSV3_SHIFT ,4 ,0 ),ARM64_FTR_END , };
@@ -2878,6 +2878,7 @@ static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_SB_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SB ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDBF16 ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_I8MM_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_I8MM ), + HWCAP_CAP(SYS_ID_PFR2_EL1, ID_PFR2_EL1_SSBS_SHIFT, 4, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP2, COMPAT_HWCAP2_SSBS), #endif {}, };
arch/arm64/kernel/cpuinfo.c +1 -0
@@ -162,6 +162,7 @@ static const char *const compat_hwcap2_str[] = { [COMPAT_KERNEL_HWCAP2(SHA2)] = "sha2", [COMPAT_KERNEL_HWCAP2(CRC32)] = "crc32", [COMPAT_KERNEL_HWCAP2(SB)] = "sb", + [COMPAT_KERNEL_HWCAP2(SSBS)] = "ssbs", };#endif /* CONFIG_COMPAT */
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 6/7 arm64: Add compat hwcap SB
In reply to Amit Daniel KachhapThis hwcap was added for 32-bit native arm kernel by commit 3bda6d884897 ("ARM: 9273/1: Add hwcap for Speculation Barrier(SB)") and hence the corresponding changes added in 32-bit compat arm64 kernel.
Speculation Barrier is a feature(FEAT_SB) present in both AArch32 and AArch64 state. This hwcap is already advertised in native arm64 kernel.
--- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 3 ++- arch/arm64/kernel/cpuinfo.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/include/asm/hwcap.h +1 -0
@@ -43,6 +43,7 @@#define COMPAT_HWCAP2_SHA1 (1 << 2)#define COMPAT_HWCAP2_SHA2 (1 << 3)#define COMPAT_HWCAP2_CRC32 (1 << 4) +#define COMPAT_HWCAP2_SB (1 << 5)#ifndef __ASSEMBLY__#include <linux/log2.h>
arch/arm64/kernel/cpufeature.c +2 -1
@@ -532,7 +532,7 @@ static const struct arm64_ftr_bits ftr_id_isar6[] = {ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_I8MM_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SPECRES_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SB_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_SB_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_ISAR6_EL1_DP_SHIFT ,4 ,0 ), ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_EL1_JSCVT_SHIFT, 4, 0),
@@ -2875,6 +2875,7 @@ static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_EL1_CRC32_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_CRC32 ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_DP_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDDP ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_FHM_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDFHM ), +HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_SB_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SB ),HWCAP_CAP (SYS_ID_ISAR6_EL1 ,ID_ISAR6_EL1_BF16_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_ASIMDBF16 ), HWCAP_CAP(SYS_ID_ISAR6_EL1, ID_ISAR6_EL1_I8MM_SHIFT, 4, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP, COMPAT_HWCAP_I8MM), #endif
arch/arm64/kernel/cpuinfo.c +1 -0
@@ -161,6 +161,7 @@ static const char *const compat_hwcap2_str[] = { [COMPAT_KERNEL_HWCAP2(SHA1)] = "sha1", [COMPAT_KERNEL_HWCAP2(SHA2)] = "sha2", [COMPAT_KERNEL_HWCAP2(CRC32)] = "crc32", + [COMPAT_KERNEL_HWCAP2(SB)] = "sb", };#endif /* CONFIG_COMPAT */
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 4 lines · Amit Daniel Kachhap
This series advertises the Armv8 AArch32 features in arm64 kernel in compat mode. A similar series adding such features (fphp, asimdhp, dp, fhm, bf16, i8mm, sb and ssbs) in arm kernel was posted and merged earlier.
Note my series reworking the way we advertise hwcaps:
https://lore.kernel.org/r/[email protected]
which might cause some fun here.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 1/7] arm64: Add compat hwcap FPHP and ASIMDHP
In reply to Amit Daniel KachhapQuoted 4 lines · Amit Daniel Kachhap
These hwcaps were added earlier for 32-bit native arm kernel by commit
c00a19c8b143("ARM: 9268/1: vfp: Add hwcap FPHP and ASIMDHP forFEAT_FP16") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar userspace interfaces.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 2/7] arm64: Add compat hwcap ASIMDDP
In reply to Amit Daniel KachhapQuoted 4 lines · Amit Daniel Kachhap
This hwcap was added earlier for 32-bit native arm kernel by commit
62ea0d873af3("ARM: 9269/1: vfp: Add hwcap forFEAT_DotProd") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar user interfaces.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 7 lines · Mark Brown
Quoted 4 lines · Amit Daniel Kachhap
This series advertises the Armv8 AArch32 features in arm64 kernel in compat mode. A similar series adding such features (fphp, asimdhp, dp, fhm, bf16, i8mm, sb and ssbs) in arm kernel was posted and merged earlier.
Quoted 5 lines
Note my series reworking the way we advertise hwcaps:
https://lore.kernel.org/r/[email protected]which might cause some fun here.
Your series seems interesting by reducing the hwcap entry size. Thanks for pointing it to me.
Amit
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 3/7] arm64: Add compat hwcap ASIMDFHM
In reply to Amit Daniel KachhapQuoted 4 lines · Amit Daniel Kachhap
This hwcap was added earlier for 32-bit native arm kernel by commit
ce4835497c20("ARM: 9270/1: vfp: Add hwcap forFEAT_FHM") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar user interfaces.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 4/7] arm64: Add compat hwcap ASIMDBF16
In reply to Amit Daniel KachhapQuoted 3 lines · Amit Daniel Kachhap
This hwcap was added earlier for 32-bit native arm kernel by commit
23b6d4ad6e7a("ARM: 9271/1: vfp: Add hwcap forFEAT_AA32BF16") and hence the corresponding changes added in 32-bit compat arm64 kernel.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 5/7] arm64: Add compat hwcap I8MM
In reply to Amit Daniel KachhapQuoted 4 lines · Amit Daniel Kachhap
This hwcap was added earlier for 32-bit native arm kernel by commit
956ca3a4eb81("ARM: 9272/1: vfp: Add hwcap forFEAT_AA32I8MM") and hence the corresponding changes added in 32-bit compat arm64 kernel for similar user interfaces.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 6/7] arm64: Add compat hwcap SB
In reply to Amit Daniel KachhapQuoted 3 lines · Amit Daniel Kachhap
This hwcap was added for 32-bit native arm kernel by commit
3bda6d884897("ARM: 9273/1: Add hwcap for Speculation Barrier(SB)") and hence the corresponding changes added in 32-bit compat arm64 kernel.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 7/7] arm64: Add compat hwcap SSBS
In reply to Amit Daniel KachhapQuoted 4 lines · Amit Daniel Kachhap
This hwcap was added for 32-bit native arm kernel by commit
fea53546be57("ARM: 9274/1: Add hwcap for Speculative Store Bypassing Safe") and hence the corresponding changes added in 32-bit compat arm64 for similar user interfaces.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 11 lines · Amit Daniel Kachhap
This series advertises the Armv8 AArch32 features in arm64 kernel in compat mode. A similar series adding such features (fphp, asimdhp, dp, fhm, bf16, i8mm, sb and ssbs) in arm kernel was posted and merged earlier.
The entire series is divided feature wise as present in Armv8 manual. The details of these features can be found in Armv8 architecture reference manual available from
https://developer.arm.com/documentation/ddi0487/gb/?lang=en[...]
Applied to arm64 (for-next/compat-hwcap), thanks!
[1/7] arm64: Add compat hwcap FPHP and ASIMDHP
https://git.kernel.org/arm64/c/846b73a4a3d0 [2/7] arm64: Add compat hwcap ASIMDDP https://git.kernel.org/arm64/c/27addd402a73 [3/7] arm64: Add compat hwcap ASIMDFHM https://git.kernel.org/arm64/c/4a87be25b02b [4/7] arm64: Add compat hwcap ASIMDBF16 https://git.kernel.org/arm64/c/f64234fa45f4 [5/7] arm64: Add compat hwcap I8MM https://git.kernel.org/arm64/c/0864d1e42959 [6/7] arm64: Add compat hwcap SB https://git.kernel.org/arm64/c/2d602aa99abb [7/7] arm64: Add compat hwcap SSBS https://git.kernel.org/arm64/c/4f2c9bf16a4b
Signature · 7 lines
Catalin _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel