]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
[XEN] Add a warning banner when 'sync_console' is used. Make it
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 20 Jun 2006 17:22:34 +0000 (18:22 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 20 Jun 2006 17:22:34 +0000 (18:22 +0100)
very obvious and mildly annoying.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset:   10468:06b10ad218f450732d9ed2e694b11f403edffd46
xen-unstable date:        Tue Jun 20 18:19:07 2006 +0100

xen/common/kernel.c
xen/drivers/char/console.c
xen/include/xen/lib.h

index 12d6eb8feb3b1940d98523ca1d0701045d330117..6ea2011bd1cbbe0f40209fbc850f51d9abddf208 100644 (file)
@@ -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
     {
index dc0685700732dedfb499fde511581766d8959afe..078a9c603971bd50dcdc0d748e2c88c4559428a4 100644 (file)
@@ -494,12 +494,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;
 
index 8b9253b020588be374e9f2c2bd1d1478aca9e890..7b18eee5a53ec4802a232edba1da2f5b345fe51a 100644 (file)
@@ -79,6 +79,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);