rpms/kernel/FC-6 linux-2.6-xen-console.patch, NONE, 1.1 linux-2.6-xen-pvfb-fixes.patch, NONE, 1.1 kernel-2.6.spec, 1.2895, 1.2896 linux-2.6-xen-pvfb.patch, 1.5, 1.6

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Jan 15 16:31:23 UTC 2007


Author: armbru

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv704

Modified Files:
	kernel-2.6.spec linux-2.6-xen-pvfb.patch 
Added Files:
	linux-2.6-xen-console.patch linux-2.6-xen-pvfb-fixes.patch 
Log Message:
- Update Xen paravirt framebuffer patch to upstream xen-unstable
  changeset 13066, less changeset 12680, because that breaks with
  console=tty console=xvc.  Also change default domU console back to
  /dev/xcv0.  This changes the protocol to the one accepted upstream.
- Add compatibility with guests running our initial protocol.
- Update Xen console major/minor to lanana.org-assigned numbers.

linux-2.6-xen-console.patch:
 console.c |   70 ++++++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 44 insertions(+), 26 deletions(-)

--- NEW FILE linux-2.6-xen-console.patch ---
# HG changeset patch
# User kfraser at localhost.localdomain
# Date 1164800279 0
# Node ID 8832712b0b3740daf9c2d5993fcc1d640ff1564e
# Parent  15e80a946a6a7b8f865416e0c9c707d3ce413e3d
[LINUX] console: Add option to use /dev/xvc0, major=204, minor=191.

The major/minor has now been allocated to us by lanana.org.

This is based on previous patches from:
 Jeremy Katz <katzj at redhat.com>
 Amos Waterland <apw at us.ibm.com>

Signed-off-by: Keir Fraser <keir at xensource.com>

diff -r 15e80a946a6a -r 8832712b0b37 linux-2.6-xen-sparse/drivers/xen/console/console.c
--- linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed Nov 29 11:07:51 2006 +0000
+++ linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed Nov 29 11:37:59 2006 +0000
@@ -64,13 +64,20 @@
  *  'xencons=off'  [XC_OFF]:     Console is disabled.
  *  'xencons=tty'  [XC_TTY]:     Console attached to '/dev/tty[0-9]+'.
  *  'xencons=ttyS' [XC_SERIAL]:  Console attached to '/dev/ttyS[0-9]+'.
+ *  'xencons=xvc'  [XC_SERIAL]:  Console attached to '/dev/xvc0'.
  *                 [XC_DEFAULT]: DOM0 -> XC_SERIAL ; all others -> XC_TTY.
  * 
  * NB. In mode XC_TTY, we create dummy consoles for tty2-63. This suppresses
  * warnings from standard distro startup scripts.
  */
-static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode = XC_DEFAULT;
+static enum {
+	XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL, XC_XVC
+} xc_mode = XC_DEFAULT;
 static int xc_num = -1;
+
+/* /dev/xvc0 device number allocated by lanana.org. */
+#define XEN_XVC_MAJOR 204
+#define XEN_XVC_MINOR 191
 
 #ifdef CONFIG_MAGIC_SYSRQ
 static unsigned long sysrq_requested;
@@ -82,27 +89,23 @@ static int __init xencons_setup(char *st
 	char *q;
 	int n;
 
-	if (!strncmp(str, "ttyS", 4))
+	if (!strncmp(str, "ttyS", 4)) {
 		xc_mode = XC_SERIAL;
-	else if (!strncmp(str, "tty", 3))
+		str += 4;
+	} else if (!strncmp(str, "tty", 3)) {
 		xc_mode = XC_TTY;
-	else if (!strncmp(str, "off", 3))
+		str += 3;
+	} else if (!strncmp(str, "xvc", 3)) {
+		xc_mode = XC_XVC;
+		str += 3;
+	} else if (!strncmp(str, "off", 3)) {
 		xc_mode = XC_OFF;
-
-	switch (xc_mode) {
-	case XC_SERIAL:
-		n = simple_strtol(str+4, &q, 10);
-		if (q > (str + 4))
-			xc_num = n;
-		break;
-	case XC_TTY:
-		n = simple_strtol(str+3, &q, 10);
-		if (q > (str + 3))
-			xc_num = n;
-		break;
-	default:
-		break;
-	}
+		str += 3;
+	}
+
+	n = simple_strtol(str, &q, 10);
+	if (q != str)
+		xc_num = n;
 
 	return 1;
 }
@@ -201,6 +204,12 @@ static int __init xen_console_init(void)
 	}
 
 	switch (xc_mode) {
+	case XC_XVC:
+		strcpy(kcons_info.name, "xvc");
+		if (xc_num == -1)
+			xc_num = 0;
+		break;
+
 	case XC_SERIAL:
 		strcpy(kcons_info.name, "ttyS");
 		if (xc_num == -1)
@@ -305,7 +314,7 @@ void dom0_init_screen_info(const struct 
 /******************** User-space console driver (/dev/console) ************/
 
 #define DRV(_d)         (_d)
-#define DUMMY_TTY(_tty) ((xc_mode != XC_SERIAL) &&		\
+#define DUMMY_TTY(_tty) ((xc_mode == XC_TTY) &&		\
 			 ((_tty)->index != (xc_num - 1)))
 
 static struct termios *xencons_termios[MAX_NR_CONSOLES];
@@ -628,8 +637,8 @@ static int __init xencons_init(void)
 			return rc;
 	}
 
-	xencons_driver = alloc_tty_driver((xc_mode == XC_SERIAL) ?
-					  1 : MAX_NR_CONSOLES);
+	xencons_driver = alloc_tty_driver((xc_mode == XC_TTY) ?
+					  MAX_NR_CONSOLES : 1);
 	if (xencons_driver == NULL)
 		return -ENOMEM;
 
@@ -644,14 +653,23 @@ static int __init xencons_init(void)
 	DRV(xencons_driver)->termios         = xencons_termios;
 	DRV(xencons_driver)->termios_locked  = xencons_termios_locked;
 
-	if (xc_mode == XC_SERIAL) {
+	switch (xc_mode) {
+	case XC_XVC:
+		DRV(xencons_driver)->name        = "xvc";
+		DRV(xencons_driver)->major       = XEN_XVC_MAJOR;
+		DRV(xencons_driver)->minor_start = XEN_XVC_MINOR;
+		DRV(xencons_driver)->name_base   = xc_num;
+		break;
+	case XC_SERIAL:
 		DRV(xencons_driver)->name        = "ttyS";
 		DRV(xencons_driver)->minor_start = 64 + xc_num;
-		DRV(xencons_driver)->name_base   = 0 + xc_num;
-	} else {
+		DRV(xencons_driver)->name_base   = xc_num;
+		break;
+	default:
 		DRV(xencons_driver)->name        = "tty";
 		DRV(xencons_driver)->minor_start = 1;
 		DRV(xencons_driver)->name_base   = 1;
+		break;
 	}
 
 	tty_set_operations(xencons_driver, &xencons_ops);
# HG changeset patch
# User kfraser at localhost.localdomain
# Date 1164801889 0
# Node ID f32abd365ae006e4dfda7ec206a9955b3cd57da2
# Parent  4876e7ebca6eff15ea297d762400dd17d5d693b1
[LINUX] console: Fix comment.
Signed-off-by: Keir Fraser <keir at xensource.com>

diff -r 4876e7ebca6e -r f32abd365ae0 linux-2.6-xen-sparse/drivers/xen/console/console.c
--- linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed Nov 29 11:40:10 2006 +0000
+++ linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed Nov 29 12:04:49 2006 +0000
@@ -64,7 +64,7 @@
  *  'xencons=off'  [XC_OFF]:     Console is disabled.
  *  'xencons=tty'  [XC_TTY]:     Console attached to '/dev/tty[0-9]+'.
  *  'xencons=ttyS' [XC_SERIAL]:  Console attached to '/dev/ttyS[0-9]+'.
- *  'xencons=xvc'  [XC_SERIAL]:  Console attached to '/dev/xvc0'.
+ *  'xencons=xvc'  [XC_XVC]:     Console attached to '/dev/xvc0'.
  *                 [XC_DEFAULT]: DOM0 -> XC_SERIAL ; all others -> XC_TTY.
  * 
  * NB. In mode XC_TTY, we create dummy consoles for tty2-63. This suppresses

linux-2.6-xen-pvfb-fixes.patch:
 console/console.c |    2 +-
 fbfront/xenfb.c   |   34 +++++++++++++++++++---------------
 2 files changed, 20 insertions(+), 16 deletions(-)

--- NEW FILE linux-2.6-xen-pvfb-fixes.patch ---
diff -r 5c452351be21 -r d49bc30b6b27 linux-2.6-xen-sparse/drivers/xen/console/console.c
--- linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Aug 18 16:20:59 2006 -0400
+++ linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Aug 18 16:26:39 2006 -0400
@@ -194,7 +209,7 @@ static int __init xen_console_init(void)
 		if (!xen_start_info->console.domU.evtchn)
 			goto out;
 		if (xc_mode == XC_DEFAULT)
-			xc_mode = XC_TTY;
+			xc_mode = XC_XVC;
 		kcons_info.write = kcons_write;
 	}
 
diff -r 37141c3a3d39 linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c
--- linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c	Mon Dec 11 15:06:53 2006 +0000
+++ linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c	Thu Dec 14 16:45:39 2006 +0100
@@ -49,8 +49,9 @@ struct xenfb_info
 	struct timer_list	refresh;
 	int			dirty;
 	int			x1, y1, x2, y2;	/* dirty rectangle,
-						   protected by mm_lock */
-	spinlock_t		mm_lock;
+						   protected by dirty_lock */
+	spinlock_t		dirty_lock;
+	struct mutex		mm_lock;
 	int			nr_pages;
 	struct page		**pages;
 	struct list_head	mappings; /* protected by mm_lock */
@@ -114,14 +115,16 @@ static void xenfb_update_screen(struct x
 	if (xenfb_queue_full(info))
 		return;
 
-	spin_lock_irqsave(&info->mm_lock, flags);
+	mutex_lock(&info->mm_lock);
 
+	spin_lock_irqsave(&info->dirty_lock, flags);
 	y1 = info->y1;
 	y2 = info->y2;
 	x1 = info->x1;
 	x2 = info->x2;
 	info->x1 = info->y1 = INT_MAX;
 	info->x2 = info->y2 = 0;
+	spin_unlock_irqrestore(&info->dirty_lock, flags);
 
 	list_for_each_entry(map, &info->mappings, link) {
 		if (!map->faults)
@@ -131,7 +134,7 @@ static void xenfb_update_screen(struct x
 		map->faults = 0;
 	}
 
-	spin_unlock_irqrestore(&info->mm_lock, flags);
+	mutex_unlock(&info->mm_lock);
 
 	xenfb_do_update(info, x1, y1, x2 - x1, y2 - y1);
 }
@@ -216,9 +219,9 @@ static void xenfb_refresh(struct xenfb_i
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&info->mm_lock, flags);
+	spin_lock_irqsave(&info->dirty_lock, flags);
 	__xenfb_refresh(info, x1, y1, w, h);
-	spin_unlock_irqrestore(&info->mm_lock, flags);
+	spin_unlock_irqrestore(&info->dirty_lock, flags);
 }
 
 static void xenfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
@@ -255,14 +258,13 @@ static void xenfb_vm_close(struct vm_are
 {
 	struct xenfb_mapping *map = vma->vm_private_data;
 	struct xenfb_info *info = map->info;
-	unsigned long flags;
 
-	spin_lock_irqsave(&info->mm_lock, flags);
+	mutex_lock(&info->mm_lock);
 	if (atomic_dec_and_test(&map->map_refs)) {
 		list_del(&map->link);
 		kfree(map);
 	}
-	spin_unlock_irqrestore(&info->mm_lock, flags);
+	mutex_unlock(&info->mm_lock);
 }
 
 static struct page *xenfb_vm_nopage(struct vm_area_struct *vma,
@@ -278,7 +280,8 @@ static struct page *xenfb_vm_nopage(stru
 	if (pgnr >= info->nr_pages)
 		return NOPAGE_SIGBUS;
 
-	spin_lock_irqsave(&info->mm_lock, flags);
+	mutex_lock(&info->mm_lock);
+	spin_lock_irqsave(&info->dirty_lock, flags);
 	page = info->pages[pgnr];
 	get_page(page);
 	map->faults++;
@@ -288,7 +291,8 @@ static struct page *xenfb_vm_nopage(stru
 	if (y2 > info->fb_info->var.yres)
 		y2 = info->fb_info->var.yres;
 	__xenfb_refresh(info, 0, y1, info->fb_info->var.xres, y2 - y1);
-	spin_unlock_irqrestore(&info->mm_lock, flags);
+	spin_unlock_irqrestore(&info->dirty_lock, flags);
+	mutex_unlock(&info->mm_lock);
 
 	if (type)
 		*type = VM_FAULT_MINOR;
@@ -305,7 +309,6 @@ static struct vm_operations_struct xenfb
 static int xenfb_mmap(struct fb_info *fb_info, struct vm_area_struct *vma)
 {
 	struct xenfb_info *info = fb_info->par;
-	unsigned long flags;
 	struct xenfb_mapping *map;
 	int map_pages;
 
@@ -329,9 +332,9 @@ static int xenfb_mmap(struct fb_info *fb
 	map->info = info;
 	atomic_set(&map->map_refs, 1);
 
-	spin_lock_irqsave(&info->mm_lock, flags);
+	mutex_lock(&info->mm_lock);
 	list_add(&map->link, &info->mappings);
-	spin_unlock_irqrestore(&info->mm_lock, flags);
+	mutex_unlock(&info->mm_lock);
 
 	vma->vm_ops = &xenfb_vm_ops;
 	vma->vm_flags |= (VM_DONTEXPAND | VM_RESERVED);
@@ -388,7 +391,8 @@ static int __devinit xenfb_probe(struct 
 	info->xbdev = dev;
 	info->irq = -1;
 	info->x1 = info->y1 = INT_MAX;
-	spin_lock_init(&info->mm_lock);
+	spin_lock_init(&info->dirty_lock);
+	mutex_init(&info->mm_lock);
 	init_waitqueue_head(&info->wq);
 	init_timer(&info->refresh);
 	info->refresh.function = xenfb_timer;


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/kernel-2.6.spec,v
retrieving revision 1.2895
retrieving revision 1.2896
diff -u -r1.2895 -r1.2896
--- kernel-2.6.spec	10 Jan 2007 23:18:29 -0000	1.2895
+++ kernel-2.6.spec	15 Jan 2007 16:31:21 -0000	1.2896
@@ -370,7 +370,9 @@
 Patch954: linux-2.6-xen-execshield.patch
 Patch955: linux-2.6-xen-tux.patch
 Patch958: linux-2.6-ia64-kexec-kdump-xen-conflict.patch
-Patch990: linux-2.6-xen-pvfb.patch
+Patch990: linux-2.6-xen-console.patch
+Patch991: linux-2.6-xen-pvfb.patch
+Patch992: linux-2.6-xen-pvfb-fixes.patch
 
 #
 # Patches 1000 to 5000 are reserved for bugfixes to drivers and filesystems
@@ -901,6 +903,8 @@
 
 # xen framebuffer patches
 %patch990 -p1
+%patch991 -p1
+%patch992 -p1
 
 %endif
 
@@ -2019,6 +2023,13 @@
 %endif
 
 %changelog
+* Mon Jan 15 2007 Markus Armbruster <armbru at redhat.com>
+- Update Xen paravirt framebuffer patch to upstream xen-unstable
+  changeset 13066, less changeset 12680, because that breaks with
+  console=tty console=xvc.  Also change default domU console back to
+  /dev/xcv0.
+- Update Xen console major/minor to lanana.org-assigned numbers.
+
 * Wed Jan 10 2007 Dave Jones <davej at redhat.com>
 - 2.6.19.2
 

linux-2.6-xen-pvfb.patch:
 arch/i386/kernel/setup-xen.c     |    5 
 arch/ia64/kernel/setup.c         |    4 
 arch/x86_64/kernel/setup-xen.c   |    7 
 drivers/char/tty_io.c            |    6 
 drivers/xen/Kconfig              |   23 +
 drivers/xen/Makefile             |    2 
 drivers/xen/console/console.c    |   10 
 drivers/xen/fbfront/Makefile     |    2 
 drivers/xen/fbfront/xenfb.c      |  682 +++++++++++++++++++++++++++++++++++++++
 drivers/xen/fbfront/xenkbd.c     |  300 +++++++++++++++++
 include/xen/interface/io/fbif.h  |  116 ++++++
 include/xen/interface/io/kbdif.h |  108 ++++++
 12 files changed, 1253 insertions(+), 12 deletions(-)

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.5 -r 1.6 linux-2.6-xen-pvfb.patch
Index: linux-2.6-xen-pvfb.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/linux-2.6-xen-pvfb.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-xen-pvfb.patch	13 Oct 2006 19:01:06 -0000	1.5
+++ linux-2.6-xen-pvfb.patch	15 Jan 2007 16:31:21 -0000	1.6
@@ -1,22 +1,69 @@
-diff -r ec03b24a2d83 -r 6ca424e1867e linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
---- linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Tue Aug 15 19:53:55 2006 +0100
-+++ linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Fri Aug 18 16:17:58 2006 -0400
-@@ -1871,8 +1871,12 @@ void __init setup_arch(char **cmdline_p)
+Derived from:
+# HG changeset patch
+# User Steven Smith <ssmith at xensource.com>
+# Date 1164966512 0
+# Node ID 260426e3924f922719b392d1f2a7e9776dc7a15f
+# Parent  697b0203e68fd5b54944ba947c3e3b8d78fae88d
+This is Anthony Liguori's virtual framebuffer forward ported and
+extensively hacked based on feedback from xen-devel.
+
+Its architecture is comparable to the common split device driver
+architecture: xenfb and xenkbd modules serve as frontend in domU, and
+the user space vncfb or sdlfb process serves as backend in dom0.
+
+Signed-off-by: Markus Armbruster <armbru at redhat.com>
+Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
+
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
+--- linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Wed Nov 29 12:16:19 2006 +0000
++++ linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Thu Nov 30 15:13:53 2006 +0100
+@@ -1850,8 +1850,9 @@ void __init setup_arch(char **cmdline_p)
  #endif
  #endif
  	} else {
+-		extern int console_use_vt;
+-		console_use_vt = 0;
 +#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
 +		conswitchp = &dummy_con;
-+#else
- 		extern int console_use_vt;
- 		console_use_vt = 0;
 +#endif
  	}
  }
  
-diff -r ec03b24a2d83 -r 6ca424e1867e linux-2.6-xen-sparse/drivers/xen/Kconfig
---- linux-2.6-xen-sparse/drivers/xen/Kconfig	Tue Aug 15 19:53:55 2006 +0100
-+++ linux-2.6-xen-sparse/drivers/xen/Kconfig	Fri Aug 18 16:17:58 2006 -0400
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
+--- linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Wed Nov 29 12:16:19 2006 +0000
++++ linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Thu Nov 30 15:13:53 2006 +0100
+@@ -550,9 +550,9 @@ setup_arch (char **cmdline_p)
+ 		       xen_start_info->nr_pages, xen_start_info->flags);
+ 
+ 		if (!is_initial_xendomain()) {
+-			extern int console_use_vt;
++#if !defined(CONFIG_VT) || !defined(CONFIG_DUMMY_CONSOLE)
+ 			conswitchp = NULL;
+-			console_use_vt = 0;
++#endif
+ 		}
+ 	}
+ #endif
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
+--- linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Wed Nov 29 12:16:19 2006 +0000
++++ linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Thu Nov 30 15:13:53 2006 +0100
+@@ -970,9 +970,10 @@ void __init setup_arch(char **cmdline_p)
+ #endif
+ #endif
+ 		} else {
+-			extern int console_use_vt;
+-			console_use_vt = 0;
+-		}
++#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
++                    conswitchp = &dummy_con;
++#endif
++                }
+ 	}
+ #else	/* CONFIG_XEN */
+ 
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/drivers/xen/Kconfig
+--- linux-2.6-xen-sparse/drivers/xen/Kconfig	Wed Nov 29 12:16:19 2006 +0000
++++ linux-2.6-xen-sparse/drivers/xen/Kconfig	Thu Nov 30 15:13:53 2006 +0100
 @@ -172,6 +172,29 @@ config XEN_NETDEV_FRONTEND
  	  dedicated device-driver domain, or your master control domain
  	  (domain 0), then you almost certainly want to say Y here.
@@ -36,7 +83,7 @@
 +
 +config XEN_KEYBOARD
 +	tristate "Keyboard-device frontend driver"
-+	depends on XEN
++	depends on XEN && XEN_FRAMEBUFFER && INPUT
 +	default y
 +	help
 +	  The keyboard-device frontend driver allows the kernel to create a
@@ -47,30 +94,57 @@
  config XEN_SCRUB_PAGES
  	bool "Scrub memory before freeing it to Xen"
  	default y
-diff -r ec03b24a2d83 -r 6ca424e1867e linux-2.6-xen-sparse/drivers/xen/Makefile
---- linux-2.6-xen-sparse/drivers/xen/Makefile	Tue Aug 15 19:53:55 2006 +0100
-+++ linux-2.6-xen-sparse/drivers/xen/Makefile	Fri Aug 18 16:17:58 2006 -0400
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/drivers/xen/Makefile
+--- linux-2.6-xen-sparse/drivers/xen/Makefile	Wed Nov 29 12:16:19 2006 +0000
++++ linux-2.6-xen-sparse/drivers/xen/Makefile	Thu Nov 30 15:13:53 2006 +0100
 @@ -15,3 +15,5 @@ obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= net
  obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= netfront/
  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= pciback/
  obj-$(CONFIG_XEN_PCIDEV_FRONTEND)	+= pcifront/
-+obj-$(CONFIG_XEN_FRAMEBUFFER)		+= xenfb/
-+obj-$(CONFIG_XEN_KEYBOARD)		+= xenkbd/
-diff -r ec03b24a2d83 -r 6ca424e1867e linux-2.6-xen-sparse/drivers/xen/xenfb/Makefile
++obj-$(CONFIG_XEN_FRAMEBUFFER)		+= fbfront/
++obj-$(CONFIG_XEN_KEYBOARD)		+= fbfront/
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/drivers/xen/console/console.c
+--- linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed Nov 29 12:16:19 2006 +0000
++++ linux-2.6-xen-sparse/drivers/xen/console/console.c	Thu Nov 30 15:13:53 2006 +0100
+@@ -57,6 +57,7 @@
+ #include <xen/interface/event_channel.h>
+ #include <asm/hypervisor.h>
+ #include <xen/evtchn.h>
++#include <xen/xenbus.h>
+ #include <xen/xencons.h>
+ 
+ /*
+@@ -698,6 +699,15 @@ static int __init xencons_init(void)
+ 	printk("Xen virtual console successfully installed as %s%d\n",
+ 	       DRV(xencons_driver)->name, xc_num);
+ 
++        /* Check about framebuffer messing up the console */
++        if (!is_initial_xendomain() &&
++	    !xenbus_exists(XBT_NIL, "device", "vfb")) {
++		/* FIXME: this is ugly */
++		unregister_console(&kcons_info);
++		kcons_info.flags |= CON_CONSDEV;
++		register_console(&kcons_info);
++	}
++
+ 	return 0;
+ }
+ 
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/drivers/xen/fbfront/Makefile
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ linux-2.6-xen-sparse/drivers/xen/xenfb/Makefile	Fri Aug 18 16:17:58 2006 -0400
-@@ -0,0 +1,1 @@
++++ linux-2.6-xen-sparse/drivers/xen/fbfront/Makefile	Thu Nov 30 15:13:53 2006 +0100
+@@ -0,0 +1,2 @@
 +obj-$(CONFIG_XEN_FRAMEBUFFER)	:= xenfb.o
-diff -r ec03b24a2d83 -r 6ca424e1867e linux-2.6-xen-sparse/drivers/xen/xenfb/xenfb.c
++obj-$(CONFIG_XEN_KEYBOARD)	+= xenkbd.o
+diff -r 2773c39df9a6 linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ linux-2.6-xen-sparse/drivers/xen/xenfb/xenfb.c	Fri Aug 18 16:17:58 2006 -0400
-@@ -0,0 +1,568 @@
++++ linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c	Thu Nov 30 15:13:53 2006 +0100
+@@ -0,0 +1,682 @@
 +/*
 + * linux/drivers/video/xenfb.c -- Xen para-virtual frame buffer device
 + *
-+ * Copyright (C) 2005-2006
-+ *
-+ *      Anthony Liguori <aliguori at us.ibm.com>
++ * Copyright (C) 2005-2006 Anthony Liguori <aliguori at us.ibm.com>
++ * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru at redhat.com>
 + *
 + *  Based on linux/drivers/video/q40fb.c
 + *
@@ -79,6 +153,13 @@
 + *  more details.
 + */
 +
++/*
++ * TODO:
++ *
++ * Switch to grant tables when they become capable of dealing with the
++ * frame buffer.
++ */
++
 +#include <linux/kernel.h>
 +#include <linux/errno.h>
 +#include <linux/fb.h>
@@ -87,16 +168,13 @@
 +#include <linux/mm.h>
 +#include <asm/hypervisor.h>
 +#include <xen/evtchn.h>
++#include <xen/interface/io/fbif.h>
 +#include <xen/xenbus.h>
-+#include <linux/xenfb.h>
 +#include <linux/kthread.h>
 +
-+static int xenfb_fps = 20;
-+static unsigned long xenfb_mem_len = 2 * 1024 * 1024;
-+
 +struct xenfb_mapping
 +{
-+	struct list_head	next;
++	struct list_head	link;
 +	struct vm_area_struct	*vma;
[...2105 lines suppressed...]
- 	return ret;
-@@ -162,50 +155,21 @@ int __init xenkbd_init(void)
- 	xenbus_transaction_end(xbt, 1);
-  error_unreg:
- 	input_unregister_device(input_dev);
--	unbind_from_irqhandler(xenkbd_irq, dev);
--	xenkbd_irq = 0;
-+	unbind_from_irqhandler(dev->irq, dev);
-  error_freep:
- 	free_page((unsigned long)dev->info);
-  error:
- 	kfree(dev);
--	xenkbd_dev = NULL;
- 	return ret;
- }
- 
- static void __exit xenkbd_cleanup(void)
- {
- 	input_unregister_device(xenkbd_dev->dev);
--	unbind_from_irqhandler(xenkbd_irq, xenkbd_dev);
--	xenkbd_irq = 0;
-+	unbind_from_irqhandler(xenkbd_dev->irq, xenkbd_dev);
- 	free_page((unsigned long)xenkbd_dev->info);
- 	kfree(xenkbd_dev);
- 	xenkbd_dev = NULL;
--}
--
--void xenkbd_resume(void)
--{
--#if 0 /* FIXME */
--	int ret;
--
--	if (xenkbd_dev && xen_start_info->kbd_evtchn) {
--		if (xenkbd_irq)
--			unbind_from_irqhandler(xenkbd_irq, NULL);
--
--		ret = bind_evtchn_to_irqhandler(xen_start_info->kbd_evtchn,
--						input_handler,
--						0,
--						"xenkbd",
--						xenkbd_dev);
--
--		if (ret <= 0)
--			return;
--
--		xenkbd_irq = ret;
--		xenkbd_dev->info = mfn_to_virt(xen_start_info->kbd_mfn);
--	}
--#else
--	printk(KERN_DEBUG "xenkbd_resume not implemented\n");
--#endif
- }
- 
- module_init(xenkbd_init);
-diff -r 158f57cd19f6 -r 74930c9686ba linux-2.6-xen-sparse/include/linux/xenfb.h
---- linux-2.6-xen-sparse/include/linux/xenfb.h	Sat Sep 02 11:25:27 2006 -0400
-+++ linux-2.6-xen-sparse/include/linux/xenfb.h	Sat Sep 02 12:12:25 2006 -0400
-@@ -17,10 +17,12 @@
- 
- /* out events */
- 
-+#define XENFB_OUT_EVENT_SIZE 40
-+
- #define XENFB_TYPE_MOTION 1
- #define XENFB_TYPE_UPDATE 2
- 
--struct xenfb_motion
-+struct xenfb_motion	    /* currently unused */
- {
- 	__u8 type;          /* XENFB_TYPE_MOTION */
- 	__u16 x;            /* The new x coordinate */
-@@ -41,10 +43,12 @@ union xenfb_out_event
- 	__u8 type;
- 	struct xenfb_motion motion;
- 	struct xenfb_update update;
--	char _[40];
-+	char _[XENFB_OUT_EVENT_SIZE];
- };
- 
- /* in events */
-+
-+#define XENFB_IN_EVENT_SIZE 40
- 
- #define XENFB_TYPE_SET_EVENTS 1
- 
-@@ -63,33 +67,40 @@ union xenfb_in_event
- {
- 	__u8 type;
- 	struct xenfb_set_events set_events;
--	char _[40];
-+	char _[XENFB_OUT_EVENT_SIZE];
- };
- 
- /* shared page */
- 
--#define XENFB_IN_RING_SIZE (1024 / 40)
--#define XENFB_OUT_RING_SIZE (2048 / 40)
-+#define XENFB_IN_RING_SIZE 1024
-+#define XENFB_IN_RING_LEN (XENFB_IN_RING_SIZE / XENFB_IN_EVENT_SIZE)
-+#define XENFB_IN_RING_OFFS 1024
-+#define XENFB_IN_RING(page) \
-+    ((union xenfb_in_event *)((char *)(page) + XENFB_IN_RING_OFFS))
-+#define XENFB_IN_RING_REF(page, idx) \
-+    (XENFB_IN_RING((page))[(idx) % XENFB_IN_RING_LEN])
- 
--#define XENFB_RING_SIZE(ring) (sizeof((ring)) / sizeof(*(ring)))
--#define XENFB_RING_REF(ring, idx) (ring)[(idx) % XENFB_RING_SIZE((ring))]
-+#define XENFB_OUT_RING_SIZE 2048
-+#define XENFB_OUT_RING_LEN (XENFB_OUT_RING_SIZE / XENFB_OUT_EVENT_SIZE)
-+#define XENFB_OUT_RING_OFFS (XENFB_IN_RING_OFFS + XENFB_IN_RING_SIZE)
-+#define XENFB_OUT_RING(page) \
-+    ((union xenfb_out_event *)((char *)(page) + XENFB_OUT_RING_OFFS))
-+#define XENFB_OUT_RING_REF(page, idx) \
-+    (XENFB_OUT_RING((page))[(idx) % XENFB_OUT_RING_LEN])
- 
- struct xenfb_page
- {
--	__u8 initialized;
- 	__u16 width;         /* the width of the framebuffer (in pixels) */
- 	__u16 height;        /* the height of the framebuffer (in pixels) */
- 	__u32 line_length;   /* the length of a row of pixels (in bytes) */
- 	__u32 mem_length;    /* the length of the framebuffer (in bytes) */
- 	__u8 depth;          /* the depth of a pixel (in bits) */
- 
--	unsigned long pd[2];
-+	unsigned long pd[2];	/* FIXME rename to pgdir? */
-+	/* FIXME pd[1] unused at this time, shrink? */
- 
- 	__u32 in_cons, in_prod;
- 	__u32 out_cons, out_prod;
--
--	union xenfb_in_event in[XENFB_IN_RING_SIZE];
--	union xenfb_out_event out[XENFB_OUT_RING_SIZE];
- };
- 
- void xenfb_resume(void);
-diff -r 158f57cd19f6 -r 74930c9686ba linux-2.6-xen-sparse/include/linux/xenkbd.h
---- linux-2.6-xen-sparse/include/linux/xenkbd.h	Sat Sep 02 11:25:27 2006 -0400
-+++ linux-2.6-xen-sparse/include/linux/xenkbd.h	Sat Sep 02 12:12:25 2006 -0400
-@@ -16,6 +16,8 @@
- #include <asm/types.h>
- 
- /* in events */
-+
-+#define XENKBD_IN_EVENT_SIZE 40
- 
- #define XENKBD_TYPE_MOTION  1     /* mouse movement event */
- #define XENKBD_TYPE_BUTTON  2     /* mouse button event */
-@@ -48,33 +50,41 @@ union xenkbd_in_event
- 	struct xenkbd_motion motion;
- 	struct xenkbd_button button;
- 	struct xenkbd_key key;
--	char _[40];
-+	char _[XENKBD_IN_EVENT_SIZE];
- };
- 
- /* out events */
- 
-+#define XENKBD_OUT_EVENT_SIZE 40
-+
- union xenkbd_out_event
- {
- 	__u8 type;
--	char _[40];
-+	char _[XENKBD_OUT_EVENT_SIZE];
- };
- 
- /* shared page */
- 
--#define XENKBD_IN_RING_SIZE (2048 / 40)
--#define XENKBD_OUT_RING_SIZE (1024 / 40)
-+#define XENKBD_IN_RING_SIZE 2048
-+#define XENKBD_IN_RING_LEN (XENKBD_IN_RING_SIZE / XENKBD_IN_EVENT_SIZE)
-+#define XENKBD_IN_RING_OFFS 1024
-+#define XENKBD_IN_RING(page) \
-+    ((union xenkbd_in_event *)((char *)(page) + XENKBD_IN_RING_OFFS))
-+#define XENKBD_IN_RING_REF(page, idx) \
-+    (XENKBD_IN_RING((page))[(idx) % XENKBD_IN_RING_LEN])
- 
--#define XENKBD_RING_SIZE(ring) (sizeof((ring)) / sizeof(*(ring)))
--#define XENKBD_RING_REF(ring, idx) (ring)[(idx) % XENKBD_RING_SIZE((ring))]
-+#define XENKBD_OUT_RING_SIZE 1024
-+#define XENKBD_OUT_RING_LEN (XENKBD_OUT_RING_SIZE / XENKBD_OUT_EVENT_SIZE)
-+#define XENKBD_OUT_RING_OFFS (XENKBD_IN_RING_OFFS + XENKBD_IN_RING_SIZE)
-+#define XENKBD_OUT_RING(page) \
-+    ((union xenkbd_out_event *)((char *)(page) + XENKBD_OUT_RING_OFFS))
-+#define XENKBD_OUT_RING_REF(page, idx) \
-+    (XENKBD_OUT_RING((page))[(idx) % XENKBD_OUT_RING_LEN])
- 
- struct xenkbd_info
- {
--	__u8 initialized;
- 	__u32 in_cons, in_prod;
- 	__u32 out_cons, out_prod;
--
--	union xenkbd_in_event in[XENKBD_IN_RING_SIZE];
--	union xenkbd_out_event out[XENKBD_OUT_RING_SIZE];
- };
- 
- void xenkbd_resume(void);




More information about the fedora-cvs-commits mailing list