arm64: Ensure the instruction emulation is ready for userspace
Subsystems (2)
PATCH 1/2 arm64: Ensure the instruction emulation is ready for userspace
We trap and emulate some instructions (e.g, mrs, deprecated instructions) for the userspace. However the handlers for these are registered as late_initcalls and the userspace could be up and running from the initramfs by that time (with populate_rootfs, which is a rootfs_initcall()). This could cause problems for the early applications ending up in failure like :
[ 11.152061] modprobe[93]: undefined instruction: pc=0000ffff8ca48ff4
This patch promotes the specific calls to core_initcalls, which are guaranteed to be completed before we hit userspace.
--- arch/arm64/kernel/armv8_deprecated.c | 2 +- arch/arm64/kernel/cpufeature.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kernel/armv8_deprecated.c +1 -1
@@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(void)return 0 ; } -late_initcall (armv8_deprecated_init); +core_initcall (armv8_deprecated_init);
arch/arm64/kernel/cpufeature.c +1 -1
@@ -1307,4 +1307,4 @@ static int __init enable_mrs_emulation(void)return 0 ; } -late_initcall (enable_mrs_emulation); +core_initcall (enable_mrs_emulation);
Signature · 1 line
2.13.6
PATCH 2/2 arm64: Ensure fpsimd support is ready before userspace is active
We register the pm/hotplug callbacks for FPSIMD as late_initcall, which happens after the userspace is active (from initramfs via populate_rootfs, a rootfs_initcall). Make sure we are ready even before the userspace could potentially use it, by promoting to a core_initcall.
--- arch/arm64/kernel/fpsimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/fpsimd.c +1 -1
@@ -444,4 +444,4 @@ static int __init fpsimd_init(void)return 0 ; } -late_initcall (fpsimd_init); +core_initcall (fpsimd_init);
Signature · 1 line
2.13.6
Catalin Marinas
maintainerQuoted 12 lines · Suzuki K. Poulose
We trap and emulate some instructions (e.g, mrs, deprecated instructions) for the userspace. However the handlers for these are registered as
late_initcallsand the userspace could be up and running from the initramfs by that time (withpopulate_rootfs, which is arootfs_initcall()). This could cause problems for the early applications ending up in failure like :[ 11.152061] modprobe[93]: undefined instruction: pc=0000ffff8ca48ff4This patch promotes the specific calls to
core_initcalls, which are guaranteed to be completed before we hit userspace.
Quoted 7 lines
Cc stable at vger.kernel.orgCc Catalin Marinas <[email protected]>Cc Dave Martin <[email protected]>Cc Matthias Brugger <[email protected]>Cc James Morse <[email protected]>Reported-by Matwey V. Kornilov <[email protected]>Signed-off-by Suzuki K Poulose <[email protected]>
Both patches queued for 4.14. Thanks.
Signature · 1 line
Catalin