]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.35/parisc-detect-qemu-earlier-in-boot-process.patch
Linux 4.19.35
[thirdparty/kernel/stable-queue.git] / releases / 4.19.35 / parisc-detect-qemu-earlier-in-boot-process.patch
CommitLineData
de2fa02c
GKH
1From d006e95b5561f708d0385e9677ffe2c46f2ae345 Mon Sep 17 00:00:00 2001
2From: Helge Deller <deller@gmx.de>
3Date: Tue, 2 Apr 2019 12:13:27 +0200
4Subject: parisc: Detect QEMU earlier in boot process
5
6From: Helge Deller <deller@gmx.de>
7
8commit d006e95b5561f708d0385e9677ffe2c46f2ae345 upstream.
9
10While adding LASI support to QEMU, I noticed that the QEMU detection in
11the kernel happens much too late. For example, when a LASI chip is found
12by the kernel, it registers the LASI LED driver as well. But when we
13run on QEMU it makes sense to avoid spending unnecessary CPU cycles, so
14we need to access the running_on_QEMU flag earlier than before.
15
16This patch now makes the QEMU detection the fist task of the Linux
17kernel by moving it to where the kernel enters the C-coding.
18
19Fixes: 310d82784fb4 ("parisc: qemu idle sleep support")
20Signed-off-by: Helge Deller <deller@gmx.de>
21Cc: stable@vger.kernel.org # v4.14+
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24---
25 arch/parisc/kernel/process.c | 6 ------
26 arch/parisc/kernel/setup.c | 3 +++
27 2 files changed, 3 insertions(+), 6 deletions(-)
28
29--- a/arch/parisc/kernel/process.c
30+++ b/arch/parisc/kernel/process.c
31@@ -210,12 +210,6 @@ void __cpuidle arch_cpu_idle(void)
32
33 static int __init parisc_idle_init(void)
34 {
35- const char *marker;
36-
37- /* check QEMU/SeaBIOS marker in PAGE0 */
38- marker = (char *) &PAGE0->pad0;
39- running_on_qemu = (memcmp(marker, "SeaBIOS", 8) == 0);
40-
41 if (!running_on_qemu)
42 cpu_idle_poll_ctrl(1);
43
44--- a/arch/parisc/kernel/setup.c
45+++ b/arch/parisc/kernel/setup.c
46@@ -399,6 +399,9 @@ void __init start_parisc(void)
47 int ret, cpunum;
48 struct pdc_coproc_cfg coproc_cfg;
49
50+ /* check QEMU/SeaBIOS marker in PAGE0 */
51+ running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0);
52+
53 cpunum = smp_processor_id();
54
55 init_cpu_topology();