Skip to content

Commit c0d8832

Browse files
Suzuki K Poulosectmarinas
authored andcommitted
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. Cc: stable@vger.kernel.org Cc: Dave Martin <dave.martin@arm.com> Cc: Matthias Brugger <mbrugger@suse.com> Cc: James Morse <james.morse@arm.com> Reported-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent b02faed commit c0d8832

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(void)
649649
return 0;
650650
}
651651

652-
late_initcall(armv8_deprecated_init);
652+
core_initcall(armv8_deprecated_init);

arch/arm64/kernel/cpufeature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,4 +1307,4 @@ static int __init enable_mrs_emulation(void)
13071307
return 0;
13081308
}
13091309

1310-
late_initcall(enable_mrs_emulation);
1310+
core_initcall(enable_mrs_emulation);

0 commit comments

Comments
 (0)