All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm tools: Enable earlyprintk=serial by default
@ 2011-05-08  7:39 Ingo Molnar
  2011-05-08 13:25 ` Rodrigo Campos
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Molnar @ 2011-05-08  7:39 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: KVM devel mailing list


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 <mingo@elte.hu>
---
 tools/kvm/kvm-run.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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));
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kvm tools: Enable earlyprintk=serial by default
  2011-05-08  7:39 [PATCH] kvm tools: Enable earlyprintk=serial by default Ingo Molnar
@ 2011-05-08 13:25 ` Rodrigo Campos
  0 siblings, 0 replies; 2+ messages in thread
From: Rodrigo Campos @ 2011-05-08 13:25 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Pekka Enberg, KVM devel mailing list

On Sun, May 08, 2011 at 09:39:34AM +0200, Ingo Molnar wrote:
> 
> 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");

I think the space at the end of the string that you delete, squashes the early
printk option with the next one (root= in your case), like in the output you show:

>  [    0.000000] Command line: notsc noapic noacpi pci=conf1 console=ttyS0 earlyprintk=serialroot=/dev/vda1 rw 
I mean here                                                                                   ^





Thanks,
Rodrigo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-08 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-08  7:39 [PATCH] kvm tools: Enable earlyprintk=serial by default Ingo Molnar
2011-05-08 13:25 ` Rodrigo Campos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.