linux/Documentation/arch/arm64
Marc Zyngier 4204ca15ec arm64: Filter out SVE hwcaps when FEAT_SVE isn't implemented
commit 064737920b upstream.

The hwcaps code that exposes SVE features to userspace only
considers ID_AA64ZFR0_EL1, while this is only valid when
ID_AA64PFR0_EL1.SVE advertises that SVE is actually supported.

The expectations are that when ID_AA64PFR0_EL1.SVE is 0, the
ID_AA64ZFR0_EL1 register is also 0. So far, so good.

Things become a bit more interesting if the HW implements SME.
In this case, a few ID_AA64ZFR0_EL1 fields indicate *SME*
features. And these fields overlap with their SVE interpretations.
But the architecture says that the SME and SVE feature sets must
match, so we're still hunky-dory.

This goes wrong if the HW implements SME, but not SVE. In this
case, we end-up advertising some SVE features to userspace, even
if the HW has none. That's because we never consider whether SVE
is actually implemented. Oh well.

Fix it by restricting all SVE capabilities to ID_AA64PFR0_EL1.SVE
being non-zero. The HWCAPS documentation is amended to reflect the
actually checks performed by the kernel.

Fixes: 06a916feca ("arm64: Expose SVE2 features for userspace")
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: stable@vger.kernel.org
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250107-arm64-2024-dpisa-v5-1-7578da51fc3d@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-02-17 10:05:04 +01:00
..
acpi_object_usage.rst Documentation: Fix typos 2023-08-18 11:29:03 -06:00
amu.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
arm-acpi.rst Documentation/arch/arm64: Fix typo 2023-12-05 14:28:10 +00:00
asymmetric-32bit.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
booting.rst Move the arm64 architecture documentation under Documentation/arch/. This 2023-06-27 21:52:15 -07:00
cpu-feature-registers.rst arm64/sve: Report FEAT_SVE_B16B16 to userspace 2023-09-29 15:56:17 +01:00
cpu-hotplug.rst Documentation: Fix spelling mistakes 2024-09-05 14:35:45 -06:00
elf_hwcaps.rst arm64: Filter out SVE hwcaps when FEAT_SVE isn't implemented 2025-02-17 10:05:04 +01:00
features.rst docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
hugetlbpage.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
index.rst arm64: document virtual CPU hotplug's expectations 2024-06-28 18:38:32 +01:00
kasan-offsets.sh docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
kdump.rst Move the arm64 architecture documentation under Documentation/arch/. This 2023-06-27 21:52:15 -07:00
legacy_instructions.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
memory-tagging-extension.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
memory.rst Documentation: arm64: Update memory.rst for TBI 2024-07-04 15:10:31 +01:00
perf.rst Documentation: arm64: Document the PMU event counting threshold feature 2023-12-12 09:46:23 +00:00
pointer-authentication.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
ptdump.rst Move the arm64 architecture documentation under Documentation/arch/. This 2023-06-27 21:52:15 -07:00
silicon-errata.rst ACPI/IORT: Add PMCG platform information for HiSilicon HIP09A 2025-01-02 10:34:20 +01:00
sme.rst arm64/sme: Remove spurious 'is' in SME documentation 2024-02-21 18:02:46 +00:00
sve.rst arm64/fp: Clarify effect of setting an unsupported system VL 2024-02-21 18:02:46 +00:00
tagged-address-abi.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00
tagged-pointers.rst docs: arm64: Move arm64 documentation under Documentation/arch/ 2023-06-21 08:51:51 -06:00