Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2474641yba; Mon, 15 Apr 2019 12:24:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsRQHNdxZCHtr+KoA2wW31w7hnwdeUlEpqI3WuHkz5oC0vh8VVknWdVgOaktX29vfNQgEl X-Received: by 2002:a63:530e:: with SMTP id h14mr36192238pgb.136.1555356265690; Mon, 15 Apr 2019 12:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555356265; cv=none; d=google.com; s=arc-20160816; b=lnLtCceiagQoh9jF6BZxeH2N5cJCdThXXaaXV86L8KRx9NeCgmQkQsRDdcD1GbNzQ/ hoWJUeJZ5Inzhmx71tIMyK7+IagwoBfVqOcwE2kHFDzGeJf9L6xqnMYjE+ywBKgVVthW oqM7xEVa3zovKlU5289msfNEmTBb5MbLQeUoaE/LFZmY4E+ypCMgpWDNPhWo1UpXe9sC luSZJUYPE6hEtRSUCJKQ/QNQd9Hutm5xuca0a6ykKZP/oUumELveCZif8owJdo7XNhxn pQdBXnjbGcDZySAOww6M7t5uvQpowqwAxt1K5ee/bC3XzzXHYuDorDf69YqFbZqLCefp np/Q== 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=l3hZD/1HZFnqPbnV8F9fhabMMHYk12UmCUg4838Iqqk=; b=m3KpSatNqHTO8v/gQPXx98RlX57qpI3iOjDZu3CwnnvMQQFrwBzefiRBVBvNDxVvhv 1JWRdgf6sFvnZq6gxwSoNj7wHHk7ZtaVCSHd5dnWyDy696NgJcee/vlkIqzEiSzzSFsy 29uhVOdTGWDikyVuCsnJb2WAuy3wA9ymICBe4kCDSGtGBBtaGHLUvDDJDKoenewk0Sg/ JiHL+4xYY2L9ujgnDmBshEufDlfSAufGrA957YzDpOdPDwvyBNEGeZTP1XR8fNP+Lhn4 rfAiLr0zRbfZPPP4wsnyWmPyZF5F/B9xB3em8D3VXkYQWXS5EZ8MkM60OXYG/VQ62tVH SHzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="h/koQAZb"; 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 z73si45006283pgd.345.2019.04.15.12.24.09; Mon, 15 Apr 2019 12:24:25 -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="h/koQAZb"; 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 S1730335AbfDOTH4 (ORCPT + 99 others); Mon, 15 Apr 2019 15:07:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729806AbfDOTHy (ORCPT ); Mon, 15 Apr 2019 15:07:54 -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 4AF922087C; Mon, 15 Apr 2019 19:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355273; bh=3pfRlHGvDOfiJHSPXsEvGAxacrekbSneK81BfCV8twg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h/koQAZbd+7+CRTMCEJnOcyYKqd1zCW4eyyNQCEoUYBqo+rpoZKpjAIFFM9uqdKdY AjYTocQrOdEcOLzw3NQcWa5F8hptG2YJzPmjEHtIBbuOXtEOs9mVlXh4gPZZ4hroYg eVf5ge2WHACmhJFiI5BEN1ICENnAvVNie06eYaos= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Helge Deller Subject: [PATCH 4.19 056/101] parisc: Detect QEMU earlier in boot process Date: Mon, 15 Apr 2019 20:58:54 +0200 Message-Id: <20190415183743.487943324@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@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 @@ -210,12 +210,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 @@ -399,6 +399,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(); init_cpu_topology();