From patchwork Sun May 8 07:39:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 765042 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p487dtc2017237 for ; Sun, 8 May 2011 07:39:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361Ab1EHHjj (ORCPT ); Sun, 8 May 2011 03:39:39 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:42443 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750911Ab1EHHjj (ORCPT ); Sun, 8 May 2011 03:39:39 -0400 Received: from elvis.elte.hu ([157.181.1.14]) by mx2.mail.elte.hu with esmtp (Exim) id 1QIyaW-0000BR-LI from ; Sun, 08 May 2011 09:39:38 +0200 Received: by elvis.elte.hu (Postfix, from userid 1004) id 9F8673E2526; Sun, 8 May 2011 09:39:29 +0200 (CEST) Date: Sun, 8 May 2011 09:39:34 +0200 From: Ingo Molnar To: Pekka Enberg Cc: KVM devel mailing list Subject: [PATCH] kvm tools: Enable earlyprintk=serial by default Message-ID: <20110508073934.GA28049@elte.hu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) Received-SPF: neutral (mx2.mail.elte.hu: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 08 May 2011 07:39:55 +0000 (UTC) Enable the earlyprintk console to the serial port, to allow the debugging of very early hangs/crashes. Since we already enable the serial console by default, this is a natural extension of it. I have tested that it indeed works, by provoking an early hang that triggers after the early console is enabled by before the real console is registered. In that case before the patch we get: $ ./kvm run --cpus 2 [ silent hang ] With this patch applied i got the early output: $ ./kvm run --cpus 60 [ 0.000000] console [earlyser0] enabled [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 2.6.39-rc6-tip-02944-g87b0bcf-dirty (mingo@aldebaran) (gcc version 4.6.0 20110419 (Red Hat 4.6.0-5) (GCC) ) #84 SMP Mon May 9 02:34:26 CEST 2011 [ 0.000000] Command line: notsc noapic noacpi pci=conf1 console=ttyS0 earlyprintk=serialroot=/dev/vda1 rw [ 0.000000] locking up the box! Signed-off-by: Ingo Molnar --- tools/kvm/kvm-run.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/kvm-run.c b/tools/kvm/kvm-run.c index 764a242..eb50b6a 100644 --- a/tools/kvm/kvm-run.c +++ b/tools/kvm/kvm-run.c @@ -409,7 +409,7 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix) kvm->nrcpus = nrcpus; memset(real_cmdline, 0, sizeof(real_cmdline)); - strcpy(real_cmdline, "notsc noapic noacpi pci=conf1 console=ttyS0 "); + strcpy(real_cmdline, "notsc noapic noacpi pci=conf1 console=ttyS0 earlyprintk=serial"); if (kernel_cmdline) strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline));