mbox series

[v3,0/3] arm64: Add two HWCAPs for Arm v8.7 FP behaviour

Message ID 20211210165432.8106-1-joey.gouly@arm.com (mailing list archive)
Headers show
Series arm64: Add two HWCAPs for Arm v8.7 FP behaviour | expand

Message

Joey Gouly Dec. 10, 2021, 4:54 p.m. UTC
This series adds new HWCAPs for two Arm v8.7 features:
  - FEAT_AFP: Alternate floating-point behavior for specific
    floating point instructions.
  - FEAT_RPRES: Increased precision of Reciprocal Estimate and
    Reciprocal Square Root Estimate from an 8-bit mantissa to a
    12-bit mantissa.

These features can be enabled by userspace by setting some new bits
in FPCR. These new bits are FPCR.{NEP, AH, FIZ}. Since these must be
explicitly enabled by userspace, this should not affect existing
applications.

This has been tested with:
  - FVP: combinations of both features, including mismatched CPUs
  - qemu: regression test, neither feature is supported
  - juno: regression test, neither feature is supported

Changes since v2 [1]:
  - Add comment explaining the missing 0x1 value

Thanks,
Joey

[1] https://lore.kernel.org/linux-arm-kernel/20211207124226.50095-1-joey.gouly@arm.com/

Joey Gouly (3):
  arm64: cpufeature: add HWCAP for FEAT_AFP
  arm64: add ID_AA64ISAR2_EL1 sys register
  arm64: cpufeature: add HWCAP for FEAT_RPRES

 Documentation/arm64/cpu-feature-registers.rst | 17 +++++++++++++++++
 Documentation/arm64/elf_hwcaps.rst            |  8 ++++++++
 arch/arm64/include/asm/cpu.h                  |  1 +
 arch/arm64/include/asm/hwcap.h                |  2 ++
 arch/arm64/include/asm/sysreg.h               | 16 ++++++++++++++++
 arch/arm64/include/uapi/asm/hwcap.h           |  2 ++
 arch/arm64/kernel/cpufeature.c                | 13 +++++++++++++
 arch/arm64/kernel/cpuinfo.c                   |  3 +++
 arch/arm64/kvm/sys_regs.c                     |  2 +-
 9 files changed, 63 insertions(+), 1 deletion(-)

Comments

Marc Zyngier Dec. 10, 2021, 5:31 p.m. UTC | #1
On Fri, 10 Dec 2021 16:54:29 +0000,
Joey Gouly <joey.gouly@arm.com> wrote:
> 
> This series adds new HWCAPs for two Arm v8.7 features:
>   - FEAT_AFP: Alternate floating-point behavior for specific
>     floating point instructions.
>   - FEAT_RPRES: Increased precision of Reciprocal Estimate and
>     Reciprocal Square Root Estimate from an 8-bit mantissa to a
>     12-bit mantissa.
> 
> These features can be enabled by userspace by setting some new bits
> in FPCR. These new bits are FPCR.{NEP, AH, FIZ}. Since these must be
> explicitly enabled by userspace, this should not affect existing
> applications.

For the series:

Acked-by: Marc Zyngier <maz@kernel.org>

	M.
Catalin Marinas Dec. 13, 2021, 7:17 p.m. UTC | #2
On Fri, 10 Dec 2021 16:54:29 +0000, Joey Gouly wrote:
> This series adds new HWCAPs for two Arm v8.7 features:
>   - FEAT_AFP: Alternate floating-point behavior for specific
>     floating point instructions.
>   - FEAT_RPRES: Increased precision of Reciprocal Estimate and
>     Reciprocal Square Root Estimate from an 8-bit mantissa to a
>     12-bit mantissa.
> 
> [...]

Applied to arm64 (for-next/armv8_7-fp), thanks!

[1/3] arm64: cpufeature: add HWCAP for FEAT_AFP
      https://git.kernel.org/arm64/c/5c13f042e732
[2/3] arm64: add ID_AA64ISAR2_EL1 sys register
      https://git.kernel.org/arm64/c/9e45365f1469
[3/3] arm64: cpufeature: add HWCAP for FEAT_RPRES
      https://git.kernel.org/arm64/c/1175011a7d00