linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH] xen/hvc: If we use xen_raw_printk let it also work on HVM guests.
Date: Fri,  9 Aug 2013 10:55:33 -0400	[thread overview]
Message-ID: <1376060133-6382-1-git-send-email-konrad.wilk@oracle.com> (raw)

The xen_raw_printk works great for debugging purposes and for
it print anything the Xen hypervisor has to be built with 'debug=y'.

As such there is no difference between a PV or an PVHVM guest
using the hypercall, so lets use it.

Lastly if the hyper-page is not setup yet (for example during
early HVM boot), then use the 0xe9 port if it has detected
that it is running under an Xen hypervisor.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/tty/hvc/hvc_xen.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 682210d..69454a0 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -641,7 +641,17 @@ struct console xenboot_console = {
 
 void xen_raw_console_write(const char *str)
 {
-	dom0_write_console(0, str, strlen(str));
+	if (!xen_domain())
+		return;
+
+	if (xen_pv_domain())
+		dom0_write_console(0, str, strlen(str));
+	else if (xen_hvm_domain() || xen_cpuid_base()) {
+		/* The hyperpage has not been setup yet. */
+		int i, len = strlen(str);
+		for (i = 0; i < len; i++)
+			 outb(str[i], 0xe9);
+	}
 }
 
 void xen_raw_printk(const char *fmt, ...)
-- 
1.7.7.6


             reply	other threads:[~2013-08-09 14:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 14:55 Konrad Rzeszutek Wilk [this message]
2013-08-13 20:31 ` [Xen-devel] [PATCH] xen/hvc: If we use xen_raw_printk let it also work on HVM guests Ian Campbell
2013-08-13 20:53   ` Konrad Rzeszutek Wilk
2013-08-13 20:59     ` Ian Campbell
2013-08-13 22:20       ` Ian Campbell
2013-08-14  0:10         ` Konrad Rzeszutek Wilk
2013-08-14  7:15           ` Ian Campbell
2013-08-14 12:46             ` Konrad Rzeszutek Wilk
2013-08-15 14:40               ` Ian Campbell
2013-08-20 19:35                 ` Konrad Rzeszutek Wilk
2013-08-21  9:15                   ` Ian Campbell
2013-08-21 10:44                     ` Konrad Rzeszutek Wilk
2013-08-22  7:15                       ` Ian Campbell

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=1376060133-6382-1-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).