ia64/xen-unstable

changeset 10500:06b10ad218f4

[XEN] Add a warning banner when 'sync_console' is used. Make it
very obvious and mildly annoying.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Jun 20 18:19:07 2006 +0100 (2006-06-20)
parents 69f7e0ea2985
children 967d4c65659a
files xen/common/kernel.c xen/drivers/char/console.c xen/include/xen/lib.h
line diff
     1.1 --- a/xen/common/kernel.c	Tue Jun 20 17:04:13 2006 +0100
     1.2 +++ b/xen/common/kernel.c	Tue Jun 20 18:19:07 2006 +0100
     1.3 @@ -96,10 +96,11 @@ char *print_tainted(char *str)
     1.4  {
     1.5      if ( tainted )
     1.6      {
     1.7 -        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c",
     1.8 +        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c",
     1.9                   tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
    1.10                   tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
    1.11 -                 tainted & TAINT_BAD_PAGE ? 'B' : ' ');
    1.12 +                 tainted & TAINT_BAD_PAGE ? 'B' : ' ',
    1.13 +                 tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ');
    1.14      }
    1.15      else
    1.16      {
     2.1 --- a/xen/drivers/char/console.c	Tue Jun 20 17:04:13 2006 +0100
     2.2 +++ b/xen/drivers/char/console.c	Tue Jun 20 18:19:07 2006 +0100
     2.3 @@ -497,12 +497,36 @@ void init_console(void)
     2.4      if ( opt_sync_console )
     2.5      {
     2.6          serial_start_sync(sercon_handle);
     2.7 +        add_taint(TAINT_SYNC_CONSOLE);
     2.8          printk("Console output is synchronous.\n");
     2.9      }
    2.10  }
    2.11  
    2.12  void console_endboot(int disable_vga)
    2.13  {
    2.14 +    int i;
    2.15 +
    2.16 +    if ( opt_sync_console )
    2.17 +    {
    2.18 +        printk("**********************************************\n");
    2.19 +        printk("******* WARNING: CONSOLE OUTPUT IS SYCHRONOUS\n");
    2.20 +        printk("******* This option is intended to aid debugging "
    2.21 +               "of Xen by ensuring\n");
    2.22 +        printk("******* that all output is synchronously delivered "
    2.23 +               "on the serial line.\n");
    2.24 +        printk("******* However it can introduce SIGNIFICANT latencies "
    2.25 +               "and affect\n");
    2.26 +        printk("******* timekeeping. It is NOT recommended for "
    2.27 +               "production use!\n");
    2.28 +        printk("**********************************************\n");
    2.29 +        for ( i = 0; i < 3; i++ )
    2.30 +        {
    2.31 +            printk("%d... ", 3-i);
    2.32 +            mdelay(1000);
    2.33 +        }
    2.34 +        printk("\n");
    2.35 +    }
    2.36 +
    2.37      if ( disable_vga )
    2.38          vgacon_enabled = 0;
    2.39  
     3.1 --- a/xen/include/xen/lib.h	Tue Jun 20 17:04:13 2006 +0100
     3.2 +++ b/xen/include/xen/lib.h	Tue Jun 20 18:19:07 2006 +0100
     3.3 @@ -82,6 +82,7 @@ unsigned long long parse_size_and_unit(c
     3.4  #define TAINT_UNSAFE_SMP                (1<<0)
     3.5  #define TAINT_MACHINE_CHECK             (1<<1)
     3.6  #define TAINT_BAD_PAGE                  (1<<2)
     3.7 +#define TAINT_SYNC_CONSOLE              (1<<3)
     3.8  extern int tainted;
     3.9  #define TAINT_STRING_MAX_LEN            20
    3.10  extern char *print_tainted(char *str);