Default serial console to BAUD_AUTO
PATCH 1/1 Default serial console to BAUD_AUTO
# HG changeset patch
# User [email protected]
# Date 1190588448 25200
# Node ID 9a8a2d9ad94f20c995a7b59b75fdd6fefb8dafc6 # Parent 20c00448e39c7d8528e40287cafe614a5d4bdbf5 Default serial console to BAUD_AUTO
Currently, the defaults for the serial console have a baud rate of zero, which is less than useful. Default to BAUD_AUTO instead, so you can just specify "console=com1" and it will most likely work.
xen/arch/x86/setup.c +1 -0
@@ -303,6 +303,7 @@ void __init __start_xen(multiboot_info_tpaddr_t s, e;int i, e820_warn =0 , e820_raw_nr =0 , bytes =0 ;struct ns16550_defaults ns16550 = { + .baud =BAUD_AUTO , .data_bits =8 , .parity ='n' , .stop_bits =1
Quoted 5 lines · On 24/9/07 00:01, "[email protected]" <[email protected]> wrote:
Default serial console to
BAUD_AUTOCurrently, the defaults for the serial console have a baud rate of zero, which is less than useful. Default to
BAUD_AUTOinstead, so you can just specify "console=com1" and it will most likely work.
If we do this we should remove com1 from the default console= string. Otherwise we waste time on serial output for many users who have nothing connected (currently a com1= line has to be specified for serial output to be enabled on Xen/x86). console=vga is probably what most people expect by default?
-- Keir
Quoted 11 lines · Keir Fraser
Quoted 5 lines
Default serial console to
BAUD_AUTOCurrently, the defaults for the serial console have a baud rate of zero, which is less than useful. Default to
BAUD_AUTOinstead, so you can just specify "console=com1" and it will most likely work.If we do this we should remove com1 from the default console= string. Otherwise we waste time on serial output for many users who have nothing connected (currently a com1= line has to be specified for serial output to be enabled on Xen/x86). console=vga is probably what most people expect by default?
The default setting is "com1,vga". However, the last setting is always taken, and overrides all others, so this is exactly equal to "vga". This should probably be cleaned up, but I don't think my patch changes anything in this regard.
regards
john
Quoted 10 lines · John Levon
Quoted 5 lines
If we do this we should remove com1 from the default console= string. Otherwise we waste time on serial output for many users who have nothing connected (currently a com1= line has to be specified for serial output to be enabled on Xen/x86). console=vga is probably what most people expect by default?
The default setting is "com1,vga". However, the last setting is always taken, and overrides all others, so this is exactly equal to "vga". This should probably be cleaned up, but I don't think my patch changes anything in this regard.
I would agree, if your statement was true. Which it's not.
-- Keir
Quoted 6 lines · Keir Fraser
Quoted 6 lines
Quoted 5 lines
If we do this we should remove com1 from the default console= string. Otherwise we waste time on serial output for many users who have nothing connected (currently a com1= line has to be specified for serial output to be enabled on Xen/x86). console=vga is probably what most people expect by default?
Quoted 6 lines
Quoted 4 lines
The default setting is "com1,vga". However, the last setting is always taken, and overrides all others, so this is exactly equal to "vga". This should probably be cleaned up, but I don't think my patch changes anything in this regard.
I would agree, if your statement was true. Which it's not.
Indeed, this has changed in xen-unstable compared to 3.0.4, my apologies. So with my patch you'll automatically get serial console output in xen-unstable, regardless of console=com1
When you say "waste time", what exactly do you mean? Are you concerned about printk() performance? Isn't this only debug and early boot? It seems to me that getting such serial console output by default is pretty useful.
Otherwise, I'm fine with remove com1 from opt_console, as it matches current behaviour.
regards
john
Quoted 3 lines · John Levon
Indeed, this has changed in xen-unstable compared to 3.0.4, my apologies. So with my patch you'll automatically get serial console output in xen-unstable, regardless of console=com1
The behaviour was exactly the same in 3.0.4. In fact the current behaviour has existed forever, pretty much.
Quoted 7 lines
When you say "waste time", what exactly do you mean? Are you concerned about
printk()performance? Isn't this only debug and early boot? It seems to me that
getting such serial console output by default is pretty useful.Otherwise, I'm fine with remove com1 from
opt_console, as it matches current behaviour.
Actually another reason to not change the current behaviour is that it will also lock out dom0 from getting at COM1 and COM2. Because any serial ports that ns16550.c knows about get removed from dom0's io permissions.
I expect we could rework some stuff to get some slightly more sensible defaults to emerge (e.g., console=...com1... could imply that com1 should be grabbed by Xen with sensible defaults), but it's more work than your one-line patch and, really, you can just put 'com1=auto' on your command line to get the same effect and then noone gets surprised by Xen locking down serial ports when com1/com2 does not appear on their Xen command line. The current situation seems quite acceptable to me.
-- Keir
Quoted 6 lines · Keir Fraser
Quoted 3 lines
Indeed, this has changed in xen-unstable compared to 3.0.4, my apologies. So with my patch you'll automatically get serial console output in xen-unstable, regardless of console=com1
The behaviour was exactly the same in 3.0.4. In fact the current behaviour has existed forever, pretty much.
It appears I was being misled by the init_console() code.
Quoted 8 lines
Actually another reason to not change the current behaviour is that it will also lock out dom0 from getting at COM1 and COM2. Because any serial ports that
ns16550.cknows about get removed from dom0's io permissions.I expect we could rework some stuff to get some slightly more sensible defaults to emerge (e.g., console=...com1... could imply that com1 should be grabbed by Xen with sensible defaults), but it's more work than your one-line patch
Clearly I didn't look at this code closely enough, but when you say more work, you mean:
-#define OPT_CONSOLE_STR "com1,vga"
-#define OPT_CONSOLE_STR "vga"
right?
Quoted 3 lines
and, really, you can just put 'com1=auto' on your command
line to get the same effect and then noone gets surprised by Xen locking down serial ports when com1/com2 does not appear on their Xen command line.
Fair enough, we should not use the serial console by default (although at least Solaris will feed output through HYPERVISOR_console_io if Xen's already grabbed it). However, I don't think that the current *code* (whereby the serial console gets disabled as a side effect of not setting BAUD_AUTO, and OPT_CONSOLE_STR does not do what it appears to do) is readable or maintainable. Can we please make the intention of the code clear?
Neither do I think that forcing users to unnecessarily set "com1=auto" is good UI.
john
Quoted 14 lines · John Levon
Quoted 3 lines
and, really, you can just put 'com1=auto' on your command
line to get the same effect and then noone gets surprised by Xen locking down serial ports when com1/com2 does not appear on their Xen command line.Fair enough, we should not use the serial console by default (although at least
Solaris will feed output throughHYPERVISOR_console_ioif Xen's already grabbed
it). However, I don't think that the current *code* (whereby the serial console
gets disabled as a side effect of not settingBAUD_AUTO, andOPT_CONSOLE_STRdoes not do what it appears to do) is readable or maintainable. Can we please make the intention of the code clear?
Quoted 2 lines
Neither do I think that forcing users to unnecessarily set "com1=auto" is good UI.
I can cook up something appropriate I think.
-- Keir