All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 2/2] xen: initialise opt_xen_console early in PVH boot path
Date: Fri, 28 Sep 2018 18:06:32 +0100	[thread overview]
Message-ID: <20180928170632.1176-3-wei.liu2@citrix.com> (raw)
In-Reply-To: <20180928170632.1176-1-wei.liu2@citrix.com>

This helps capture issues before console is initialised.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 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 2fbf7d574c..20cb0acc3f 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -708,6 +708,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__ */
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-09-28 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28 17:06 [PATCH v2 0/2] Minor improvement to early boot code Wei Liu
2018-09-28 17:06 ` [PATCH v2 1/2] x86: make sure module array is large enough in pvh-boot.c Wei Liu
2018-09-28 17:12   ` Andrew Cooper
2018-09-28 17:06 ` Wei Liu [this message]
2018-09-28 17:14   ` [PATCH v2 2/2] xen: initialise opt_xen_console early in PVH boot path Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180928170632.1176-3-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.