ARM: 9044/1: vfp: use undef hook for VFP support detection
authorArd Biesheuvel <ardb@kernel.org>
Sat, 19 Dec 2020 15:29:58 +0000 (16:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:02 +0000 (11:54 +0100)
commitbf7b8c112a93f4e3c2bf0323605275b11d764194
treedb2c324376e09b29697d347ca6b56449e44e4a59
parent3f27cb2e13a10cc97321762670523d5545758554
ARM: 9044/1: vfp: use undef hook for VFP support detection

[ Upstream commit 3cce9d44321e460e7c88cdec4e4537a6e9ad7c0d ]

Commit f77ac2e378be9dd6 ("ARM: 9030/1: entry: omit FP emulation for UND
exceptions taken in kernel mode") failed to take into account that there
is in fact a case where we relied on this code path: during boot, the
VFP detection code issues a read of FPSID, which will trigger an undef
exception on cores that lack VFP support.

So let's reinstate this logic using an undef hook which is registered
only for the duration of the initcall to vpf_init(), and which sets
VFP_arch to a non-zero value - as before - if no VFP support is present.

Fixes: f77ac2e378be9dd6 ("ARM: 9030/1: entry: omit FP emulation for UND ...")
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/vfp/entry.S
arch/arm/vfp/vfpmodule.c