Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen/arm: allow console=hvc0 to be omitted for guests

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

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>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>

authored by

Ard Biesheuvel and committed by
David Vrabel
f1dddd11 5882bfef

+4
+4
arch/arm/xen/enlighten.c
··· 24 24 #include <linux/cpuidle.h> 25 25 #include <linux/cpufreq.h> 26 26 #include <linux/cpu.h> 27 + #include <linux/console.h> 27 28 28 29 #include <linux/mm.h> 29 30 ··· 184 183 xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED; 185 184 else 186 185 xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED); 186 + 187 + if (!console_set_on_cmdline && !xen_initial_domain()) 188 + add_preferred_console("hvc", 0, NULL); 187 189 } 188 190 189 191 static int __init xen_guest_init(void)