Skip to contentSkip to conversation

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

PATCH In review Ard Biesheuvel 4 participants 20 messages Jan 30, 2015 – Feb 12, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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.

---

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(+)
arch/arm/xen/enlighten.c +4 -0
index c7ca936ebd99..61382cafa877 100644
@@ -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);
Signature · 1 line
1.8.3.2
#1 lore raw

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

Quoted 7 lines · Ard Biesheuvel

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.

Quoted 7 lines

---

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.

This patch looks good but there isn't much point in queuing this up without the prerequisite.

Julien, what patch exactly is that? What is the status of it?

Quoted 28 lines
 arch/arm/xen/enlighten.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +4 -0
index c7ca936ebd99..61382cafa877 100644
@@ -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);
Signature · 1 line
1.8.3.2
#2 lore raw

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

Quoted 35 lines · Stefano Stabellini
Quoted 7 lines · Ard Biesheuvel

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.

Quoted 7 lines

---

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.

This patch looks good but there isn't much point in queuing this up without the prerequisite.

Julien, what patch exactly is that? What is the status of it?

Quoted 13 lines
 arch/arm/xen/enlighten.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index c7ca936ebd99..61382cafa877 100644
@@ -24,6 +24,7 @@
 #include <linux/cpuidle.h>
 #include <linux/cpufreq.h>
 #include <linux/cpu.h>
+#include <linux/console.h>
 
Quoted 8 lines

arch/arm/xen/enlighten.c static int __init xen_guest_init(void) · line 327

Quoted 8 lines
arch/arm/xen/enlighten.c +2 -0
 #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);

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

Quoted 7 lines
Quoted 7 lines
arch/arm/xen/enlighten.c +1 -0
+
 	return 0;
 }
 early_initcall(xen_guest_init);
Signature · 1 line
1.8.3.2
#3 lore raw

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

Quoted 40 lines · Ian Campbell
Quoted 39 lines · Stefano Stabellini
Quoted 7 lines · Ard Biesheuvel

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.

Quoted 7 lines

---

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.

This patch looks good but there isn't much point in queuing this up without the prerequisite.

Julien, what patch exactly is that? What is the status of it?

Quoted 17 lines
 arch/arm/xen/enlighten.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index c7ca936ebd99..61382cafa877 100644
@@ -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)
 
Quoted 8 lines
Quoted 4 lines

arch/arm/xen/enlighten.c static int __init xen_guest_init(void) · line 327

Quoted 4 lines
arch/arm/xen/enlighten.c +2 -0
    register_cpu_notifier(&xen_cpu_notifier);
 
+   if (!console_set_on_cmdline)
+           add_preferred_console("hvc", 0, NULL);

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

Signature · 1 line
Ard.
#4 lore raw

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

Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

Ian.

#5 lore raw

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

Quoted 17 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 5 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

Quoted 8 lines
Quoted 2 lines

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

#6 lore raw

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

Quoted 23 lines · Stefano Stabellini
Quoted 22 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Quoted 8 lines
Quoted 3 lines

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

I got it the other way around, but the question remains: why the difference between dom0 and domUs? I guess that on x86 might make sense because dom0 has access to vga there.

It is also interesting to note that the actual code is:

if (!xen_initial_domain()) {
		add_preferred_console("xenboot", 0, NULL);
		add_preferred_console("tty", 0, NULL);
		add_preferred_console("hvc", 0, NULL);

that I am guessing it would prioritize a possible graphical console if present, like fbcon on pvfb.

#7 lore raw
In reply to Stefano Stabellini
Quoted 23 lines · Stefano Stabellini
Quoted 22 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Quoted 8 lines
Quoted 3 lines

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

I got it the other way around, but the question remains: why the difference between dom0 and domUs? I guess that on x86 might make sense because dom0 has access to vga there.

It is also interesting to note that the actual code is:

if (!xen_initial_domain()) {
		add_preferred_console("xenboot", 0, NULL);
		add_preferred_console("tty", 0, NULL);
		add_preferred_console("hvc", 0, NULL);

that I am guessing it would prioritize a possible graphical console if present, like fbcon on pvfb.

#8 lore raw

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

In reply to Stefano Stabellini
Quoted 23 lines · Stefano Stabellini
Quoted 22 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Quoted 8 lines
Quoted 3 lines

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

Other way around I think, dom0 has the correct stuff from grub.cfg whereas the guest may not.

#9 lore raw

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

Quoted 28 lines · Ian Campbell
Quoted 27 lines · Stefano Stabellini
Quoted 25 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

Quoted 7 lines
Quoted 4 lines

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

Other way around I think, dom0 has the correct stuff from grub.cfg whereas the guest may not.

Yes, currently for ARM guest you have to add 'extra="console=hvc0"' in the configuration file.

Regards,

Signature · 1 line
Julien Grall
#10 lore raw

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

Quoted 37 lines · Julien Grall
Quoted 36 lines · Ian Campbell
Quoted 34 lines · Stefano Stabellini
Quoted 20 lines · Ian Campbell
Quoted 7 lines · Ard Biesheuvel
Quoted 4 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need
to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 6 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal
that a VT is normally available there. I suppose that doesn't apply to
ARM so much, although it could.

Quoted 8 lines
Quoted 2 lines

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

Quoted 5 lines
Quoted 2 lines

Other way around I think, dom0 has the correct stuff from grub.cfg whereas the guest may not.

Yes, currently for ARM guest you have to add 'extra="console=hvc0"' in the configuration file.

I see. If this is the concern that we are trying to address, then yes, doing the same that we are already doing on x86 might be best.

#11 lore raw
In reply to Julien Grall
Quoted 37 lines · Julien Grall
Quoted 36 lines · Ian Campbell
Quoted 34 lines · Stefano Stabellini
Quoted 20 lines · Ian Campbell
Quoted 7 lines · Ard Biesheuvel
Quoted 4 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need
to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 6 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal
that a VT is normally available there. I suppose that doesn't apply to
ARM so much, although it could.

Quoted 8 lines
Quoted 2 lines

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

Quoted 5 lines
Quoted 2 lines

Other way around I think, dom0 has the correct stuff from grub.cfg whereas the guest may not.

Yes, currently for ARM guest you have to add 'extra="console=hvc0"' in the configuration file.

I see. If this is the concern that we are trying to address, then yes, doing the same that we are already doing on x86 might be best.

#12 lore raw
In reply to Ian Campbell
Quoted 28 lines · Ian Campbell
Quoted 27 lines · Stefano Stabellini
Quoted 25 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

Quoted 7 lines
Quoted 4 lines

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

Other way around I think, dom0 has the correct stuff from grub.cfg whereas the guest may not.

Yes, currently for ARM guest you have to add 'extra="console=hvc0"' in the configuration file.

Regards,

Signature · 1 line
Julien Grall
#13 lore raw
In reply to Stefano Stabellini
Quoted 23 lines · Stefano Stabellini
Quoted 22 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Quoted 8 lines
Quoted 3 lines

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

Other way around I think, dom0 has the correct stuff from grub.cfg whereas the guest may not.

#14 lore raw
In reply to Ian Campbell
Quoted 17 lines · Ian Campbell
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 5 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

Quoted 8 lines
Quoted 2 lines

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

The reasoning is that dom0 command line arguments come from its old native grub stanza, therefore the console parameter is incorrect, right? As opposed to regular domUs, that being freshly installed, are supposed to have the correct console parameter?

#15 lore raw
In reply to Ard Biesheuvel
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

I didn't check the code, but it seems inappropriate to add a preferred console implicitly if the user has set 'console=' on the command line.

I had been thinking that add_preferred_console would DTRT, but it seems not. Seems strange that most calls to it do not check if the console is already set, but it does seem like the right thing in this case.

Quoted 7 lines
Quoted 4 lines

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

OK, I got confused by the xen_guest_init(). So do you mean if if (!xen_initial_domain) should be added?

(dom0 is "Just A Guest" too ;-))

Adding it would be consistent with x86, I'm not precisely sure if that is important or desirable in this case. I'd be inclined to start with the if there.

Ian.

#16 lore raw
In reply to Stefano Stabellini
Quoted 35 lines · Stefano Stabellini
Quoted 7 lines · Ard Biesheuvel

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.

Quoted 7 lines

---

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.

This patch looks good but there isn't much point in queuing this up without the prerequisite.

Julien, what patch exactly is that? What is the status of it?

Quoted 13 lines
 arch/arm/xen/enlighten.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index c7ca936ebd99..61382cafa877 100644
@@ -24,6 +24,7 @@
 #include <linux/cpuidle.h>
 #include <linux/cpufreq.h>
 #include <linux/cpu.h>
+#include <linux/console.h>
 
Quoted 8 lines

arch/arm/xen/enlighten.c static int __init xen_guest_init(void) · line 327

Quoted 8 lines
arch/arm/xen/enlighten.c +2 -0
 #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);

FWIW on x86 this doesn't depend on console_set_on_cmdline, does it need to here?

On x86 it does depend on !xen_initial_domain. I suppose on the principal that a VT is normally available there. I suppose that doesn't apply to ARM so much, although it could.

Quoted 7 lines
Quoted 7 lines
arch/arm/xen/enlighten.c +1 -0
+
 	return 0;
 }
 early_initcall(xen_guest_init);
Signature · 1 line
1.8.3.2
#17 lore raw

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

In reply to Stefano Stabellini

Hi Stefano,

Quoted 16 lines · Stefano Stabellini
Quoted 7 lines · Ard Biesheuvel

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.

Quoted 7 lines

---

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.

Quoted 4 lines

This patch looks good but there isn't much point in queuing this up without the prerequisite.

Julien, what patch exactly is that? What is the status of it?

Calling xen_guest_init from setup_arch. It's based on a patch you sent an year ago (http://osdir.com/ml/linux-kernel/2013-08/msg00675.html)

But I had some issue with the console. The splitting of xen_guest_init doesn't work. It seems that we decode the IRQ too early.

I haven't had time to rework it and sent it.

Regards,

Signature · 1 line
Julien Grall
#18 lore raw
In reply to Stefano Stabellini

Hi Stefano,

Quoted 16 lines · Stefano Stabellini
Quoted 7 lines · Ard Biesheuvel

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.

Quoted 7 lines

---

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.

Quoted 4 lines

This patch looks good but there isn't much point in queuing this up without the prerequisite.

Julien, what patch exactly is that? What is the status of it?

Calling xen_guest_init from setup_arch. It's based on a patch you sent an year ago (http://osdir.com/ml/linux-kernel/2013-08/msg00675.html)

But I had some issue with the console. The splitting of xen_guest_init doesn't work. It seems that we decode the IRQ too early.

I haven't had time to rework it and sent it.

Regards,

Signature · 1 line
Julien Grall
#19 lore raw
In reply to Ard Biesheuvel
Quoted 7 lines · Ard Biesheuvel

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.

Quoted 7 lines

---

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.

This patch looks good but there isn't much point in queuing this up without the prerequisite.

Julien, what patch exactly is that? What is the status of it?

Quoted 28 lines
 arch/arm/xen/enlighten.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +4 -0
index c7ca936ebd99..61382cafa877 100644
@@ -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);
Signature · 1 line
1.8.3.2