Skip to content

Commit d006e95

Browse files
committed
parisc: Detect QEMU earlier in boot process
While adding LASI support to QEMU, I noticed that the QEMU detection in the kernel happens much too late. For example, when a LASI chip is found by the kernel, it registers the LASI LED driver as well. But when we run on QEMU it makes sense to avoid spending unnecessary CPU cycles, so we need to access the running_on_QEMU flag earlier than before. This patch now makes the QEMU detection the fist task of the Linux kernel by moving it to where the kernel enters the C-coding. Fixes: 310d827 ("parisc: qemu idle sleep support") Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org # v4.14+
1 parent f324fa5 commit d006e95

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

arch/parisc/kernel/process.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,6 @@ void __cpuidle arch_cpu_idle(void)
210210

211211
static int __init parisc_idle_init(void)
212212
{
213-
const char *marker;
214-
215-
/* check QEMU/SeaBIOS marker in PAGE0 */
216-
marker = (char *) &PAGE0->pad0;
217-
running_on_qemu = (memcmp(marker, "SeaBIOS", 8) == 0);
218-
219213
if (!running_on_qemu)
220214
cpu_idle_poll_ctrl(1);
221215

arch/parisc/kernel/setup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ void __init start_parisc(void)
397397
int ret, cpunum;
398398
struct pdc_coproc_cfg coproc_cfg;
399399

400+
/* check QEMU/SeaBIOS marker in PAGE0 */
401+
running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0);
402+
400403
cpunum = smp_processor_id();
401404

402405
init_cpu_topology();

0 commit comments

Comments
 (0)