linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] xen/arm: allow console=hvc0 to be omitted for guests
Date: Fri, 30 Jan 2015 13:58:39 +0000	[thread overview]
Message-ID: <1422626319-30752-1-git-send-email-ard.biesheuvel@linaro.org> (raw)

This patch registers hvc0 as the preferred console if no console
has been specified explicitly on the kernel command line.

The purpose is to allow platform agnostic kernels and boot images
(such as distro installers) to boot in a Xen/ARM domU without the
need to modify the command line by hand.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---

This applies on top of the patch Julien is cooking up to move the
call to xen_guest_init() to an earlier boot stage. This needs to
be at least before the call to console_init() in start_kernel()
for this patch to do anything meaningful.

 arch/arm/xen/enlighten.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index c7ca936ebd99..61382cafa877 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -24,6 +24,7 @@
 #include <linux/cpuidle.h>
 #include <linux/cpufreq.h>
 #include <linux/cpu.h>
+#include <linux/console.h>
 
 #include <linux/mm.h>
 
@@ -322,6 +323,9 @@ static int __init xen_guest_init(void)
 
 	register_cpu_notifier(&xen_cpu_notifier);
 
+	if (!console_set_on_cmdline)
+		add_preferred_console("hvc", 0, NULL);
+
 	return 0;
 }
 early_initcall(xen_guest_init);
-- 
1.8.3.2

             reply	other threads:[~2015-01-30 13:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 13:58 Ard Biesheuvel [this message]
2015-02-10  7:00 ` [PATCH] xen/arm: allow console=hvc0 to be omitted for guests Stefano Stabellini
2015-02-10  7:26   ` Ian Campbell
2015-02-10  7:51     ` Ard Biesheuvel
2015-02-10  8:59       ` Ian Campbell
2015-02-12  4:35         ` Stefano Stabellini
2015-02-12  4:52           ` Stefano Stabellini
2015-02-12  4:54           ` Ian Campbell
2015-02-12  5:20             ` Julien Grall
2015-02-12  6:12               ` Stefano Stabellini
2015-02-10  7:36   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422626319-30752-1-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).