From: kaf24@firebug.cl.cam.ac.uk Date: Tue, 20 Jun 2006 17:19:07 +0000 (+0100) Subject: [XEN] Add a warning banner when 'sync_console' is used. Make it X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15921^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0cd98ba4649d422e872fdb95bbd04ece821ea067;p=xen.git [XEN] Add a warning banner when 'sync_console' is used. Make it very obvious and mildly annoying. Signed-off-by: Keir Fraser --- diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 8930c53d5c..41505c54d0 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -96,10 +96,11 @@ char *print_tainted(char *str) { if ( tainted ) { - snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c", + snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c", tainted & TAINT_UNSAFE_SMP ? 'S' : ' ', tainted & TAINT_MACHINE_CHECK ? 'M' : ' ', - tainted & TAINT_BAD_PAGE ? 'B' : ' '); + tainted & TAINT_BAD_PAGE ? 'B' : ' ', + tainted & TAINT_SYNC_CONSOLE ? 'C' : ' '); } else { diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 9e474d94cf..f0fe3e4eb9 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -497,12 +497,36 @@ void init_console(void) if ( opt_sync_console ) { serial_start_sync(sercon_handle); + add_taint(TAINT_SYNC_CONSOLE); printk("Console output is synchronous.\n"); } } void console_endboot(int disable_vga) { + int i; + + if ( opt_sync_console ) + { + printk("**********************************************\n"); + printk("******* WARNING: CONSOLE OUTPUT IS SYCHRONOUS\n"); + printk("******* This option is intended to aid debugging " + "of Xen by ensuring\n"); + printk("******* that all output is synchronously delivered " + "on the serial line.\n"); + printk("******* However it can introduce SIGNIFICANT latencies " + "and affect\n"); + printk("******* timekeeping. It is NOT recommended for " + "production use!\n"); + printk("**********************************************\n"); + for ( i = 0; i < 3; i++ ) + { + printk("%d... ", 3-i); + mdelay(1000); + } + printk("\n"); + } + if ( disable_vga ) vgacon_enabled = 0; diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index 124d49ade5..6cfe0dc217 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -82,6 +82,7 @@ unsigned long long parse_size_and_unit(char *s); #define TAINT_UNSAFE_SMP (1<<0) #define TAINT_MACHINE_CHECK (1<<1) #define TAINT_BAD_PAGE (1<<2) +#define TAINT_SYNC_CONSOLE (1<<3) extern int tainted; #define TAINT_STRING_MAX_LEN 20 extern char *print_tainted(char *str);