[PATCH] xen/hvc: Print out to the serial console and pv consoleirregardless if it is dom0, PV or HVM.

From: Konrad Rzeszutek Wilk
Date: Fri Aug 16 2013 - 15:32:07 EST


*TODO*: BLA BLA BLA

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

diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 682210d..e47c6ae 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -40,6 +40,7 @@
#include <xen/hvc-console.h>
#include <xen/xenbus.h>

+#include <asm/xen/hypervisor.h>
#include "hvc_console.h"

#define HVC_COOKIE 0x58656e /* "Xen" in hex */
@@ -641,7 +642,19 @@ 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()) {
+ rc = dom0_write_console(0, str, len);
+ if (rc != len && xen_hvm_domain()) /* -ENOSYS */
+ 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

> Ian.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/