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 b73a2519ecf231d74ab36f68a9fa2cfdee8af6ac..ee8dbfe652b636c746ee910d5bb8de693adeaf2c 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 b4bfb6672168b3f24eb18bd1822e3a6dd7441580..838c47f90389306da4712789955e4d4dd5886f2b 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 1a772b162191ad71f2a07620c9d4f31b7ab59d65..7902ae4f38b4356bbf27e1fae2913a1505cc068e 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 2a7159fda3ce41455ebb52b76278b052fc5011d4..8350016dbb28d76f1ab3f0584164251a9dd72306 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 f6f7936be6e7f81b0e39a5db68afdd864edda775..62102f75dc1e9d2fef011f8330fc5a499a7ad7f6 100644 (file)
@@ -92,6 +92,7 @@ static const char *const hwcap_str[] = {
        "svebitperm",
        "svesha3",
        "svesm4",
+       "flagm2",
        NULL
 };