Skip to content

Commit

Permalink
arm64: Ensure the instruction emulation is ready for userspace
Browse files Browse the repository at this point in the history
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: [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]>
Signed-off-by: Catalin Marinas <[email protected]>
  • Loading branch information
Suzuki K Poulose authored and ctmarinas committed Oct 6, 2017
1 parent b02faed commit c0d8832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/arm64/kernel/armv8_deprecated.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(void)
return 0;
}

late_initcall(armv8_deprecated_init);
core_initcall(armv8_deprecated_init);
2 changes: 1 addition & 1 deletion arch/arm64/kernel/cpufeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,4 +1307,4 @@ static int __init enable_mrs_emulation(void)
return 0;
}

late_initcall(enable_mrs_emulation);
core_initcall(enable_mrs_emulation);

0 comments on commit c0d8832

Please sign in to comment.