android_kernel_samsung_sm8650/arch/arm64
Mark Brown aa5cf8bd13 arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes
commit d4d5be94a87872421ea2569044092535aff0b886 upstream.

When we reconfigure the SVE vector length we discard the backing storage
for the SVE vectors and then reallocate on next SVE use, leaving the SME
specific state alone. This means that we do not enable SME traps if they
were already disabled. That means that userspace code can enter streaming
mode without trapping, putting the task in a state where if we try to save
the state of the task we will fault.

Since the ABI does not specify that changing the SVE vector length disturbs
SME state, and since SVE code may not be aware of SME code in the process,
we shouldn't simply discard any ZA state. Instead immediately reallocate
the storage for SVE, and disable SME if we change the SVE vector length
while there is no SME state active.

Disabling SME traps on SVE vector length changes would make the overall
code more complex since we would have a state where we have valid SME state
stored but might get a SME trap.

Fixes: 9e4ab6c891 ("arm64/sme: Implement vector length configuration prctl()s")
Reported-by: David Spickett <David.Spickett@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230720-arm64-fix-sve-sme-vl-change-v2-1-8eea06b82d57@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:50:27 +02:00
..
boot arm64: dts: mediatek: mt8192: Fix CPUs capacity-dmips-mhz 2023-07-19 16:21:31 +02:00
configs This update includes the following changes: 2022-10-10 13:04:25 -07:00
crypto crypto: arm64/aes-neonbs - fix crash with CFI enabled 2023-05-11 23:03:02 +09:00
hyperv hyperv: simplify and rename generate_guest_id 2022-09-28 13:36:56 +00:00
include arm64: sme: Use STR P to clear FFR context field in streaming SVE mode 2023-07-19 16:21:45 +02:00
kernel arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes 2023-07-27 08:50:27 +02:00
kvm KVM: arm64: Restore GICv2-on-GICv3 functionality 2023-06-28 11:12:40 +02:00
lib Networking changes for 6.0. 2022-08-03 16:29:08 -07:00
mm arm64/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:24 +02:00
net bpf, arm64: Fixed a BTI error on returning to patched function 2023-04-20 12:35:08 +02:00
tools arm64/sysreg: Fix typo in SCTR_EL1.SPINTMASK 2022-10-07 14:30:11 +01:00
xen xen: allow pv-only hypercalls only with CONFIG_XEN_PV 2021-11-02 08:11:01 -05:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig arm64/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:24 +02:00
Kconfig.debug
Kconfig.platforms ARM: SoC code changes for 6.1 2022-10-06 11:22:25 -07:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00