[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:19:07 +0000 (18:19 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 20 Jun 2006 17:19:07 +0000 (18:19 +0100)
very obvious and mildly annoying.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/kernel.c
xen/drivers/char/console.c
xen/include/xen/lib.h

index 8930c53d5c4b5d06dfad4f73fe374e293866b4dd..41505c54d008d20e606d447061143acc31d64182 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 9e474d94cfdadb63023cde0241c61b2d5f9dd0bb..f0fe3e4eb9a580eba5d5ecebfd2267baafd1b3aa 100644 (file)
@@ -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;
 
index 124d49ade5804ce8874ae2255b7f0b4916c6d541..6cfe0dc217847dffbab54872b2753e620d3dd7d9 100644 (file)
@@ -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);