Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2458198yba; Mon, 15 Apr 2019 12:04:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfTMjEEiSbGz3iYdr5A4PopFsuCB5x5YtrWR0upn9lrovMVpkvSJAenmcPUqyf0q+mg4RT X-Received: by 2002:a63:e402:: with SMTP id a2mr73038387pgi.268.1555355075551; Mon, 15 Apr 2019 12:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355075; cv=none; d=google.com; s=arc-20160816; b=VSum4W1b7QhfywpW9VP9U1V8UDR975dwx7fkTJVox4rD1zLRbLLyyANrSQ2iLazAyw dRQBtOuPbjRzK+cfmBLAUksxZIVurF379G5cqoA7E2QGENiL7DuZcdV117YC9pGThzhp S05eZ023NGiwVncVUHGh8tMlq+/beU+/spSoDoM4AOBBKMrjgG6E+iUL/D/TyY0V+Ohp siDr2Xjf9jwZBXjuDI05pEFi1BD9UBjfe4HhBmBHvp5ZCLyEY3lTzT8ums2hVH7Atu15 lWKBtCwmKBDBuCrmyOxZCKFO4QHxONzFaRvuqNwfkEPMLGs/3/D+yJa2NQhd3DgCy+gi xsBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+7GuyM6zsHoujjgHKbZKYHL9NgMlYasc2DHWxAxdhcQ=; b=kwr+W/yLKqqwrsI8ymV/B/DBR02f7fDytGwRzoFXdDnEoO6iestCgqPPwOTFZD3dlK IZ6a0CM5VRu1eaP0IA/hxjquJ5mUH3xfoQSeNbEMQFz+kw7qqukePleWbXVXL3f9pwEL WJ9WGfBUe7jQ2/2O1vBt9Gc7EsdqK7HvyqEKN41a8qhFqJGXybMC2rnG6fj+J51KBcsX Upe4vIbft0YKYp6oe5HeKjzz5dWdZXarVEz1ya8s6A8EitY/2jXczJCa7vTGq98sLhzU SAJkp+5CovG/5Lxjqn8t0hgptNh+DfpEk8EEA3DCQJKmrfyVNCEJRUD7bCVeoTj+QXju aEZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sMjtPm9+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si43952033pgq.208.2019.04.15.12.04.18; Mon, 15 Apr 2019 12:04:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sMjtPm9+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728276AbfDOTDJ (ORCPT + 99 others); Mon, 15 Apr 2019 15:03:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:34714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729128AbfDOTDI (ORCPT ); Mon, 15 Apr 2019 15:03:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 28A2D218A1; Mon, 15 Apr 2019 19:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555354987; bh=aXCCPjBnGQbsB/AexkJrcbDMVzsO+8MxBP0rPypiDgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sMjtPm9+D/zSF/wdXTOvsQ+B4/6LJ0e1u7dH/uvEHmq+XEgGnCE+j+buwUmbcN5T6 OoVhhgRlGsijADoLzsJW/K+UeB5sb2o2FulRGPNxZJRjknebKy0rCTC8kQoGQgCCmE GvUflpKVXhqn8kbudVNtq1LARLOTDerT7wmKYxfg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Helge Deller Subject: [PATCH 4.14 40/69] parisc: Detect QEMU earlier in boot process Date: Mon, 15 Apr 2019 20:58:58 +0200 Message-Id: <20190415183732.561212140@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183726.036654568@linuxfoundation.org> References: <20190415183726.036654568@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Helge Deller commit d006e95b5561f708d0385e9677ffe2c46f2ae345 upstream. 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: 310d82784fb4 ("parisc: qemu idle sleep support") Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Greg Kroah-Hartman --- arch/parisc/kernel/process.c | 6 ------ arch/parisc/kernel/setup.c | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -209,12 +209,6 @@ void __cpuidle arch_cpu_idle(void) static int __init parisc_idle_init(void) { - const char *marker; - - /* check QEMU/SeaBIOS marker in PAGE0 */ - marker = (char *) &PAGE0->pad0; - running_on_qemu = (memcmp(marker, "SeaBIOS", 8) == 0); - if (!running_on_qemu) cpu_idle_poll_ctrl(1); --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -406,6 +406,9 @@ void __init start_parisc(void) int ret, cpunum; struct pdc_coproc_cfg coproc_cfg; + /* check QEMU/SeaBIOS marker in PAGE0 */ + running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0); + cpunum = smp_processor_id(); set_firmware_width_unlocked();