Commit 5c13f042 authored by Joey Gouly's avatar Joey Gouly Committed by Catalin Marinas
Browse files

arm64: cpufeature: add HWCAP for FEAT_AFP



Add a new HWCAP to detect the Alternate Floating-point Behaviour
feature (FEAT_AFP), introduced in Armv8.7.

Also expose this to userspace in the ID_AA64MMFR1_EL1 feature register.

Signed-off-by: default avatarJoey Gouly <joey.gouly@arm.com>
Cc: Will Deacon <will@kernel.org>
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211210165432.8106-2-joey.gouly@arm.com


Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent d58071a8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -275,6 +275,15 @@ infrastructure:
     | SVEVer                       | [3-0]   |    y    |
     +------------------------------+---------+---------+

  8) ID_AA64MMFR1_EL1 - Memory model feature register 1

     +------------------------------+---------+---------+
     | Name                         |  bits   | visible |
     +------------------------------+---------+---------+
     | AFP                          | [47-44] |    y    |
     +------------------------------+---------+---------+


Appendix I: Example
-------------------

+4 −0
Original line number Diff line number Diff line
@@ -251,6 +251,10 @@ HWCAP2_ECV

    Functionality implied by ID_AA64MMFR0_EL1.ECV == 0b0001.

HWCAP2_AFP

    Functionality implied by ID_AA64MFR1_EL1.AFP == 0b0001.

4. Unused AT_HWCAP bits
-----------------------

+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@
#define KERNEL_HWCAP_BTI		__khwcap2_feature(BTI)
#define KERNEL_HWCAP_MTE		__khwcap2_feature(MTE)
#define KERNEL_HWCAP_ECV		__khwcap2_feature(ECV)
#define KERNEL_HWCAP_AFP		__khwcap2_feature(AFP)

/*
 * This yields a mask that user programs can use to figure out what
+1 −0
Original line number Diff line number Diff line
@@ -889,6 +889,7 @@
#endif

/* id_aa64mmfr1 */
#define ID_AA64MMFR1_AFP_SHIFT		44
#define ID_AA64MMFR1_ETS_SHIFT		36
#define ID_AA64MMFR1_TWED_SHIFT		32
#define ID_AA64MMFR1_XNX_SHIFT		28
+1 −0
Original line number Diff line number Diff line
@@ -76,5 +76,6 @@
#define HWCAP2_BTI		(1 << 17)
#define HWCAP2_MTE		(1 << 18)
#define HWCAP2_ECV		(1 << 19)
#define HWCAP2_AFP		(1 << 20)

#endif /* _UAPI__ASM_HWCAP_H */
Loading