From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760583AbcBYMLe (ORCPT ); Thu, 25 Feb 2016 07:11:34 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:53426 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759935AbcBYMLd (ORCPT ); Thu, 25 Feb 2016 07:11:33 -0500 X-IronPort-AV: E=Sophos;i="5.22,498,1449532800"; d="scan'208";a="341041045" From: Stefano Stabellini To: CC: , , , , , Stefano Stabellini Subject: [PATCH v2 1/3] hvc_xen: add earlycon support Date: Thu, 25 Feb 2016 12:10:37 +0000 Message-ID: <1456402239-4179-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include +#include #include #include @@ -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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: [PATCH v2 1/3] hvc_xen: add earlycon support Date: Thu, 25 Feb 2016 12:10:37 +0000 Message-ID: <1456402239-4179-1-git-send-email-stefano.stabellini@eu.citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: xen-devel@lists.xensource.com Cc: linux-kernel@vger.kernel.org, Stefano.Stabellini@eu.citrix.com, david.vrabel@citrix.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 --- 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 #include #include +#include #include #include @@ -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