All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64: errata: remove BF16 HWCAP due to incorrect result on Cortex-A510
@ 2022-09-09 16:59 James Morse
  2022-09-09 16:59 ` [PATCH 1/3] arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space James Morse
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: James Morse @ 2022-09-09 16:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Catalin Marinas, Suzuki K Poulose, Will Deacon, James Morse

Hello!

Cortex-A510 has an erratum where the BFMMLA or VMMLA instructions might
produce the incorrect result. This only happens if two Cortex-A510 CPUs
are configured by the SoC manafacturer in a particular way to share some
hardware, and are using it at the same time. It isn't possible for linux
to know how the CPUs were configured, so the only option is to disable
the BF16 feature for all Cortex-A510 CPUs.

This won't stop user-space from trying to use the instructions to see
if they work - but such software is already broken on big/little systems
with mismathed features.

Removing the BF16 feature involves removing both the HWCAP, as was done
by commit 44b3834b2eed "arm64: errata: Remove AES hwcap for COMPAT tasks",
and the emulated view of that register that user-space has.
(This wasn't previously needed as aarch32 ID registers aren't accessible
like this).

As there are now two of these things, this series tries to add a more
maintainable way to remove features, to avoid spilling workaround like
this into cpufeature.c.

Instead, cpu_errata.c modifies the user_mask that is used for emulation
of the id registers, and cpufeature.c builds the HWCAPs based on this.

I have patches to convert the AES workaround to do the same, but that
should wait until the aarch32 ID registers are generated by the sysreg
awk scripts (it needs some new masks defined).

[0] https://developer.arm.com/documentation/SDEN1873351/1400/?lang=en

Thanks,

James Morse (3):
  arm64: cpufeature: Force HWCAP to be based on the sysreg visible to
    user-space
  arm64: cpufeature: Expose get_arm64_ftr_reg() outside cpufeature.c
  arm64: errata: remove BF16 HWCAP due to incorrect result on
    Cortex-A510

 Documentation/arm64/silicon-errata.rst |  2 ++
 arch/arm64/Kconfig                     | 14 +++++++++
 arch/arm64/include/asm/cpufeature.h    |  2 ++
 arch/arm64/kernel/cpu_errata.c         | 27 ++++++++++++++++
 arch/arm64/kernel/cpufeature.c         | 43 ++++++++++++++++++++------
 arch/arm64/tools/cpucaps               |  1 +
 6 files changed, 79 insertions(+), 10 deletions(-)

-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-09-16 17:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09 16:59 [PATCH 0/3] arm64: errata: remove BF16 HWCAP due to incorrect result on Cortex-A510 James Morse
2022-09-09 16:59 ` [PATCH 1/3] arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space James Morse
2022-09-12 15:20   ` Suzuki K Poulose
2022-09-09 16:59 ` [PATCH 2/3] arm64: cpufeature: Expose get_arm64_ftr_reg() outside cpufeature.c James Morse
2022-09-12 15:22   ` Suzuki K Poulose
2022-09-09 16:59 ` [PATCH 3/3] arm64: errata: remove BF16 HWCAP due to incorrect result on Cortex-A510 James Morse
2022-09-12 15:30   ` Suzuki K Poulose
2022-09-15 13:39     ` James Morse
2022-09-09 18:29 ` [PATCH 0/3] " Robin Murphy
2022-09-15 13:39   ` James Morse
2022-09-15 14:21     ` Robin Murphy
2022-09-16 17:44 ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.