Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343140

[PATCH v2 1/3] hvc_xen: add earlycon support

From Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/3] hvc_xen: add earlycon support
Date 2016-02-25 13:20 +0100
Message-ID <r633H-3FK-11@gated-at.bofh.it> (permalink)
References <r62U2-3BH-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Introduce EARLYCON support in hvc_xen, useful for early debugging on arm
and arm64, where xen early_printk is not available.

It is different from xenboot_write_console on x86 in two ways:

- it does not return if !xen_pv_domain(), not only because ARM guests
  are xen_hvm_domain(), but also because we want to capture all the
  early boot messages, before xen support is discovered
- it does not try to print to the domU console at all, because xen
  support will only be discovered at a later point

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---

Changes in v2:
- do not try to print to the DomU console
---
 drivers/tty/hvc/hvc_xen.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index fa816b7..68b8ec8 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -25,6 +25,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/serial_core.h>
 
 #include <asm/io.h>
 #include <asm/xen/hypervisor.h>
@@ -664,3 +665,18 @@ void xen_raw_printk(const char *fmt, ...)
 
 	xen_raw_console_write(buf);
 }
+
+static void xenboot_earlycon_write(struct console *console,
+				  const char *string,
+				  unsigned len)
+{
+	dom0_write_console(0, string, len);
+}
+
+static int __init xenboot_earlycon_setup(struct earlycon_device *device,
+					    const char *opt)
+{
+	device->con->write = xenboot_earlycon_write;
+	return 0;
+}
+EARLYCON_DECLARE(xenboot, xenboot_earlycon_setup);
-- 
1.7.10.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] hvc_xen: fix xenboot on x86 and export to ARM Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-25 13:10 +0100
  [PATCH v2 3/3] hvc_xen: make early_printk work with HVM guests Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-25 13:20 +0100
    Re: [PATCH v2 3/3] hvc_xen: make early_printk work with HVM guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-25 16:20 +0100
  [PATCH v2 2/3] hvc_xen: fix xenboot for DomUs Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-25 13:20 +0100
    Re: [PATCH v2 2/3] hvc_xen: fix xenboot for DomUs Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-25 16:10 +0100
      Re: [PATCH v2 2/3] hvc_xen: fix xenboot for DomUs Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-26 16:50 +0100
        Re: [PATCH v2 2/3] hvc_xen: fix xenboot for DomUs Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-26 17:10 +0100
          Re: [PATCH v2 2/3] hvc_xen: fix xenboot for DomUs Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-26 18:00 +0100
  [PATCH v2 1/3] hvc_xen: add earlycon support Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-25 13:20 +0100
    Re: [PATCH v2 1/3] hvc_xen: add earlycon support Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-25 16:10 +0100
  Re: [PATCH v2 0/3] hvc_xen: fix xenboot on x86 and export to ARM Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-26 15:30 +0100
    Re: [PATCH v2 0/3] hvc_xen: fix xenboot on x86 and export to ARM David Vrabel <david.vrabel@citrix.com> - 2016-02-26 15:50 +0100

csiph-web