Skip to contentSkip to conversation

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

PATCH Superseded Ard Biesheuvel 2 participants 10 messages Feb 12, 2015 – Feb 16, 2015

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

PATCH v2 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.

---
 arch/arm/xen/enlighten.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +4 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
@@ -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);
 }
 
 static int __init xen_guest_init(void)
Signature · 1 line
1.8.3.2
#1 lore raw

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

Hi Ard,

Quoted 25 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.

---
  arch/arm/xen/enlighten.c | 4 ++++
  1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 261

Quoted 6 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 264

Quoted 4 lines
arch/arm/xen/enlighten.c +0 -0
  }
 
  static int __init xen_guest_init(void)

Regards,

Signature · 1 line
Julien Grall
#2 lore raw

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

Quoted 29 lines · Julien Grall

Hi Ard,

Quoted 25 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.

---
  arch/arm/xen/enlighten.c | 4 ++++
  1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 11 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 261

Quoted 7 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Did you try it?

Quoted 6 lines

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.

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Signature · 1 line
Ard.
Quoted 9 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 264

Quoted 4 lines
arch/arm/xen/enlighten.c +0 -0
  }
 
  static int __init xen_guest_init(void)

Regards,

--
Julien Grall

#3 lore raw

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

Quoted 42 lines · Ard Biesheuvel
Quoted 29 lines · Julien Grall

Hi Ard,

Quoted 25 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.

---
   arch/arm/xen/enlighten.c | 4 ++++
   1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 11 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 261

Quoted 7 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Quoted 1 line

Did you try it?

No just looked at the code.

Quoted 11 lines
Quoted 6 lines

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.

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Oh, right. Sorry for the noise.

So:

Regards,

Signature · 1 line
Julien Grall
#4 lore raw

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

Quoted 72 lines · Julien Grall
Quoted 48 lines · Ard Biesheuvel
Quoted 31 lines · Julien Grall

Hi Ard,

Quoted 26 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.

---
   arch/arm/xen/enlighten.c | 4 ++++
   1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 13 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 262

Quoted 8 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Quoted 1 line

Did you try it?

No just looked at the code.

Quoted 9 lines
Quoted 8 lines

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.

Quoted 5 lines

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Quoted 6 lines

Oh, right. Sorry for the noise.

So:

Would it make sense to roll this into your xen_early_init() series as #3?

#5 lore raw

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

Hi Ard,

Quoted 73 lines · Ard Biesheuvel
Quoted 72 lines · Julien Grall
Quoted 48 lines · Ard Biesheuvel
Quoted 31 lines · Julien Grall

Hi Ard,

Quoted 26 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.

---
   arch/arm/xen/enlighten.c | 4 ++++
   1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 13 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 262

Quoted 8 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Quoted 1 line

Did you try it?

No just looked at the code.

Quoted 14 lines
Quoted 8 lines

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.

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Quoted 8 lines
Quoted 6 lines

Oh, right. Sorry for the noise.

So:

Would it make sense to roll this into your xen_early_init() series as #3?

The xen_early_init has been created in order to support preferred console. I don't mind to carry this patch in the next version.

Regards,

Signature · 1 line
Julien Grall
#6 lore raw
In reply to Ard Biesheuvel

Hi Ard,

Quoted 73 lines · Ard Biesheuvel
Quoted 72 lines · Julien Grall
Quoted 48 lines · Ard Biesheuvel
Quoted 31 lines · Julien Grall

Hi Ard,

Quoted 26 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.

---
   arch/arm/xen/enlighten.c | 4 ++++
   1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 13 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 262

Quoted 8 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Quoted 1 line

Did you try it?

No just looked at the code.

Quoted 14 lines
Quoted 8 lines

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.

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Quoted 8 lines
Quoted 6 lines

Oh, right. Sorry for the noise.

So:

Would it make sense to roll this into your xen_early_init() series as #3?

The xen_early_init has been created in order to support preferred console. I don't mind to carry this patch in the next version.

Regards,

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

Hi Ard,

Quoted 26 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.

---
   arch/arm/xen/enlighten.c | 4 ++++
   1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 13 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 262

Quoted 8 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Quoted 1 line

Did you try it?

No just looked at the code.

Quoted 9 lines
Quoted 8 lines

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.

Quoted 5 lines

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Quoted 6 lines

Oh, right. Sorry for the noise.

So:

Would it make sense to roll this into your xen_early_init() series as #3?

Reviewed-by on v2 1/1
#8 lore raw
In reply to Ard Biesheuvel
Quoted 42 lines · Ard Biesheuvel
Quoted 29 lines · Julien Grall

Hi Ard,

Quoted 25 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.

---
   arch/arm/xen/enlighten.c | 4 ++++
   1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 11 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 261

Quoted 7 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Quoted 1 line

Did you try it?

No just looked at the code.

Quoted 11 lines
Quoted 6 lines

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.

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Oh, right. Sorry for the noise.

So:

Regards,

Signature · 1 line
Julien Grall
#9 lore raw
In reply to Julien Grall
Quoted 29 lines · Julien Grall

Hi Ard,

Quoted 25 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.

---
  arch/arm/xen/enlighten.c | 4 ++++
  1 file changed, 4 insertions(+)
arch/arm/xen/enlighten.c +1 -0
index 0abeefa7dbf8..927be1d1bad7 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>
 
Quoted 11 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 261

Quoted 7 lines
arch/arm/xen/enlighten.c +3 -0
@@ -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.

Did you try it?

Quoted 6 lines

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.

parse_early_param() is also called by setup_arch(), before xen_early_init()

The call to parse_early_param() in generic code is only there for architectures that don't call it in their setup_arch()

Signature · 1 line
Ard.
Quoted 9 lines

arch/arm/xen/enlighten.c void __init xen_early_init(void) · line 264

Quoted 4 lines
arch/arm/xen/enlighten.c +0 -0
  }
 
  static int __init xen_guest_init(void)

Regards,

--
Julien Grall