]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.13.6/arm64-ensure-the-instruction-emulation-is-ready-for-userspace.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.13.6 / arm64-ensure-the-instruction-emulation-is-ready-for-userspace.patch
1 From c0d8832e78cbfd4a64b7112e34920af4b0b0e60e Mon Sep 17 00:00:00 2001
2 From: Suzuki K Poulose <suzuki.poulose@arm.com>
3 Date: Fri, 6 Oct 2017 14:16:52 +0100
4 Subject: arm64: Ensure the instruction emulation is ready for userspace
5
6 From: Suzuki K Poulose <suzuki.poulose@arm.com>
7
8 commit c0d8832e78cbfd4a64b7112e34920af4b0b0e60e upstream.
9
10 We trap and emulate some instructions (e.g, mrs, deprecated instructions)
11 for the userspace. However the handlers for these are registered as
12 late_initcalls and the userspace could be up and running from the initramfs
13 by that time (with populate_rootfs, which is a rootfs_initcall()). This
14 could cause problems for the early applications ending up in failure
15 like :
16
17 [ 11.152061] modprobe[93]: undefined instruction: pc=0000ffff8ca48ff4
18
19 This patch promotes the specific calls to core_initcalls, which are
20 guaranteed to be completed before we hit userspace.
21
22 Cc: Dave Martin <dave.martin@arm.com>
23 Cc: Matthias Brugger <mbrugger@suse.com>
24 Cc: James Morse <james.morse@arm.com>
25 Reported-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
26 Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
27 Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30 ---
31 arch/arm64/kernel/armv8_deprecated.c | 2 +-
32 arch/arm64/kernel/cpufeature.c | 2 +-
33 2 files changed, 2 insertions(+), 2 deletions(-)
34
35 --- a/arch/arm64/kernel/armv8_deprecated.c
36 +++ b/arch/arm64/kernel/armv8_deprecated.c
37 @@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(
38 return 0;
39 }
40
41 -late_initcall(armv8_deprecated_init);
42 +core_initcall(armv8_deprecated_init);
43 --- a/arch/arm64/kernel/cpufeature.c
44 +++ b/arch/arm64/kernel/cpufeature.c
45 @@ -1294,4 +1294,4 @@ static int __init enable_mrs_emulation(v
46 return 0;
47 }
48
49 -late_initcall(enable_mrs_emulation);
50 +core_initcall(enable_mrs_emulation);