arm64: Expose FRINT capabilities to userspace
authorMark Brown <broonie@kernel.org>
Tue, 18 Jun 2019 18:10:55 +0000 (19:10 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 25 Jun 2019 13:24:00 +0000 (14:24 +0100)
ARMv8.5 introduces the FRINT series of instructions for rounding floating
point numbers to integers. Provide a capability to userspace in order to
allow applications to determine if the system supports these instructions.

Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Documentation/arm64/elf_hwcaps.txt
arch/arm64/include/asm/hwcap.h
arch/arm64/include/asm/sysreg.h
arch/arm64/include/uapi/asm/hwcap.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c

index ee8dbfe652b636c746ee910d5bb8de693adeaf2c..5ae2ef2c12f3a26c1520eba52136de5ada6eb5f5 100644 (file)
@@ -227,6 +227,10 @@ HWCAP_PACG
     ID_AA64ISAR1_EL1.GPI == 0b0001, as described by
     Documentation/arm64/pointer-authentication.txt.
 
+HWCAP2_FRINT
+
+    Functionality implied by ID_AA64ISAR1_EL1.FRINTTS == 0b0001.
+
 
 4. Unused AT_HWCAP bits
 -----------------------
index 838c47f90389306da4712789955e4d4dd5886f2b..8371202e0a8bf284a2dbeaf004f2dad54c0cf80e 100644 (file)
@@ -96,6 +96,7 @@
 #define KERNEL_HWCAP_SVESHA3           __khwcap2_feature(SVESHA3)
 #define KERNEL_HWCAP_SVESM4            __khwcap2_feature(SVESM4)
 #define KERNEL_HWCAP_FLAGM2            __khwcap2_feature(FLAGM2)
+#define KERNEL_HWCAP_FRINT             __khwcap2_feature(FRINT)
 
 /*
  * This yields a mask that user programs can use to figure out what
index 902d75b6091477a822f9883a0766efa77815bed8..6019727718075b0d6ce2e8ec25ebcfebb09a634c 100644 (file)
 
 /* id_aa64isar1 */
 #define ID_AA64ISAR1_SB_SHIFT          36
+#define ID_AA64ISAR1_FRINTTS_SHIFT     32
 #define ID_AA64ISAR1_GPI_SHIFT         28
 #define ID_AA64ISAR1_GPA_SHIFT         24
 #define ID_AA64ISAR1_LRCPC_SHIFT       20
index 7902ae4f38b4356bbf27e1fae2913a1505cc068e..a1e72886b30c8467851edbcdfa39a3fc96473520 100644 (file)
@@ -64,5 +64,6 @@
 #define HWCAP2_SVESHA3         (1 << 5)
 #define HWCAP2_SVESM4          (1 << 6)
 #define HWCAP2_FLAGM2          (1 << 7)
+#define HWCAP2_FRINT           (1 << 8)
 
 #endif /* _UAPI__ASM_HWCAP_H */
index 8350016dbb28d76f1ab3f0584164251a9dd72306..a0f00917b8b9cc59874e055a4f5fe3dc165b32f2 100644 (file)
@@ -1640,6 +1640,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
        HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_FCMA_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FCMA),
        HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_LRCPC_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_LRCPC),
        HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_LRCPC_SHIFT, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_ILRCPC),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_FRINTTS_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FRINT),
        HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_SB_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_SB),
        HWCAP_CAP(SYS_ID_AA64MMFR2_EL1, ID_AA64MMFR2_AT_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_USCAT),
 #ifdef CONFIG_ARM64_SVE
index 62102f75dc1e9d2fef011f8330fc5a499a7ad7f6..fda8ded8b739083d871a0c725e8052eb8b91c532 100644 (file)
@@ -93,6 +93,7 @@ static const char *const hwcap_str[] = {
        "svesha3",
        "svesm4",
        "flagm2",
+       "frint",
        NULL
 };