arm64: Expose ARMv8.5 CondM capability to userspace
authorMark Brown <broonie@kernel.org>
Tue, 18 Jun 2019 18:10:54 +0000 (19:10 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 25 Jun 2019 13:21:41 +0000 (14:21 +0100)
ARMv8.5 adds new instructions XAFLAG and AXFLAG to translate the
representation of the results of floating point comparisons between the
native ARM format and an alternative format used by some software. Add
a hwcap allowing userspace to determine if they are present, since we
referred to earlier CondM extensions as FLAGM call these extensions
FLAGM2.

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/uapi/asm/hwcap.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c

index b73a251..ee8dbfe 100644 (file)
@@ -207,6 +207,10 @@ HWCAP_FLAGM
 
     Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0001.
 
+HWCAP2_FLAGM2
+
+    Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0010.
+
 HWCAP_SSBS
 
     Functionality implied by ID_AA64PFR1_EL1.SSBS == 0b0010.
index b4bfb66..838c47f 100644 (file)
@@ -95,6 +95,7 @@
 #define KERNEL_HWCAP_SVEBITPERM                __khwcap2_feature(SVEBITPERM)
 #define KERNEL_HWCAP_SVESHA3           __khwcap2_feature(SVESHA3)
 #define KERNEL_HWCAP_SVESM4            __khwcap2_feature(SVESM4)
+#define KERNEL_HWCAP_FLAGM2            __khwcap2_feature(FLAGM2)
 
 /*
  * This yields a mask that user programs can use to figure out what
index 1a772b1..7902ae4 100644 (file)
@@ -63,5 +63,6 @@
 #define HWCAP2_SVEBITPERM      (1 << 4)
 #define HWCAP2_SVESHA3         (1 << 5)
 #define HWCAP2_SVESM4          (1 << 6)
+#define HWCAP2_FLAGM2          (1 << 7)
 
 #endif /* _UAPI__ASM_HWCAP_H */
index 2a7159f..8350016 100644 (file)
@@ -1628,6 +1628,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
        HWCAP_CAP(SYS_ID_AA64ISAR0_EL1, ID_AA64ISAR0_DP_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_ASIMDDP),
        HWCAP_CAP(SYS_ID_AA64ISAR0_EL1, ID_AA64ISAR0_FHM_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_ASIMDFHM),
        HWCAP_CAP(SYS_ID_AA64ISAR0_EL1, ID_AA64ISAR0_TS_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FLAGM),
+       HWCAP_CAP(SYS_ID_AA64ISAR0_EL1, ID_AA64ISAR0_TS_SHIFT, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_FLAGM2),
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_FP_SHIFT, FTR_SIGNED, 0, CAP_HWCAP, KERNEL_HWCAP_FP),
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_FP_SHIFT, FTR_SIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FPHP),
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_ASIMD_SHIFT, FTR_SIGNED, 0, CAP_HWCAP, KERNEL_HWCAP_ASIMD),
index f6f7936..62102f7 100644 (file)
@@ -92,6 +92,7 @@ static const char *const hwcap_str[] = {
        "svebitperm",
        "svesha3",
        "svesm4",
+       "flagm2",
        NULL
 };