plain text document attachment (lguest64-hvc.patch)
This is a start to try to get HVC working for x86_64.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Glauber de Oliveira Costa <glommer@gmail.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Index: work-pv/drivers/char/Kconfig
==================================================================---
work-pv.orig/drivers/char/Kconfig
+++ work-pv/drivers/char/Kconfig
@@ -595,6 +595,12 @@ config HVC_CONSOLE
 	  pSeries machines when partitioned support a hypervisor virtual
 	  console. This driver allows each pSeries partition to have a console
 	  which is accessed via the HMC.
+config HVC_LGUEST
+	bool "lguest hypervisor console"
+	depends on LGUEST_GUEST
+	select HVC_DRIVER
+	help
+	  Totally fubar
 
 config HVC_ISERIES
 	bool "iSeries Hypervisor Virtual Console support"
Index: work-pv/drivers/char/Makefile
==================================================================---
work-pv.orig/drivers/char/Makefile
+++ work-pv/drivers/char/Makefile
@@ -43,7 +43,7 @@ obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += am
 obj-$(CONFIG_SX)		+= sx.o generic_serial.o
 obj-$(CONFIG_RIO)		+= rio/ generic_serial.o
 obj-$(CONFIG_HVC_CONSOLE)	+= hvc_vio.o hvsi.o
-obj-$(CONFIG_LGUEST_GUEST)	+= hvc_lguest.o
+obj-$(CONFIG_HVC_GUEST)		+= hvc_lguest.o
 obj-$(CONFIG_HVC_ISERIES)	+= hvc_iseries.o
 obj-$(CONFIG_HVC_RTAS)		+= hvc_rtas.o
 obj-$(CONFIG_HVC_DRIVER)	+= hvc_console.o
Index: work-pv/drivers/char/hvc_lguest.c
==================================================================---
work-pv.orig/drivers/char/hvc_lguest.c
+++ work-pv/drivers/char/hvc_lguest.c
@@ -25,7 +25,6 @@ static int cons_irq;
 static int cons_offset;
 static char inbuf[256];
 static struct lguest_dma cons_input = { .used_len = 0,
-					.addr[0] = __pa(inbuf),
 					.len[0] = sizeof(inbuf),
 					.len[1] = 0 };
 
@@ -66,6 +65,12 @@ struct hv_ops lguest_cons = {
 
 static int __init cons_init(void)
 {
+	/*
+	 * Can't initialize this in the const declarations,
+	 * since __pa(inbuf) does not evaluate into a constant.
+	 */
+	cons_input.addr[0] = __pa(inbuf);
+
 	if (strcmp(paravirt_ops.name, "lguest") != 0)
 		return 0;
 
--