linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: julien.grall@linaro.org (Julien Grall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] xen/arm: allow console=hvc0 to be omitted for guests
Date: Fri, 13 Feb 2015 15:03:46 +0800	[thread overview]
Message-ID: <54DDA1D2.5010001@linaro.org> (raw)
In-Reply-To: <1423740543-6168-1-git-send-email-ard.biesheuvel@linaro.org>

Hi Ard,

On 12/02/2015 19:29, Ard Biesheuvel wrote:
> 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>
> ---
>   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 0abeefa7dbf8..927be1d1bad7 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>
>
> @@ -255,6 +256,9 @@ void __init xen_early_init(void)
>   		xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
>   	else
>   		xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED);
> +
> +	if (!console_set_on_cmdline && !xen_initial_domain())
> +		add_preferred_console("hvc", 0, NULL);

Unfortunately, this won't work as expected.

console_set_on_cmdline is set when Linux parses the early params. The 
parsing is done after setup_arch (the function which call xen_early_init).

So we will end up to add the HVC console even if a console has been 
passed on the command line.

>   }
>
>   static int __init xen_guest_init(void)
>

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-02-13  7:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 11:29 [PATCH v2] xen/arm: allow console=hvc0 to be omitted for guests Ard Biesheuvel
2015-02-13  7:03 ` Julien Grall [this message]
2015-02-13  7:12   ` Ard Biesheuvel
2015-02-13  7:17     ` Julien Grall
2015-02-16  9:37       ` Ard Biesheuvel
2015-02-16 10:09         ` 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=54DDA1D2.5010001@linaro.org \
    --to=julien.grall@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).