arm64: fpsimd: Make sure SVE setup is complete before SIMD is used
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 13 Jan 2020 23:30:18 +0000 (23:30 +0000)
committerWill Deacon <will@kernel.org>
Tue, 14 Jan 2020 17:11:21 +0000 (17:11 +0000)
commit0cd82feb017e282b29e725801b7c90da69316734
tree8fa671cbbfc5b22230e56e80c0b23de3b6753455
parentb51c6ac220f77eb246e940442d970b4065c197b0
arm64: fpsimd: Make sure SVE setup is complete before SIMD is used

In-kernel users of NEON rely on may_use_simd() to check if the SIMD
can be used. However, we must initialize the SVE before SIMD can
be used. Add a sanity check to make sure that we have completed the
SVE setup before anyone uses the SIMD.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/simd.h