From e7b29c634e53c93b3d6496e7cf66bb4bc9136e72 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 12 Oct 2017 09:01:20 +0100 Subject: [PATCH] fix aarch64 errors about modprobe --- arm64-ensure-ready-for-userspace.patch | 79 ++++++++++++++++++++++++++ kernel.spec | 4 ++ 2 files changed, 83 insertions(+) create mode 100644 arm64-ensure-ready-for-userspace.patch diff --git a/arm64-ensure-ready-for-userspace.patch b/arm64-ensure-ready-for-userspace.patch new file mode 100644 index 000000000..2468e2271 --- /dev/null +++ b/arm64-ensure-ready-for-userspace.patch @@ -0,0 +1,79 @@ +From c0d8832e78cbfd4a64b7112e34920af4b0b0e60e Mon Sep 17 00:00:00 2001 +From: Suzuki K Poulose +Date: Fri, 6 Oct 2017 14:16:52 +0100 +Subject: 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 +Cc: Matthias Brugger +Cc: James Morse +Reported-by: Matwey V. Kornilov +Signed-off-by: Suzuki K Poulose +Signed-off-by: Catalin Marinas +--- + arch/arm64/kernel/armv8_deprecated.c | 2 +- + arch/arm64/kernel/cpufeature.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c +index f0e6d71..d06fbe4 100644 +--- a/arch/arm64/kernel/armv8_deprecated.c ++++ b/arch/arm64/kernel/armv8_deprecated.c +@@ -649,4 +649,4 @@ static int __init armv8_deprecated_init(void) + return 0; + } + +-late_initcall(armv8_deprecated_init); ++core_initcall(armv8_deprecated_init); +diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c +index cd52d36..21e2c95 100644 +--- a/arch/arm64/kernel/cpufeature.c ++++ b/arch/arm64/kernel/cpufeature.c +@@ -1307,4 +1307,4 @@ static int __init enable_mrs_emulation(void) + return 0; + } + +-late_initcall(enable_mrs_emulation); ++core_initcall(enable_mrs_emulation); +From ae2e972dae3cea795e9f8f94eb1601213c2d49f0 Mon Sep 17 00:00:00 2001 +From: Suzuki K Poulose +Date: Fri, 6 Oct 2017 14:16:53 +0100 +Subject: 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. + +Cc: Will Deacon +Cc: Mark Rutland +Cc: Dave Martin +Signed-off-by: Suzuki K Poulose +Signed-off-by: Catalin Marinas +--- + arch/arm64/kernel/fpsimd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c +index f444f37..5d547de 100644 +--- a/arch/arm64/kernel/fpsimd.c ++++ b/arch/arm64/kernel/fpsimd.c +@@ -444,4 +444,4 @@ static int __init fpsimd_init(void) + + return 0; + } +-late_initcall(fpsimd_init); ++core_initcall(fpsimd_init); diff --git a/kernel.spec b/kernel.spec index f89de5526..587f08377 100644 --- a/kernel.spec +++ b/kernel.spec @@ -650,6 +650,10 @@ Patch333: PCI-aspm-deal-with-missing-root-ports-in-link-state-handling.patch # https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=synquacer-netsec Patch334: arm64-socionext-96b-enablement.patch +# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c0d8832e78cbfd4a64b7112e34920af4b0b0e60e +# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ae2e972dae3cea795e9f8f94eb1601213c2d49f0 +Patch350: arm64-ensure-ready-for-userspace.patch + # 400 - IBM (ppc/s390x) patches # 500 - Temp fixes/CVEs etc