]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xen: initialise opt_xen_console early in PVH boot path
authorWei Liu <wei.liu2@citrix.com>
Fri, 28 Sep 2018 08:15:06 +0000 (09:15 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 1 Oct 2018 10:12:21 +0000 (11:12 +0100)
This helps capture issues before console is initialised.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/setup.c
xen/drivers/char/console.c
xen/include/xen/console.h

index ae6f4d95c15bd7632e14f76015d0fac9f38f9047..6a449024c2a6291336fa4f429542a62ed46d5aea 100644 (file)
@@ -710,6 +710,11 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( pvh_boot )
     {
+        /*
+         * Force xen console to be enabled. We will reset it later in console
+         * initialisation code.
+         */
+        opt_console_xen = -1;
         ASSERT(mbi_p == 0);
         mbi = pvh_init();
     }
index e48039dd82c5d885a4b1aa3e0868a461c3cb79a1..3b75f7a4723a70db99428989fe834d7155b06d9b 100644 (file)
@@ -91,7 +91,8 @@ static uint32_t conringc, conringp;
 static int __read_mostly sercon_handle = -1;
 
 #ifdef CONFIG_X86
-static bool __read_mostly opt_console_xen; /* console=xen */
+/* Tristate: 0 disabled, 1 user enabled, -1 default enabled */
+int8_t __read_mostly opt_console_xen; /* console=xen */
 #endif
 
 static DEFINE_SPINLOCK(console_lock);
@@ -832,7 +833,7 @@ void __init console_init_preirq(void)
             pv_console_init();
 #ifdef CONFIG_X86
         else if ( !strncmp(p, "xen", 3) )
-            opt_console_xen = true;
+            opt_console_xen = 1;
 #endif
         else if ( !strncmp(p, "none", 4) )
             continue;
@@ -852,6 +853,11 @@ void __init console_init_preirq(void)
         }
     }
 
+#ifdef CONFIG_X86
+    if ( opt_console_xen == -1 )
+        opt_console_xen = 0;
+#endif
+
     serial_set_rx_handler(sercon_handle, serial_rx);
     pv_console_set_rx_handler(serial_rx);
 
index ea06fd8078de6ab3dad1df9900ba894bca5035cf..70c9911a499fa75220b0b0c4e68597564dfff687 100644 (file)
@@ -43,4 +43,6 @@ void console_giveback(int id);
 int console_suspend(void);
 int console_resume(void);
 
+extern int8_t opt_console_xen;
+
 #endif /* __CONSOLE_H__ */