linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/hvc-console: Make it work with HVM guests.
@ 2013-09-27 21:25 Konrad Rzeszutek Wilk
  2013-09-27 21:49 ` [Xen-devel] " Julien Grall
  0 siblings, 1 reply; 12+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-09-27 21:25 UTC (permalink / raw)
  To: ian.campbell, linux-kernel, xen-devel; +Cc: Konrad Rzeszutek Wilk

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

diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index e61c36c..513a79b 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -183,7 +183,7 @@ static int dom0_write_console(uint32_t vtermno, const char *str, int len)
 {
 	int rc = HYPERVISOR_console_io(CONSOLEIO_write, len, (char *)str);
 	if (rc < 0)
-		return 0;
+		return rc;
 
 	return len;
 }
@@ -641,7 +641,20 @@ struct console xenboot_console = {
 
 void xen_raw_console_write(const char *str)
 {
-	dom0_write_console(0, str, strlen(str));
+	ssize_t len = strlen(str);
+	int rc = 0;
+
+	if (xen_domain()) {
+		dom0_write_console(0, str, len);
+		if (rc == -ENOSYS && xen_hvm_domain())
+			goto outb_print;
+
+	} else if (xen_cpuid_base()) {
+		int i;
+outb_print:
+		for (i = 0; i < len; i++)
+			outb(str[i], 0xe9);
+	}
 }
 
 void xen_raw_printk(const char *fmt, ...)
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-10-28 15:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 21:25 [PATCH] xen/hvc-console: Make it work with HVM guests Konrad Rzeszutek Wilk
2013-09-27 21:49 ` [Xen-devel] " Julien Grall
2013-09-30 14:45   ` Konrad Rzeszutek Wilk
2013-10-06 20:52     ` Julien Grall
2013-10-23 16:15       ` Konrad Rzeszutek Wilk
2013-10-23 22:08         ` Julien Grall
2013-10-24 14:49           ` Konrad Rzeszutek Wilk
2013-10-24 16:30             ` Julien Grall
2013-10-24 16:43               ` Ian Campbell
2013-10-25 19:38                 ` Konrad Rzeszutek Wilk
2013-10-26  8:27                   ` Ian Campbell
2013-10-28 15:48                     ` Konrad Rzeszutek Wilk

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).