[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] xen: initialise opt_xen_console early in PVH boot path



commit 146bb7e1934afc5056179fffbf8e24c0db415f8c
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Fri Sep 28 09:15:06 2018 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Mon Oct 1 11:12:21 2018 +0100

    xen: initialise opt_xen_console early in PVH boot path
    
    This helps capture issues before console is initialised.
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/setup.c       |  5 +++++
 xen/drivers/char/console.c | 10 ++++++++--
 xen/include/xen/console.h  |  2 ++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index ae6f4d95c1..6a449024c2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -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();
     }
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index e48039dd82..3b75f7a472 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -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);
 
diff --git a/xen/include/xen/console.h b/xen/include/xen/console.h
index ea06fd8078..70c9911a49 100644
--- a/xen/include/xen/console.h
+++ b/xen/include/xen/console.h
@@ -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__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.