john.levon@sun.com
2007-Sep-23 23:01 UTC
[Xen-devel] [PATCH] Default serial console to BAUD_AUTO
# HG changeset patch # User john.levon@sun.com # 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. Signed-off-by: John Levon <john.levon@sun.com> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -303,6 +303,7 @@ void __init __start_xen(multiboot_info_t paddr_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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Sep-24 06:47 UTC
Re: [Xen-devel] [PATCH] Default serial console to BAUD_AUTO
On 24/9/07 00:01, "john.levon@sun.com" <john.levon@sun.com> wrote:> 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.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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2007-Sep-24 07:33 UTC
Re: [Xen-devel] [PATCH] Default serial console to BAUD_AUTO
On Mon, Sep 24, 2007 at 07:47:02AM +0100, Keir Fraser wrote:> > 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. > > 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Sep-24 07:43 UTC
Re: [Xen-devel] [PATCH] Default serial console to BAUD_AUTO
On 24/9/07 08:33, "John Levon" <john.levon@sun.com> wrote:>> 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2007-Sep-24 17:58 UTC
Re: [Xen-devel] [PATCH] Default serial console to BAUD_AUTO
On Mon, Sep 24, 2007 at 08:43:30AM +0100, Keir Fraser wrote:> >> 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.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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Sep-24 18:12 UTC
Re: [Xen-devel] [PATCH] Default serial console to BAUD_AUTO
On 24/9/07 18:58, "John Levon" <john.levon@sun.com> wrote:> 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=com1The behaviour was exactly the same in 3.0.4. In fact the current behaviour has existed forever, pretty much.> 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2007-Sep-24 19:40 UTC
Re: [Xen-devel] [PATCH] Default serial console to BAUD_AUTO
On Mon, Sep 24, 2007 at 07:12:10PM +0100, Keir Fraser wrote:> > 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.> 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 patchClearly 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?> 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Sep-24 20:22 UTC
Re: [Xen-devel] [PATCH] Default serial console to BAUD_AUTO
On 24/9/07 20:40, "John Levon" <john.levon@sun.com> wrote:>> 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.I can cook up something appropriate I think. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Seemingly Similar Threads
- [PATCH RFC 0/8] xen/arm: initial cubieboard2 support.
- [PATCH] properly __initdata-annotate command line option string buffers
- [PATCH v3 0/7] support for cubieboard2 / sunxi processors
- [PATCH DOCDAY] docs: wrap misc/xen-command-line.markdown to 80 columns
- com port acccess again