rpms/kernel-xen-2.6/devel linux-2.6-xen-0007-xen-Enable-Xen-console-by-default-in-domU.patch, NONE, 1.1 linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch, 1.3, 1.4 linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch, 1.3, 1.4 linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch, 1.2, 1.3 linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch, 1.2, 1.3 linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch, 1.2, 1.3 linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch, 1.2, 1.3 linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch, 1.3, 1.4 linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch, 1.3, 1.4 linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch, 1.3, 1.4 linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch, 1.3, 1.4 linux-2.6-xen-0018-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, NONE, 1.1 linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, NONE, 1.1 linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch, NONE, 1.1 Makefile, 1.11, 1.12 Makefile.config, 1.11, 1.12 kernel.spec, 1.29, 1.30 linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch, 1.6, NONE linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch, 1.6, NONE linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch, 1.5, NONE linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch, 1.5, NONE linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch, 1.5, NONE linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch, 1.5, NONE linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch, 1.5, NONE linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch, 1.5, NONE linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch, 1.5, NONE linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch, 1.5, NONE linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, 1.6, NONE linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, 1.3, NONE linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch, 1.5, NONE linux-2.6-xen-0020-reserve_early-kernel-text-and-data-segments.patch, 1.1, NONE

Mark McLoughlin (markmc) fedora-extras-commits at redhat.com
Fri Apr 4 17:24:24 UTC 2008


Author: markmc

Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12697

Modified Files:
	Makefile Makefile.config kernel.spec 
Added Files:
	linux-2.6-xen-0007-xen-Enable-Xen-console-by-default-in-domU.patch 
	linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch 
	linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch 
	linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch 
	linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch 
	linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch 
	linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch 
	linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch 
	linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch 
	linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch 
	linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch 
	linux-2.6-xen-0018-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch 
	linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch 
	linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch 
Removed Files:
	linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch 
	linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch 
	linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch 
	linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch 
	linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch 
	linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch 
	linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch 
	linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch 
	linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch 
	linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch 
	linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch 
	linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch 
	linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch 
	linux-2.6-xen-0020-reserve_early-kernel-text-and-data-segments.patch 
Log Message:
* Fri Apr  4 2008 Mark McLoughlin <markmc at redhat.com>
- Add patch from armbru to intelligently choose the preferred
  console (#434761)
- Couple of x86_64 fixes


linux-2.6-xen-0007-xen-Enable-Xen-console-by-default-in-domU.patch:

--- NEW FILE linux-2.6-xen-0007-xen-Enable-Xen-console-by-default-in-domU.patch ---
>From affe46f29cca4d1788f598d5581f4ac65bdf904b Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru at redhat.com>
Date: Fri, 4 Apr 2008 16:59:35 +0200
Subject: [PATCH] xen: Enable Xen console by default in domU

Without console= arguments on the kernel command line, the first
console to register becomes enabled and the preferred console (the one
behind /dev/console).  This is tty (assuming CONFIG_VT_CONSOLE is
enabled, which it commonly is).

This is okay as long tty is a useful console.  But unless we have the
PV framebuffer, and it is enabled for this domain, tty0 in domU is
merely a dummy.  In that case, we want the preferred console to be the
Xen console hvc0, and we want it without having to fiddle with the
kernel command line.

Even with PV framebuffer enabled, we still want to enable the Xen
console as well.

Problem: when tty registers, we can't yet know whether the PVFB is
enabled.  By the time we can know (xenstore is up), the console setup
game is over.

Enable the Xen console hvc by default, and make it the preferred
console.  Change the preferred to tty when PVFB probes successfully.

Signed-off-by: Markus Armbruster <armbru at redhat.com>
---
 arch/x86/xen/enlighten.c    |    6 ++++++
 drivers/video/xen-fbfront.c |   22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 75760a7..8a05a6d 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -25,6 +25,7 @@
 #include <linux/mm.h>
 #include <linux/page-flags.h>
 #include <linux/highmem.h>
+#include <linux/console.h>
 
 #include <xen/interface/xen.h>
 #include <xen/interface/physdev.h>
@@ -1245,6 +1246,11 @@ asmlinkage void __init xen_start_kernel(void)
 		? __pa(xen_start_info->mod_start) : 0;
 	boot_params.hdr.ramdisk_size = xen_start_info->mod_len;
 
+	if (!is_initial_xendomain()) {
+		add_preferred_console("tty", 0, NULL);
+		add_preferred_console("hvc", 0, NULL);
+	}
+
 	/* Start the world */
 	start_kernel();
 }
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 619a6f8..9b428b5 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -18,6 +18,7 @@
  * frame buffer.
  */
 
+#include <linux/console.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/fb.h>
@@ -48,6 +49,7 @@ struct xenfb_info {
 
 static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8;
 
+static void xenfb_make_preferred_console(void);
 static int xenfb_remove(struct xenbus_device *);
 static void xenfb_init_shared_page(struct xenfb_info *);
 static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *);
@@ -348,6 +350,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
 	if (ret < 0)
 		goto error;
 
+	xenfb_make_preferred_console();
 	return 0;
 
  error_nomem:
@@ -358,6 +361,25 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
 	return ret;
 }
 
+static __devinit void
+xenfb_make_preferred_console(void)
+{
+	struct console *c;
+
+	acquire_console_sem();
+	for (c = console_drivers; c; c = c->next) {
+		if (!strcmp(c->name, "tty") && c->index == 0)
+			break;
+	}
+	release_console_sem();
+	if (c) {
+		unregister_console(c);
+		c->flags |= CON_CONSDEV;
+		c->flags &= ~CON_PRINTBUFFER; /* don't print again */
+		register_console(c);
+	}
+}
+
 static int xenfb_resume(struct xenbus_device *dev)
 {
 	struct xenfb_info *info = dev->dev.driver_data;
-- 
1.5.4.1


linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch:

Index: linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
===================================================================
RCS file: linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
diff -N linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch	4 Apr 2008 17:23:58 -0000	1.4
@@ -0,0 +1,97 @@
+From fb20368410b96f140113a0bd5d6208822300abce Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Fri, 22 Feb 2008 12:42:52 +0000
+Subject: [PATCH] xen: Module autoprobing support for frontend drivers
+
+Add module aliases to support autoprobing modules
+for xen frontend devices.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/block/xen-blkfront.c      |    1 +
+ drivers/net/xen-netfront.c        |    1 +
+ drivers/xen/xenbus/xenbus_probe.c |   27 +++++++++++++++++++++++++--
+ 3 files changed, 27 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
+index 2e7c81e..0c47c02 100644
+--- a/drivers/block/xen-blkfront.c
++++ b/drivers/block/xen-blkfront.c
+@@ -1005,3 +1005,4 @@ module_exit(xlblk_exit);
+ MODULE_DESCRIPTION("Xen virtual block device frontend");
+ MODULE_LICENSE("GPL");
+ MODULE_ALIAS_BLOCKDEV_MAJOR(XENVBD_MAJOR);
++MODULE_ALIAS("xen:vbd");
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
+index 7483d45..b3fa27e 100644
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1809,3 +1809,4 @@ module_exit(netif_exit);
+ 
+ MODULE_DESCRIPTION("Xen virtual network device frontend");
+ MODULE_LICENSE("GPL");
++MODULE_ALIAS("xen:vif");
+diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
+index 4750de3..336363c 100644
+--- a/drivers/xen/xenbus/xenbus_probe.c
++++ b/drivers/xen/xenbus/xenbus_probe.c
+@@ -88,6 +88,16 @@ int xenbus_match(struct device *_dev, struct device_driver *_drv)
+ 	return match_device(drv->ids, to_xenbus_device(_dev)) != NULL;
+ }
+ 
++static int xenbus_uevent(struct device *_dev, struct kobj_uevent_env *env)
++{
++	struct xenbus_device *dev = to_xenbus_device(_dev);
++
++	if (add_uevent_var(env, "MODALIAS=xen:%s", dev->devicetype))
++		return -ENOMEM;
++
++	return 0;
++}
++
+ /* device/<type>/<id> => <type>-<id> */
+ static int frontend_bus_id(char bus_id[BUS_ID_SIZE], const char *nodename)
+ {
+@@ -166,6 +176,7 @@ static struct xen_bus_type xenbus_frontend = {
+ 	.bus = {
+ 		.name     = "xen",
+ 		.match    = xenbus_match,
++		.uevent   = xenbus_uevent,
+ 		.probe    = xenbus_dev_probe,
+ 		.remove   = xenbus_dev_remove,
+ 		.shutdown = xenbus_dev_shutdown,
+@@ -438,6 +449,12 @@ static ssize_t xendev_show_devtype(struct device *dev,
+ }
+ DEVICE_ATTR(devtype, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_devtype, NULL);
+ 
++static ssize_t xendev_show_modalias(struct device *dev,
++				    struct device_attribute *attr, char *buf)
++{
++	return sprintf(buf, "xen:%s\n", to_xenbus_device(dev)->devicetype);
++}
++DEVICE_ATTR(modalias, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_modalias, NULL);
+ 
+ int xenbus_probe_node(struct xen_bus_type *bus,
+ 		      const char *type,
+@@ -492,10 +509,16 @@ int xenbus_probe_node(struct xen_bus_type *bus,
+ 
+ 	err = device_create_file(&xendev->dev, &dev_attr_devtype);
+ 	if (err)
+-		goto fail_remove_file;
++		goto fail_remove_nodename;
++
++	err = device_create_file(&xendev->dev, &dev_attr_modalias);
++	if (err)
++		goto fail_remove_devtype;
+ 
+ 	return 0;
+-fail_remove_file:
++fail_remove_devtype:
++	device_remove_file(&xendev->dev, &dev_attr_devtype);
++fail_remove_nodename:
+ 	device_remove_file(&xendev->dev, &dev_attr_nodename);
+ fail_unregister:
+ 	device_unregister(&xendev->dev);
+-- 
+1.5.4.1
+

linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch:

Index: linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
===================================================================
RCS file: linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
diff -N linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch	4 Apr 2008 17:23:58 -0000	1.4
@@ -0,0 +1,37 @@
+From b106640833467c45a1330a959f16a0b5c8c5df7a Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Thu, 21 Feb 2008 11:13:12 +0000
+Subject: [PATCH] xen: Add compatibility aliases for frontend drivers
+
+Before getting merged, xen-blkfront was xenblk and
+xen-netfront was xennet.
+
+Add compatibility module aliases to ease upgrades.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/block/xen-blkfront.c |    1 +
+ drivers/net/xen-netfront.c   |    1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
+index 0c47c02..8ce168d 100644
+--- a/drivers/block/xen-blkfront.c
++++ b/drivers/block/xen-blkfront.c
+@@ -1006,3 +1006,4 @@ MODULE_DESCRIPTION("Xen virtual block device frontend");
+ MODULE_LICENSE("GPL");
+ MODULE_ALIAS_BLOCKDEV_MAJOR(XENVBD_MAJOR);
+ MODULE_ALIAS("xen:vbd");
++MODULE_ALIAS("xenblk");
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
+index b3fa27e..e62018a 100644
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1810,3 +1810,4 @@ module_exit(netif_exit);
+ MODULE_DESCRIPTION("Xen virtual network device frontend");
+ MODULE_LICENSE("GPL");
+ MODULE_ALIAS("xen:vif");
++MODULE_ALIAS("xennet");
+-- 
+1.5.4.1
+

linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch:

Index: linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
===================================================================
RCS file: linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
diff -N linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch	4 Apr 2008 17:23:58 -0000	1.3
@@ -0,0 +1,107 @@
+From 1fe93b8d25a080a5a026251b0c1acce9175b3719 Mon Sep 17 00:00:00 2001
+From: Christian Limpach <Christian.Limpach at xensource.com>
+Date: Wed, 19 Mar 2008 15:54:48 +0000
+Subject: [PATCH] xen blkfront: Delay wait for block devices until after the disk is added.
+
+When the xen block frontend driver is built as a module the module load
+is only synchronous up to the point where the frontend and the backend
+become connected rather than when the disk is added.
+
+This means that there can be a race on boot between loading the module and
+loading the dm-* modules and doing the scan for LVM physical volumes (all
+in the initrd). In the failure case the disk is not present until after the
+scan for physical volumes is complete.
+
+Taken from:
+
+  http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/11483a00c017
+
+Signed-off-by: Christian Limpach <Christian.Limpach at xensource.com>
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/block/xen-blkfront.c      |   11 +++++++++++
+ drivers/xen/xenbus/xenbus_probe.c |    5 ++++-
+ include/xen/xenbus.h              |    1 +
+ 3 files changed, 16 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
+index 8ce168d..74f943a 100644
+--- a/drivers/block/xen-blkfront.c
++++ b/drivers/block/xen-blkfront.c
+@@ -89,6 +89,7 @@ struct blkfront_info
+ 	struct blk_shadow shadow[BLK_RING_SIZE];
+ 	unsigned long shadow_free;
+ 	int feature_barrier;
++	int is_ready;
+ 
+ 	/**
+ 	 * The number of people holding this device open.  We won't allow a
+@@ -840,6 +841,8 @@ static void blkfront_connect(struct blkfront_info *info)
+ 	spin_unlock_irq(&blkif_io_lock);
+ 
+ 	add_disk(info->gd);
++
++	info->is_ready = 1;
+ }
+ 
+ /**
+@@ -932,6 +935,13 @@ static int blkfront_remove(struct xenbus_device *dev)
+ 	return 0;
+ }
+ 
++static int blkfront_is_ready(struct xenbus_device *dev)
++{
++	struct blkfront_info *info = dev->dev.driver_data;
++
++	return info->is_ready;
++}
++
+ static int blkif_open(struct inode *inode, struct file *filep)
+ {
+ 	struct blkfront_info *info = inode->i_bdev->bd_disk->private_data;
+@@ -978,6 +988,7 @@ static struct xenbus_driver blkfront = {
+ 	.remove = blkfront_remove,
+ 	.resume = blkfront_resume,
+ 	.otherend_changed = backend_changed,
++	.is_ready = blkfront_is_ready,
+ };
+ 
+ static int __init xlblk_init(void)
+diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
+index 336363c..57ceb53 100644
+--- a/drivers/xen/xenbus/xenbus_probe.c
++++ b/drivers/xen/xenbus/xenbus_probe.c
+@@ -869,6 +869,7 @@ static int is_disconnected_device(struct device *dev, void *data)
+ {
+ 	struct xenbus_device *xendev = to_xenbus_device(dev);
+ 	struct device_driver *drv = data;
++	struct xenbus_driver *xendrv;
+ 
+ 	/*
+ 	 * A device with no driver will never connect. We care only about
+@@ -881,7 +882,9 @@ static int is_disconnected_device(struct device *dev, void *data)
+ 	if (drv && (dev->driver != drv))
+ 		return 0;
+ 
+-	return (xendev->state != XenbusStateConnected);
++	xendrv = to_xenbus_driver(dev->driver);
++	return (xendev->state != XenbusStateConnected ||
++		(xendrv->is_ready && !xendrv->is_ready(xendev)));
+ }
+ 
+ static int exists_disconnected_device(struct device_driver *drv)
+diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
+index 6f7c290..6369d89 100644
+--- a/include/xen/xenbus.h
++++ b/include/xen/xenbus.h
+@@ -97,6 +97,7 @@ struct xenbus_driver {
+ 	int (*uevent)(struct xenbus_device *, char **, int, char *, int);
+ 	struct device_driver driver;
+ 	int (*read_otherend_details)(struct xenbus_device *dev);
++	int (*is_ready)(struct xenbus_device *dev);
+ };
+ 
+ static inline struct xenbus_driver *to_xenbus_driver(struct device_driver *drv)
+-- 
+1.5.4.1
+

linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch:

Index: linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
===================================================================
RCS file: linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
diff -N linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch	4 Apr 2008 17:23:58 -0000	1.3
@@ -0,0 +1,78 @@
+From fe9ea25d56b2212dbda3b0eee04f5d3a81dc1dc8 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Tue, 19 Feb 2008 15:34:32 +0000
+Subject: [PATCH] xen: Add a vmlinuz target
+
+Although patches are in progress to allow Xen boot
+a DomU using a bzImage, support for booting a Dom0
+using a bzImage is still a ways off.
+
+For now, just add a target to build a gzip-ed ELF
+file which Xen can use to boot both Dom0 and DomU.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ arch/x86/Makefile        |    9 +++++++++
+ arch/x86/boot/.gitignore |    1 +
+ arch/x86/boot/Makefile   |    9 +++++++++
+ 3 files changed, 19 insertions(+), 0 deletions(-)
+
+diff --git a/arch/x86/Makefile b/arch/x86/Makefile
+index f1e739a..14a752e 100644
+--- a/arch/x86/Makefile
++++ b/arch/x86/Makefile
+@@ -206,6 +206,15 @@ boot := arch/x86/boot
+ PHONY += zImage bzImage compressed zlilo bzlilo \
+          zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
+ 
++ifdef CONFIG_XEN
++PHONY += vmlinuz
++all: vmlinuz
++
++vmlinuz: KBUILD_IMAGE := $(boot)/vmlinuz
++vmlinuz: vmlinux
++	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
++endif
++
+ # Default kernel to build
+ all: bzImage
+ 
+diff --git a/arch/x86/boot/.gitignore b/arch/x86/boot/.gitignore
+index b1bdc4c..35e7956 100644
+--- a/arch/x86/boot/.gitignore
++++ b/arch/x86/boot/.gitignore
+@@ -5,3 +5,4 @@ setup.bin
+ setup.elf
+ cpustr.h
+ mkcpustr
++vmlinuz
+diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
+index f88458e..61bba92 100644
+--- a/arch/x86/boot/Makefile
++++ b/arch/x86/boot/Makefile
+@@ -26,6 +26,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
+ #RAMDISK := -DRAMDISK=512
+ 
+ targets		:= vmlinux.bin setup.bin setup.elf zImage bzImage
++targets		+= vmlinuz vmlinux-stripped
+ subdir-		:= compressed
+ 
+ setup-y		+= a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
+@@ -105,6 +106,14 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE
+ $(obj)/compressed/vmlinux: FORCE
+ 	$(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
+ 
++$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
++	$(call if_changed,gzip)
++	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
++
++$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
++$(obj)/vmlinux-stripped: vmlinux FORCE
++	$(call if_changed,objcopy)
++
+ # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
+ FDARGS =
+ # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
+-- 
+1.5.4.1
+

linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch:

Index: linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
===================================================================
RCS file: linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
diff -N linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch	4 Apr 2008 17:23:58 -0000	1.3
@@ -0,0 +1,124 @@
+From ed42bffbe71160714351ecc9b213763a39570158 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 08:30:37 +0000
+Subject: [PATCH] xen: Add empty xenctrl module
+
+Add the basic infrastructure for a xenctrl module
+which will contain the various kernel interfaces
+used by (mainly Dom0) Xen userspace.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ arch/x86/xen/Kconfig         |    7 +++++
+ drivers/xen/Makefile         |    2 +
+ drivers/xen/xenctrl/Makefile |    4 +++
+ drivers/xen/xenctrl/main.c   |   62 ++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 75 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/Makefile
+ create mode 100644 drivers/xen/xenctrl/main.c
+
+diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
+index 4d5f264..4723bc1 100644
+--- a/arch/x86/xen/Kconfig
++++ b/arch/x86/xen/Kconfig
+@@ -11,3 +11,10 @@ config XEN
+ 	  This is the Linux Xen port.  Enabling this will allow the
+ 	  kernel to boot in a paravirtualized environment under the
+ 	  Xen hypervisor.
++
++config XENCTRL
++	tristate "Xen's user space control interfaces"
++	depends on XEN && PROC_FS
++	default y if XEN
++	help
++	  This is the /proc/xen interface used by Xen's libxc.
+diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
+index 56592f0..6737463 100644
+--- a/drivers/xen/Makefile
++++ b/drivers/xen/Makefile
+@@ -1,2 +1,4 @@
+ obj-y	+= grant-table.o
+ obj-y	+= xenbus/
++
++obj-$(CONFIG_XENCTRL) += xenctrl/
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+new file mode 100644
+index 0000000..1f43a43
+--- /dev/null
++++ b/drivers/xen/xenctrl/Makefile
+@@ -0,0 +1,4 @@
++obj-$(CONFIG_XENCTRL) += xenctrl.o
++
++xenctrl-objs  =
++xenctrl-objs += main.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+new file mode 100644
+index 0000000..2965ceb
+--- /dev/null
++++ b/drivers/xen/xenctrl/main.c
+@@ -0,0 +1,62 @@
++/******************************************************************************
++ *
++ * main.c
++ *
++ * Xen userspace control interfaces
++ *
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <asm/xen/hypervisor.h>
++
++static int __init xenctrl_init(void)
++{
++	struct proc_dir_entry *dir;
++
++	if (!is_running_on_xen())
++		return -ENODEV;
++
++	dir = proc_mkdir("xen", NULL);
++	if (!dir)
++		return -ENOMEM;
++
++	dir->owner = THIS_MODULE;
++
++	return 0;
++}
++
++static void __exit xenctrl_exit(void)
++{
++	remove_proc_entry("xen", NULL);
++}
++
++module_init(xenctrl_init);
++module_exit(xenctrl_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
+-- 
+1.5.4.1
+

linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch:

Index: linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
===================================================================
RCS file: linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
diff -N linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch	4 Apr 2008 17:23:58 -0000	1.3
@@ -0,0 +1,190 @@
+From 2612b02b68bfd3fac7a64d45897ef3d754f22368 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 09:16:51 +0000
+Subject: [PATCH] xen: Add /proc/xen/capabilities
+
+/proc/xen/capabilities is used by the xend init script
+to check whether it is running on Dom0.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/xen/xenctrl/Makefile       |    1 +
+ drivers/xen/xenctrl/capabilities.c |   68 ++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/main.c         |   11 ++++++
+ drivers/xen/xenctrl/xenctrl.h      |   39 ++++++++++++++++++++
+ 4 files changed, 119 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/capabilities.c
+ create mode 100644 drivers/xen/xenctrl/xenctrl.h
+
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 1f43a43..631f535 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -2,3 +2,4 @@ obj-$(CONFIG_XENCTRL) += xenctrl.o
+ 
+ xenctrl-objs  =
+ xenctrl-objs += main.o
++xenctrl-objs += capabilities.o
+diff --git a/drivers/xen/xenctrl/capabilities.c b/drivers/xen/xenctrl/capabilities.c
+new file mode 100644
+index 0000000..1ff078a
+--- /dev/null
++++ b/drivers/xen/xenctrl/capabilities.c
+@@ -0,0 +1,68 @@
++/******************************************************************************
++ *
++ * capabilities.c
++ *
++ * /proc/xen/capabilities
++ *
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <asm/xen/hypervisor.h>
++
++static int capabilities_read(char *page, char **start, off_t off,
++			     int count, int *eof, void *data)
++{
++	int len = 0;
++	*page = 0;
++
++	if (is_initial_xendomain())
++		len = sprintf(page, "control_d\n");
++
++	*eof = 1;
++	return len;
++}
++
++int __init capabilities_create_proc_entry(void)
++{
++	struct proc_dir_entry *entry;
++
++	entry = create_proc_entry("xen/capabilities", 0400, NULL);
++	if (!entry)
++		return -ENOMEM;
++
++	entry->owner = THIS_MODULE;
++	entry->read_proc = capabilities_read;
++
++	return 0;
++}
++
++void __exit capabilities_remove_proc_entry(void)
++{
++	remove_proc_entry("xen/capabilities", NULL);
++}
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index 2965ceb..0e42f7e 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -31,6 +31,8 @@
+  * IN THE SOFTWARE.
+  */
+ 
++#include "xenctrl.h"
++
+ #include <linux/proc_fs.h>
+ #include <linux/module.h>
+ #include <asm/xen/hypervisor.h>
+@@ -38,6 +40,7 @@
+ static int __init xenctrl_init(void)
+ {
+ 	struct proc_dir_entry *dir;
++	int ret;
+ 
+ 	if (!is_running_on_xen())
+ 		return -ENODEV;
+@@ -48,11 +51,19 @@ static int __init xenctrl_init(void)
+ 
+ 	dir->owner = THIS_MODULE;
+ 
++	ret = capabilities_create_proc_entry();
++	if (ret)
++		goto fail1;
++
+ 	return 0;
++
++ fail1:	remove_proc_entry("xen", NULL);
++	return ret;
+ }
+ 
+ static void __exit xenctrl_exit(void)
+ {
++	capabilities_remove_proc_entry();
+ 	remove_proc_entry("xen", NULL);
+ }
+ 
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+new file mode 100644
+index 0000000..7378dde
+--- /dev/null
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -0,0 +1,39 @@
++/******************************************************************************
++ * xenctl.h
++ * 
++ * Xen userspace control interfaces
++ * 
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/init.h>
++
++/*
++ * capabilities.c
++ */
++int capabilities_create_proc_entry(void) __init;
++void capabilities_remove_proc_entry(void) __exit;
+-- 
+1.5.4.1
+

linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch:

Index: linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
===================================================================
RCS file: linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
diff -N linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch	4 Apr 2008 17:23:58 -0000	1.4
@@ -0,0 +1,285 @@
+From d307bf845a07bfb7ae2f7714ab84f96336be9462 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 08:24:57 +0000
+Subject: [PATCH] xen: Add /proc/xen/privcmd
+
+/proc/xen/privcmd is an ioctl() interface which allows
+userspace apps to invoke hypercalls.
+
+There should also be an ioctl (IOCTL_PRIVCMD_MMAP)
+which is used to map foreign pages into a processes
+address space, but we leave this unimplemented for
+now pending further work on foreign page support.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/xen/xenctrl/Makefile    |    1 +
+ drivers/xen/xenctrl/main.c      |    6 +++
+ drivers/xen/xenctrl/privcmd.c   |   81 +++++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/xenctrl.h   |    6 +++
+ include/asm-x86/xen/hypercall.h |   28 +++++++++++++
+ include/xen/sys/privcmd.h       |   79 ++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 201 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/privcmd.c
+ create mode 100644 include/xen/sys/privcmd.h
+
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 631f535..8a706cb 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -3,3 +3,4 @@ obj-$(CONFIG_XENCTRL) += xenctrl.o
+ xenctrl-objs  =
+ xenctrl-objs += main.o
+ xenctrl-objs += capabilities.o
++xenctrl-objs += privcmd.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index 0e42f7e..d1fe6ef 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -55,14 +55,20 @@ static int __init xenctrl_init(void)
+ 	if (ret)
+ 		goto fail1;
+ 
++	ret = privcmd_create_proc_entry();
++	if (ret)
++		goto fail2;
++
+ 	return 0;
+ 
++ fail2: capabilities_remove_proc_entry();
+  fail1:	remove_proc_entry("xen", NULL);
+ 	return ret;
+ }
+ 
+ static void __exit xenctrl_exit(void)
+ {
++	privcmd_remove_proc_entry();
+ 	capabilities_remove_proc_entry();
+ 	remove_proc_entry("xen", NULL);
+ }
+diff --git a/drivers/xen/xenctrl/privcmd.c b/drivers/xen/xenctrl/privcmd.c
+new file mode 100644
+index 0000000..58c4b83
+--- /dev/null
++++ b/drivers/xen/xenctrl/privcmd.c
+@@ -0,0 +1,81 @@
++/******************************************************************************
++ * privcmd.c
++ * 
++ * Interface to privileged domain-0 commands.
++ * 
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <linux/uaccess.h>
++#include <asm/xen/hypervisor.h>
++#include <xen/sys/privcmd.h>
++
++static long privcmd_ioctl(struct file *file, unsigned int cmd,
++			  unsigned long arg)
++{
++	switch (cmd) {
++	case IOCTL_PRIVCMD_HYPERCALL: {
++		privcmd_hypercall_t cmd;
++  
++		if (copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)))
++			return -EFAULT;
++
++		return privcmd_hypercall(&cmd);
++	}
++
++	case IOCTL_PRIVCMD_MMAP:
++	case IOCTL_PRIVCMD_MMAPBATCH:
++		printk(KERN_WARNING "IOCTL_PRIVCMD_MMAP ioctl not yet implemented\n");
++	default:
++		return -EINVAL;
++	}
++}
++
++static const struct file_operations privcmd_file_ops = {
++	.unlocked_ioctl = privcmd_ioctl,
++};
++
++int __init privcmd_create_proc_entry(void)
++{
++	static struct proc_dir_entry *entry;
++
++	entry = create_proc_entry("xen/privcmd", 0400, NULL);
++	if (!entry)
++		return -ENOMEM;
++
++	entry->owner = THIS_MODULE;
++	entry->proc_fops = &privcmd_file_ops;
++
++	return 0;
++}
++
++void __exit privcmd_remove_proc_entry(void)
++{
++	remove_proc_entry("xen/privcmd", NULL);
++}
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+index 7378dde..a35209a 100644
+--- a/drivers/xen/xenctrl/xenctrl.h
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -37,3 +37,9 @@
+  */
+ int capabilities_create_proc_entry(void) __init;
+ void capabilities_remove_proc_entry(void) __exit;
++
++/*
++ * privcmd.c
++ */
++int privcmd_create_proc_entry(void) __init;
++void privcmd_remove_proc_entry(void) __exit;
+diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
+index bc0ee7d..cd554ca 100644
+--- a/include/asm-x86/xen/hypercall.h
++++ b/include/asm-x86/xen/hypercall.h
+@@ -410,4 +410,32 @@ MULTI_stack_switch(struct multicall_entry *mcl,
+ 	mcl->args[1] = esp;
+ }
+ 
++#include <xen/sys/privcmd.h>
++
++static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
++{
++	int ret;
++
++	if (hypercall->op >= (PAGE_SIZE >> 5))
++		return -EINVAL;
++
++	__asm__ __volatile__ (
++		"pushl %%ebx; pushl %%ecx; pushl %%edx; "
++		"pushl %%esi; pushl %%edi; "
++		"movl  8(%%eax),%%ebx ;"
++		"movl 16(%%eax),%%ecx ;"
++		"movl 24(%%eax),%%edx ;"
++		"movl 32(%%eax),%%esi ;"
++		"movl 40(%%eax),%%edi ;"
++		"movl   (%%eax),%%eax ;"
++		"shll $5,%%eax ;"
++		"addl $hypercall_page,%%eax ;"
++		"call *%%eax ;"
++		"popl %%edi; popl %%esi; popl %%edx; "
++		"popl %%ecx; popl %%ebx"
++		: "=a" (ret) : "0" (hypercall) : "memory" );
++
++	return ret;
++}
++
+ #endif /* __HYPERCALL_H__ */
+diff --git a/include/xen/sys/privcmd.h b/include/xen/sys/privcmd.h
+new file mode 100644
+index 0000000..9cfa9d7
+--- /dev/null
++++ b/include/xen/sys/privcmd.h
+@@ -0,0 +1,79 @@
++/******************************************************************************
++ * privcmd.h
++ * 
++ * Interface to /proc/xen/privcmd.
++ * 
++ * Copyright (c) 2003-2005, K A Fraser
++ * 
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ * 
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ * 
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ * 
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#ifndef __LINUX_PUBLIC_PRIVCMD_H__
++#define __LINUX_PUBLIC_PRIVCMD_H__
++
++#include <linux/types.h>
++
++#ifndef __user
++#define __user
++#endif
++
++typedef struct privcmd_hypercall
++{
++	__u64 op;
++	__u64 arg[5];
++} privcmd_hypercall_t;
++
++typedef struct privcmd_mmap_entry {
++	__u64 va;
++	__u64 mfn;
++	__u64 npages;
++} privcmd_mmap_entry_t; 
++
++typedef struct privcmd_mmap {
++	int num;
++	domid_t dom; /* target domain */
++	privcmd_mmap_entry_t __user *entry;
++} privcmd_mmap_t; 
++
++typedef struct privcmd_mmapbatch {
++	int num;     /* number of pages to populate */
++	domid_t dom; /* target domain */
++	__u64 addr;  /* virtual address */
++	ulong __user *arr; /* array of mfns - top nibble set on err */
++} privcmd_mmapbatch_t; 
++
++/*
++ * @cmd: IOCTL_PRIVCMD_HYPERCALL
++ * @arg: &privcmd_hypercall_t
++ * Return: Value returned from execution of the specified hypercall.
++ */
++#define IOCTL_PRIVCMD_HYPERCALL					\
++	_IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t))
++#define IOCTL_PRIVCMD_MMAP					\
++	_IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t))
++#define IOCTL_PRIVCMD_MMAPBATCH					\
++	_IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t))
++
++#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
+-- 
+1.5.4.1
+

linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch:

Index: linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
===================================================================
RCS file: linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
diff -N linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch	4 Apr 2008 17:23:58 -0000	1.4
@@ -0,0 +1,529 @@
+From c14273d35a547b39bc0ca0281062ccdd567f0dfe Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 22:04:36 +0000
+Subject: [PATCH] xen: Add /proc/xen/xenbus
+
+This interface is used by userspace programs to talk to
+xenstored.
+
+Since xenstored makes itself available to Dom0 userspace
+via a socket this should only really be useful in Domu,
+but it turns out that Dom0 apps historically default
+to using /proc/xen/xenbus rather than the socket.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/xen/xenbus/xenbus_comms.h |    1 -
+ drivers/xen/xenbus/xenbus_probe.c |    2 +
+ drivers/xen/xenbus/xenbus_xs.c    |    1 +
+ drivers/xen/xenctrl/Makefile      |    1 +
+ drivers/xen/xenctrl/main.c        |    6 +
+ drivers/xen/xenctrl/xenbus.c      |  398 +++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/xenctrl.h     |    6 +
+ include/xen/xenbus.h              |    2 +
+ 8 files changed, 416 insertions(+), 1 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/xenbus.c
+
+diff --git a/drivers/xen/xenbus/xenbus_comms.h b/drivers/xen/xenbus/xenbus_comms.h
+index c21db75..fcc9b29 100644
+--- a/drivers/xen/xenbus/xenbus_comms.h
++++ b/drivers/xen/xenbus/xenbus_comms.h
+@@ -41,6 +41,5 @@ int xb_data_to_read(void);
+ int xb_wait_for_data_to_read(void);
+ int xs_input_avail(void);
+ extern struct xenstore_domain_interface *xen_store_interface;
+-extern int xen_store_evtchn;
+ 
+ #endif /* _XENBUS_COMMS_H */
+diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
+index 57ceb53..c811581 100644
+--- a/drivers/xen/xenbus/xenbus_probe.c
++++ b/drivers/xen/xenbus/xenbus_probe.c
+@@ -56,6 +56,8 @@
+ #include "xenbus_probe.h"
+ 
+ int xen_store_evtchn;
++EXPORT_SYMBOL_GPL(xen_store_evtchn);
++
+ struct xenstore_domain_interface *xen_store_interface;
+ static unsigned long xen_store_mfn;
+ 
+diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
+index 227d53b..810e24a 100644
+--- a/drivers/xen/xenbus/xenbus_xs.c
++++ b/drivers/xen/xenbus/xenbus_xs.c
+@@ -184,6 +184,7 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
+ 
+ 	return ret;
+ }
++EXPORT_SYMBOL(xenbus_dev_request_and_reply);
+ 
+ /* Send message to xs, get kmalloc'ed reply.  ERR_PTR() on error. */
+ static void *xs_talkv(struct xenbus_transaction t,
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 8a706cb..23dafa3 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -4,3 +4,4 @@ xenctrl-objs  =
+ xenctrl-objs += main.o
+ xenctrl-objs += capabilities.o
+ xenctrl-objs += privcmd.o
++xenctrl-objs += xenbus.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index d1fe6ef..b0cf61b 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -59,8 +59,13 @@ static int __init xenctrl_init(void)
+ 	if (ret)
+ 		goto fail2;
+ 
++	ret = xenbus_create_proc_entry();
++	if (ret)
++		goto fail3;
++
+ 	return 0;
+ 
++ fail3: privcmd_remove_proc_entry();
+  fail2: capabilities_remove_proc_entry();
+  fail1:	remove_proc_entry("xen", NULL);
+ 	return ret;
+@@ -68,6 +73,7 @@ static int __init xenctrl_init(void)
+ 
+ static void __exit xenctrl_exit(void)
+ {
++	xenbus_remove_proc_entry();
+ 	privcmd_remove_proc_entry();
+ 	capabilities_remove_proc_entry();
+ 	remove_proc_entry("xen", NULL);
+diff --git a/drivers/xen/xenctrl/xenbus.c b/drivers/xen/xenctrl/xenbus.c
+new file mode 100644
+index 0000000..57d5501
+--- /dev/null
++++ b/drivers/xen/xenctrl/xenbus.c
+@@ -0,0 +1,398 @@
++/*
++ * xenbus.c
++ * 
++ * /proc/xen/xenbus gives user-space access to the kernel's xenbus
++ * connection to xenstore.
++ * 
++ * Copyright (c) 2005, Christian Limpach
++ * Copyright (c) 2005, Rusty Russell, IBM Corporation
++ * 
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ * 
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ * 
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ * 
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <linux/uaccess.h>
++#include <linux/poll.h>
++
++#include <xen/xenbus.h>
++
++struct xenbus_dev_transaction {
++	struct list_head list;
++	struct xenbus_transaction handle;
++};
++
++struct read_buffer {
++	struct list_head list;
++	unsigned int cons;
++	unsigned int len;
++	char msg[];
++};
++
++struct xenbus_dev_data {
++	/* In-progress transaction. */
++	struct list_head transactions;
++
++	/* Active watches. */
++	struct list_head watches;
++
++	/* Partial request. */
++	unsigned int len;
++	union {
++		struct xsd_sockmsg msg;
++		char buffer[PAGE_SIZE];
++	} u;
++
++	/* Response queue. */
++	struct list_head read_buffers;
++	wait_queue_head_t read_waitq;
++
++	struct mutex reply_mutex;
++};
++
++static ssize_t xenbus_dev_read(struct file *filp,
++			       char __user *ubuf,
++			       size_t len, loff_t *ppos)
++{
++	struct xenbus_dev_data *u = filp->private_data;
++	struct read_buffer *rb;
++	int i, ret;
++
++	mutex_lock(&u->reply_mutex);
++	while (list_empty(&u->read_buffers)) {
++		mutex_unlock(&u->reply_mutex);
++		ret = wait_event_interruptible(u->read_waitq,
++					       !list_empty(&u->read_buffers));
++		if (ret)
++			return ret;
++		mutex_lock(&u->reply_mutex);
++	}
++
++	rb = list_entry(u->read_buffers.next, struct read_buffer, list);
++	for (i = 0; i < len;) {
++		put_user(rb->msg[rb->cons], ubuf + i);
++		i++;
++		rb->cons++;
++		if (rb->cons == rb->len) {
++			list_del(&rb->list);
++			kfree(rb);
++			if (list_empty(&u->read_buffers))
++				break;
++			rb = list_entry(u->read_buffers.next,
++					struct read_buffer, list);
++		}
++	}
++	mutex_unlock(&u->reply_mutex);
++
++	return i;
++}
++
++static void queue_reply(struct xenbus_dev_data *u,
++			char *data, unsigned int len)
++{
++	struct read_buffer *rb;
++
++	if (len == 0)
++		return;
++
++	rb = kmalloc(sizeof(*rb) + len, GFP_KERNEL);
++	BUG_ON(rb == NULL);
++
++	rb->cons = 0;
++	rb->len = len;
++
++	memcpy(rb->msg, data, len);
++
++	list_add_tail(&rb->list, &u->read_buffers);
++
++	wake_up(&u->read_waitq);
++}
++
++struct watch_adapter
++{
++	struct list_head list;
++	struct xenbus_watch watch;
++	struct xenbus_dev_data *dev_data;
++	char *token;
++};
++
++static void free_watch_adapter(struct watch_adapter *watch)
++{
++	kfree(watch->watch.node);
++	kfree(watch->token);
++	kfree(watch);
++}
++
++static void watch_fired(struct xenbus_watch *watch,
++			const char **vec,
++			unsigned int len)
++{
++	struct watch_adapter *adap =
++            container_of(watch, struct watch_adapter, watch);
++	struct xsd_sockmsg hdr;
++	const char *path, *token;
++	int path_len, tok_len, body_len;
++
++	path = vec[XS_WATCH_PATH];
++	token = adap->token;
++
++	path_len = strlen(path) + 1;
++	tok_len = strlen(token) + 1;
++	body_len = path_len + tok_len;
++
++	hdr.type = XS_WATCH_EVENT;
++	hdr.len = body_len;
++
++	mutex_lock(&adap->dev_data->reply_mutex);
++	queue_reply(adap->dev_data, (char *)&hdr, sizeof(hdr));
++	queue_reply(adap->dev_data, (char *)path, path_len);
++	queue_reply(adap->dev_data, (char *)token, tok_len);
++	mutex_unlock(&adap->dev_data->reply_mutex);
++}
++
++static LIST_HEAD(watch_list);
++
++static ssize_t xenbus_dev_write(struct file *filp,
++				const char __user *ubuf,
++				size_t len, loff_t *ppos)
++{
++	struct xenbus_dev_data *u = filp->private_data;
++	struct xenbus_dev_transaction *trans = NULL;
++	uint32_t msg_type;
++	void *reply;
++	char *path, *token;
++	struct watch_adapter *watch, *tmp_watch;
++	int err, rc = len;
++
++	if ((len + u->len) > sizeof(u->u.buffer)) {
++		rc = -EINVAL;
++		goto out;
++	}
++
++	if (copy_from_user(u->u.buffer + u->len, ubuf, len) != 0) {
++		rc = -EFAULT;
++		goto out;
++	}
++
++	u->len += len;
++	if ((u->len < sizeof(u->u.msg)) ||
++	    (u->len < (sizeof(u->u.msg) + u->u.msg.len)))
++		return rc;
++
++	msg_type = u->u.msg.type;
++
++	switch (msg_type) {
++	case XS_TRANSACTION_START:
++	case XS_TRANSACTION_END:
++	case XS_DIRECTORY:
++	case XS_READ:
++	case XS_GET_PERMS:
++	case XS_RELEASE:
++	case XS_GET_DOMAIN_PATH:
++	case XS_WRITE:
++	case XS_MKDIR:
++	case XS_RM:
++	case XS_SET_PERMS:
++		if (msg_type == XS_TRANSACTION_START) {
++			trans = kmalloc(sizeof(*trans), GFP_KERNEL);
++			if (!trans) {
++				rc = -ENOMEM;
++				goto out;
++			}
++		}
++
++		reply = xenbus_dev_request_and_reply(&u->u.msg);
++		if (IS_ERR(reply)) {
++			kfree(trans);
++			rc = PTR_ERR(reply);
++			goto out;
++		}
++
++		if (msg_type == XS_TRANSACTION_START) {
++			trans->handle.id = simple_strtoul(reply, NULL, 0);
++			list_add(&trans->list, &u->transactions);
++		} else if (msg_type == XS_TRANSACTION_END) {
++			list_for_each_entry(trans, &u->transactions, list)
++				if (trans->handle.id == u->u.msg.tx_id)
++					break;
++			BUG_ON(&trans->list == &u->transactions);
++			list_del(&trans->list);
++			kfree(trans);
++		}
++		mutex_lock(&u->reply_mutex);
++		queue_reply(u, (char *)&u->u.msg, sizeof(u->u.msg));
++		queue_reply(u, (char *)reply, u->u.msg.len);
++		mutex_unlock(&u->reply_mutex);
++		kfree(reply);
++		break;
++
++	case XS_WATCH:
++	case XS_UNWATCH: {
++		static const char *XS_RESP = "OK";
++		struct xsd_sockmsg hdr;
++
++		path = u->u.buffer + sizeof(u->u.msg);
++		token = memchr(path, 0, u->u.msg.len);
++		if (token == NULL) {
++			rc = -EILSEQ;
++			goto out;
++		}
++		token++;
++
++		if (msg_type == XS_WATCH) {
++			watch = kmalloc(sizeof(*watch), GFP_KERNEL);
++			watch->watch.node = kmalloc(strlen(path)+1,
++                                                    GFP_KERNEL);
++			strcpy((char *)watch->watch.node, path);
++			watch->watch.callback = watch_fired;
++			watch->token = kmalloc(strlen(token)+1, GFP_KERNEL);
++			strcpy(watch->token, token);
++			watch->dev_data = u;
++
++			err = register_xenbus_watch(&watch->watch);
++			if (err) {
++				free_watch_adapter(watch);
++				rc = err;
++				goto out;
++			}
++			
++			list_add(&watch->list, &u->watches);
++		} else {
++			list_for_each_entry_safe(watch, tmp_watch,
++                                                 &u->watches, list) {
++				if (!strcmp(watch->token, token) &&
++				    !strcmp(watch->watch.node, path))
++				{
++					unregister_xenbus_watch(&watch->watch);
++					list_del(&watch->list);
++					free_watch_adapter(watch);
++					break;
++				}
++			}
++		}
++
++		hdr.type = msg_type;
++		hdr.len = strlen(XS_RESP) + 1;
++		mutex_lock(&u->reply_mutex);
++		queue_reply(u, (char *)&hdr, sizeof(hdr));
++		queue_reply(u, (char *)XS_RESP, hdr.len);
++		mutex_unlock(&u->reply_mutex);
++		break;
++	}
++
++	default:
++		rc = -EINVAL;
++		break;
++	}
++
++ out:
++	u->len = 0;
++	return rc;
++}
++
++static int xenbus_dev_open(struct inode *inode, struct file *filp)
++{
++	struct xenbus_dev_data *u;
++
++	if (xen_store_evtchn == 0)
++		return -ENOENT;
++
++	nonseekable_open(inode, filp);
++
++	u = kzalloc(sizeof(*u), GFP_KERNEL);
++	if (u == NULL)
++		return -ENOMEM;
++
++	INIT_LIST_HEAD(&u->transactions);
++	INIT_LIST_HEAD(&u->watches);
++	INIT_LIST_HEAD(&u->read_buffers);
++	init_waitqueue_head(&u->read_waitq);
++
++	mutex_init(&u->reply_mutex);
++
++	filp->private_data = u;
++
++	return 0;
++}
++
++static int xenbus_dev_release(struct inode *inode, struct file *filp)
++{
++	struct xenbus_dev_data *u = filp->private_data;
++	struct xenbus_dev_transaction *trans, *tmp;
++	struct watch_adapter *watch, *tmp_watch;
++
++	list_for_each_entry_safe(trans, tmp, &u->transactions, list) {
++		xenbus_transaction_end(trans->handle, 1);
++		list_del(&trans->list);
++		kfree(trans);
++	}
++
++	list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) {
++		unregister_xenbus_watch(&watch->watch);
++		list_del(&watch->list);
++		free_watch_adapter(watch);
++	}
++
++	kfree(u);
++
++	return 0;
++}
++
++static unsigned int xenbus_dev_poll(struct file *file, poll_table *wait)
++{
++	struct xenbus_dev_data *u = file->private_data;
++
++	poll_wait(file, &u->read_waitq, wait);
++	if (!list_empty(&u->read_buffers))
++		return POLLIN | POLLRDNORM;
++	return 0;
++}
++
++static const struct file_operations xenbus_dev_file_ops = {
++	.read = xenbus_dev_read,
++	.write = xenbus_dev_write,
++	.open = xenbus_dev_open,
++	.release = xenbus_dev_release,
++	.poll = xenbus_dev_poll,
++};
++
++int __init xenbus_create_proc_entry(void)
++{
++	struct proc_dir_entry *entry;
++
++	entry = create_proc_entry("xen/xenbus", 0400, NULL);
++	if (!entry)
++		return -ENOMEM;
++
++	entry->owner = THIS_MODULE;
++	entry->proc_fops = &xenbus_dev_file_ops;
++
++	return 0;
++}
++
++void __exit xenbus_remove_proc_entry(void)
++{
++	remove_proc_entry("xen/xenbus", NULL);
++}
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+index a35209a..e585c4b 100644
+--- a/drivers/xen/xenctrl/xenctrl.h
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -43,3 +43,9 @@ void capabilities_remove_proc_entry(void) __exit;
+  */
+ int privcmd_create_proc_entry(void) __init;
+ void privcmd_remove_proc_entry(void) __exit;
++
++/*
++ * xenbus.c
++ */
++int xenbus_create_proc_entry(void) __init;
++void xenbus_remove_proc_entry(void) __exit;
+diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
+index 6369d89..a3fef9d 100644
+--- a/include/xen/xenbus.h
++++ b/include/xen/xenbus.h
+@@ -232,4 +232,6 @@ const char *xenbus_strstate(enum xenbus_state state);
+ int xenbus_dev_is_online(struct xenbus_device *dev);
+ int xenbus_frontend_closed(struct xenbus_device *dev);
+ 
++extern int xen_store_evtchn;
++
+ #endif /* _XEN_XENBUS_H */
+-- 
+1.5.4.1
+

linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch:

Index: linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
===================================================================
RCS file: linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
diff -N linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch	4 Apr 2008 17:23:58 -0000	1.4
@@ -0,0 +1,479 @@
+From fe4957b328e58d8f4fa9225f9b40301c5bea24e3 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Thu, 7 Feb 2008 15:32:28 +0000
+Subject: [PATCH] xen: Add Xen's /sys/hypervisor interface
+
+Hook up Xen's /sys/hypervisor interface:
+
+  /sys/hypervisor/
+    -> type
+    -> uuid
+    -> compilation
+         -> compile_date
+         -> compiled_by
+         -> compiler
+    -> properties
+         -> capabilities
+         -> changeset
+         -> pagesize
+         -> virtual_start
+         -> writable_pt
+    -> version
+         -> extra
+         -> major
+         -> minor
+
+Note: the hypervisor subsys hook requires that
+SYS_HYPERVISOR is selected to enabled it, which in
+turns means that the subsys will be registered by
+a pv-ops kernel with Xen support, even on bare
+metal. This hook needs to be changed to be runtime
+enabled.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ arch/x86/xen/Kconfig            |    3 +-
+ drivers/xen/xenctrl/Makefile    |    1 +
+ drivers/xen/xenctrl/main.c      |    6 +
+ drivers/xen/xenctrl/sysfs.c     |  349 +++++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/xenctrl.h   |    6 +
+ include/xen/interface/version.h |    6 +
+ 6 files changed, 370 insertions(+), 1 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/sysfs.c
+
+diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
+index 4723bc1..ff6a56a 100644
+--- a/arch/x86/xen/Kconfig
++++ b/arch/x86/xen/Kconfig
+@@ -14,7 +14,8 @@ config XEN
+ 
+ config XENCTRL
+ 	tristate "Xen's user space control interfaces"
+-	depends on XEN && PROC_FS
++	depends on XEN && PROC_FS && SYSFS
+ 	default y if XEN
++	select SYS_HYPERVISOR
+ 	help
+ 	  This is the /proc/xen interface used by Xen's libxc.
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 23dafa3..e126e76 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -5,3 +5,4 @@ xenctrl-objs += main.o
+ xenctrl-objs += capabilities.o
+ xenctrl-objs += privcmd.o
+ xenctrl-objs += xenbus.o
++xenctrl-objs += sysfs.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index b0cf61b..87d0dba 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -63,8 +63,13 @@ static int __init xenctrl_init(void)
+ 	if (ret)
+ 		goto fail3;
+ 
++	ret = sys_hypervisor_init();
++	if (ret)
++		goto fail4;
++
+ 	return 0;
+ 
++ fail4: xenbus_remove_proc_entry();
+  fail3: privcmd_remove_proc_entry();
+  fail2: capabilities_remove_proc_entry();
+  fail1:	remove_proc_entry("xen", NULL);
+@@ -73,6 +78,7 @@ static int __init xenctrl_init(void)
+ 
+ static void __exit xenctrl_exit(void)
+ {
++	sys_hypervisor_exit();
+ 	xenbus_remove_proc_entry();
+ 	privcmd_remove_proc_entry();
+ 	capabilities_remove_proc_entry();
+diff --git a/drivers/xen/xenctrl/sysfs.c b/drivers/xen/xenctrl/sysfs.c
+new file mode 100644
+index 0000000..8cbf4d6
+--- /dev/null
++++ b/drivers/xen/xenctrl/sysfs.c
+@@ -0,0 +1,349 @@
++/*
++ *  copyright (c) 2006 IBM Corporation
++ *  Authored by: Mike D. Day <ncmike at us.ibm.com>
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License version 2 as
++ *  published by the Free Software Foundation.
++ */
++
++#include <linux/kobject.h>
++#include <linux/sysfs.h>
++#include <linux/err.h>
++#include <asm/xen/hypervisor.h>
++#include <xen/xenbus.h>
++#include "xenctrl.h"
++
++#define HYPERVISOR_ATTR_RO(_name) \
++static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
++
++#define HYPERVISOR_ATTR_RW(_name) \
++static struct kobj_attribute _name##_attr = \
++	__ATTR(_name, 0644, _name##_show, _name##_store)
++
++static ssize_t type_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	return sprintf(buffer, "xen\n");
++}
++
++HYPERVISOR_ATTR_RO(type);
++
++static int __init xen_sysfs_type_init(void)
++{
++	return sysfs_create_file(hypervisor_kobj, &type_attr.attr);
++}
++
++static void xen_sysfs_type_destroy(void)
++{
++	sysfs_remove_file(hypervisor_kobj, &type_attr.attr);
++}
++
++static ssize_t major_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	int version;
++
++	version = HYPERVISOR_xen_version(XENVER_version, NULL);
++	if (!version)
++		return -ENODEV;
++
++	return sprintf(buffer, "%d\n", version >> 16);
++}
++
++HYPERVISOR_ATTR_RO(major);
++
++static ssize_t minor_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	int version;
++
++	version = HYPERVISOR_xen_version(XENVER_version, NULL);
++	if (!version)
++		return -ENODEV;
++
++	return sprintf(buffer, "%d\n", version & 0xff);
++}
++
++HYPERVISOR_ATTR_RO(minor);
++
++static ssize_t extra_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	int ret;
++	struct xen_extraversion extra;
++
++	ret = HYPERVISOR_xen_version(XENVER_extraversion, &extra);
++	if (ret)
++		return ret;
++
++	return sprintf(buffer, "%s\n", extra.extraversion);
++}
++
++HYPERVISOR_ATTR_RO(extra);
++
++static struct attribute *version_attrs[] = {
++	&major_attr.attr,
++	&minor_attr.attr,
++	&extra_attr.attr,
++	NULL
++};
++
++static struct attribute_group version_group = {
++	.name = "version",
++	.attrs = version_attrs,
++};
++
++static int __init xen_sysfs_version_init(void)
++{
++	return sysfs_create_group(hypervisor_kobj, &version_group);
++}
++
++static void xen_sysfs_version_destroy(void)
++{
++	sysfs_remove_group(hypervisor_kobj, &version_group);
++}
++
++static ssize_t uuid_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	char *vm, *val;
++	int ret;
++
++	vm = xenbus_read(XBT_NIL, "vm", "", NULL);
++	if (IS_ERR(vm))
++		return PTR_ERR(vm);
++
++	val = xenbus_read(XBT_NIL, vm, "uuid", NULL);
++	if (IS_ERR(val)) {
++		ret = PTR_ERR(val);
++		goto out;
++	}
++
++	ret = sprintf(buffer, "%s\n", val);
++
++	kfree(val);
++out:	kfree(vm);
++
++	return ret;
++}
++
++HYPERVISOR_ATTR_RO(uuid);
++
++static int __init xen_sysfs_uuid_init(void)
++{
++	return sysfs_create_file(hypervisor_kobj, &uuid_attr.attr);
++}
++
++static void xen_sysfs_uuid_destroy(void)
++{
++	sysfs_remove_file(hypervisor_kobj, &uuid_attr.attr);
++}
++
++static ssize_t compiler_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	struct xen_compile_info info;
++	int ret;
++
++	ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
++	if (ret)
++		return ret;
++
++	return sprintf(buffer, "%s\n", info.compiler);
++}
++
++HYPERVISOR_ATTR_RO(compiler);
++
++static ssize_t compiled_by_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	struct xen_compile_info info;
++	int ret;
++
++	ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
++	if (ret)
++		return ret;
++
++	return sprintf(buffer, "%s\n", info.compile_by);
++}
++
++HYPERVISOR_ATTR_RO(compiled_by);
++
++static ssize_t compile_date_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	struct xen_compile_info info;
++	int ret;
++
++	ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
++	if (ret)
++		return ret;
++
++	return sprintf(buffer, "%s\n", info.compile_date);
++}
++
++HYPERVISOR_ATTR_RO(compile_date);
++
++static struct attribute *xen_compile_attrs[] = {
++	&compiler_attr.attr,
++	&compiled_by_attr.attr,
++	&compile_date_attr.attr,
++	NULL
++};
++
++static struct attribute_group xen_compilation_group = {
++	.name = "compilation",
++	.attrs = xen_compile_attrs,
++};
++
++static int __init xen_compilation_init(void)
++{
++	return sysfs_create_group(hypervisor_kobj,
++				  &xen_compilation_group);
++}
++
++static void xen_compilation_destroy(void)
++{
++	sysfs_remove_group(hypervisor_kobj,
++			   &xen_compilation_group);
++}
++
++static ssize_t capabilities_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	struct xen_capabilities_info *caps;
++	int ret;
++
++	caps = kmalloc(sizeof(struct xen_capabilities_info), GFP_KERNEL);
++	if (!caps)
++		return -ENOMEM;
++
++	ret = HYPERVISOR_xen_version(XENVER_capabilities, caps);
++	if (ret)
++		goto out;
++
++	ret = sprintf(buffer, "%s\n", caps->info);
++
++out:	kfree(caps);
++
++	return ret;
++}
++
++HYPERVISOR_ATTR_RO(capabilities);
++
++static ssize_t changeset_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	struct xen_changeset_info cset;
++	int ret;
++
++	ret = HYPERVISOR_xen_version(XENVER_changeset, &cset);
++	if (ret)
++		return ret;
++
++	return sprintf(buffer, "%s\n", cset.info);
++}
++
++HYPERVISOR_ATTR_RO(changeset);
++
++static ssize_t virtual_start_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	struct xen_platform_parameters parms;
++	int ret;
++
++	ret = HYPERVISOR_xen_version(XENVER_platform_parameters, &parms);
++	if (ret)
++		return ret;
++
++	return sprintf(buffer, "%lx\n", parms.virt_start);
++}
++
++HYPERVISOR_ATTR_RO(virtual_start);
++
++static ssize_t pagesize_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	int ret;
++
++	ret = HYPERVISOR_xen_version(XENVER_pagesize, NULL);
++	if (ret < 0)
++		return ret;
++
++	return sprintf(buffer, "%x\n", ret);
++}
++
++HYPERVISOR_ATTR_RO(pagesize);
++
++static ssize_t writable_pt_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++	struct xen_feature_info info;
++	int ret;
++
++	info.submap_idx = XENFEAT_writable_page_tables;
++
++	ret = HYPERVISOR_xen_version(XENVER_get_features, &info);
++	if (ret)
++		return ret;
++
++	return sprintf(buffer, "%d\n", info.submap);
++}
++
++HYPERVISOR_ATTR_RO(writable_pt);
++
++static struct attribute *xen_properties_attrs[] = {
++	&capabilities_attr.attr,
++	&changeset_attr.attr,
++	&virtual_start_attr.attr,
++	&pagesize_attr.attr,
++	&writable_pt_attr.attr,
++	NULL
++};
++
++static struct attribute_group xen_properties_group = {
++	.name = "properties",
++	.attrs = xen_properties_attrs,
++};
++
++static int __init xen_properties_init(void)
++{
++	return sysfs_create_group(hypervisor_kobj,
++				  &xen_properties_group);
++}
++
++static void xen_properties_destroy(void)
++{
++	sysfs_remove_group(hypervisor_kobj, &xen_properties_group);
++}
++
++int __init sys_hypervisor_init(void)
++{
++	int ret;
++
++	if (!is_running_on_xen())
++		return -ENODEV;
++
++	ret = xen_sysfs_type_init();
++	if (ret)
++		goto out;
++	ret = xen_sysfs_version_init();
++	if (ret)
++		goto version_out;
++	ret = xen_compilation_init();
++	if (ret)
++		goto comp_out;
++	ret = xen_sysfs_uuid_init();
++	if (ret)
++		goto uuid_out;
++	ret = xen_properties_init();
++	if (!ret)
++		goto out;
++
++	xen_sysfs_uuid_destroy();
++uuid_out:
++	xen_compilation_destroy();
++comp_out:
++	xen_sysfs_version_destroy();
++version_out:
++	xen_sysfs_type_destroy();
++out:
++	return ret;
++}
++
++void __exit sys_hypervisor_exit(void)
++{
++	xen_properties_destroy();
++	xen_compilation_destroy();
++	xen_sysfs_uuid_destroy();
++	xen_sysfs_version_destroy();
++	xen_sysfs_type_destroy();
++}
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+index e585c4b..1afbdfb 100644
+--- a/drivers/xen/xenctrl/xenctrl.h
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -49,3 +49,9 @@ void privcmd_remove_proc_entry(void) __exit;
+  */
+ int xenbus_create_proc_entry(void) __init;
+ void xenbus_remove_proc_entry(void) __exit;
++
++/*
++ * sysfs.c
++ */
++int sys_hypervisor_init(void) __init;
++void sys_hypervisor_exit(void) __exit;
+diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
+index 453235e..dd58cf5 100644
+--- a/include/xen/interface/version.h
++++ b/include/xen/interface/version.h
+@@ -57,4 +57,10 @@ struct xen_feature_info {
+ /* Declares the features reported by XENVER_get_features. */
+ #include "features.h"
+ 
++/* arg == NULL; returns host memory page size. */
++#define XENVER_pagesize 7
++
++/* arg == xen_domain_handle_t. */
++#define XENVER_guest_handle 8
++
+ #endif /* __XEN_PUBLIC_VERSION_H__ */
+-- 
+1.5.4.1
+

linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch:

Index: linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
===================================================================
RCS file: linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
diff -N linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch	4 Apr 2008 17:23:58 -0000	1.4
@@ -0,0 +1,79 @@
+From 938b34adc813ba3f8e3573fa5e7e959ab18cd8e7 Mon Sep 17 00:00:00 2001
+From: Stephen Tweedie <sct at redhat.com>
+Date: Wed, 21 Nov 2007 18:40:31 +0000
+Subject: [PATCH] xen debug: Add xprintk to log directly via hypercall
+
+For early debugging, it is useful to have a way of doing debugging output
+direct to the hypervisor without having to rely on console being fully
+initialised.
+
+Signed-off-by: Stephen Tweedie <sct at redhat.com>
+---
+ arch/x86/xen/enlighten.c  |   32 ++++++++++++++++++++++++++++++++
+ include/xen/hvc-console.h |    1 +
+ 2 files changed, 33 insertions(+), 0 deletions(-)
+
+diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
+index 8a05a6d..f7a4227 100644
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
+@@ -33,6 +33,7 @@
+ #include <xen/interface/sched.h>
+ #include <xen/features.h>
+ #include <xen/page.h>
++#include <xen/hvc-console.h>
+ 
+ #include <asm/paravirt.h>
+ #include <asm/page.h>
+@@ -143,6 +144,37 @@ static void __init xen_banner(void)
+ 	printk(KERN_INFO "Hypervisor signature: %s\n", xen_start_info->magic);
+ }
+ 
++static void kcons_write_dom0(const char *s, unsigned int count)
++{
++       int rc;
++
++       while ((count > 0) &&
++              ((rc = HYPERVISOR_console_io(
++                       CONSOLEIO_write, count, (char *)s)) > 0)) {
++               count -= rc;
++               s += rc;
++       }
++}
++
++
++/*** Useful function for console debugging -- goes straight to Xen. ***/
++asmlinkage int xprintk(const char *fmt, ...)
++{
++       va_list args;
++       int printk_len;
++       static char printk_buf[1024];
++
++       /* Emit the output into the temporary buffer */
++       va_start(args, fmt);
++       printk_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
++       va_end(args);
++
++       /* Send the processed output directly to Xen. */
++       kcons_write_dom0(printk_buf, printk_len);
++
++       return 0;
++}
++
+ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
+ 		      unsigned int *cx, unsigned int *dx)
+ {
+diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
+index 21c0ecf..cb7a3c9 100644
+--- a/include/xen/hvc-console.h
++++ b/include/xen/hvc-console.h
+@@ -2,5 +2,6 @@
+ #define XEN_HVC_CONSOLE_H
+ 
+ extern struct console xenboot_console;
++extern asmlinkage int xprintk(const char *fmt, ...);
+ 
+ #endif	/* XEN_HVC_CONSOLE_H */
+-- 
+1.5.4.1
+

linux-2.6-xen-0018-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch:

--- NEW FILE linux-2.6-xen-0018-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch ---
>From 549791e9974ccad90581b2aa2bbb45c7f874d7e5 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Thu, 6 Mar 2008 11:10:59 +0000
Subject: [PATCH] xen x86_64: Add 64 bit version of privcmd_hypercall()

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 include/asm-x86/xen/hypercall.h |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index cd554ca..b0c518c 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -412,6 +412,7 @@ MULTI_stack_switch(struct multicall_entry *mcl,
 
 #include <xen/sys/privcmd.h>
 
+#ifdef CONFIG_X86_32
 static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
 {
 	int ret;
@@ -437,5 +438,32 @@ static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
 
 	return ret;
 }
+#else /* CONFIG_X86_32 */
+static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
+{
+	int ret;
+        long ign1, ign2, ign3;
+
+	if (hypercall->op >= (PAGE_SIZE >> 5))
+		return -EINVAL;
+
+        __asm__ __volatile__ (
+		"movq %8,%%r10; movq %9,%%r8;"
+                "shll $5,%%eax ;"
+                "addq $hypercall_page,%%rax ;"
+                "call *%%rax"
+                : "=a" (ret), "=D" (ign1),
+                  "=S" (ign2), "=d" (ign3)
+                : "0" ((unsigned int)hypercall->op),
+                  "1" (hypercall->arg[0]),
+                  "2" (hypercall->arg[1]),
+                  "3" (hypercall->arg[2]),
+                  "g" (hypercall->arg[3]),
+                  "g" (hypercall->arg[4])
+                : "r8", "r10", "memory" );
+
+	return ret;
+}
+#endif /* CONFIG_X86_32 */
 
 #endif /* __HYPERCALL_H__ */
-- 
1.5.4.1


linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch:

--- NEW FILE linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch ---
>From dad8771bd858184b6bd8a512060f68e8b24b4e41 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Tue, 25 Mar 2008 11:56:43 +0000
Subject: [PATCH] xen x86_64: Only define load_user_cs_desc() on 32 bit

load_user_cs_desc() is only used on 32 bit, so only
define it in that case.

Fixes compile failure in native_load_user_cs_desc()
since mm_context_t->user_cs is only available on
32 bit.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/kernel/paravirt.c |    2 ++
 arch/x86/xen/enlighten.c   |    4 ++++
 include/asm-x86/desc.h     |    4 ++++
 include/asm-x86/paravirt.h |    4 ++++
 4 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index d59db07..c845947 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -331,7 +331,9 @@ struct pv_cpu_ops pv_cpu_ops = {
 	.read_tscp = native_read_tscp,
 	.load_tr_desc = native_load_tr_desc,
 	.set_ldt = native_set_ldt,
+#ifdef CONFIG_X86_32
 	.load_user_cs_desc = native_load_user_cs_desc,
+#endif
 	.load_gdt = native_load_gdt,
 	.load_idt = native_load_idt,
 	.store_gdt = native_store_gdt,
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index f7a4227..1e4df8a 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -323,6 +323,7 @@ static void xen_set_ldt(const void *addr, unsigned entries)
 	xen_mc_issue(PARAVIRT_LAZY_CPU);
 }
 
+#ifdef CONFIG_X86_32
 static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
 {
 	void *gdt;
@@ -338,6 +339,7 @@ static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
 
 	HYPERVISOR_update_descriptor(mgdt.maddr, descriptor);
 }
+#endif
 
 static void xen_load_gdt(const struct desc_ptr *dtr)
 {
@@ -1047,7 +1049,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
 
 	.load_tr_desc = paravirt_nop,
 	.set_ldt = xen_set_ldt,
+#ifdef CONFIG_X86_32
 	.load_user_cs_desc = xen_load_user_cs_desc,
+#endif
 	.load_gdt = xen_load_gdt,
 	.load_idt = xen_load_idt,
 	.load_tls = xen_load_tls,
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index ec3a84a..9b280be 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -95,7 +95,9 @@ static inline int desc_empty(const void *ptr)
 
 #define load_TLS(t, cpu) native_load_tls(t, cpu)
 #define set_ldt native_set_ldt
+#ifdef CONFIG_X86_32
 #define load_user_cs_desc native_load_user_cs_desc
+#endif
 
 #define write_ldt_entry(dt, entry, desc) \
 				native_write_ldt_entry(dt, entry, desc)
@@ -362,10 +364,12 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
 	desc->b = (limit & 0xf0000) | 0x00c0fb00;
 }
 
+#ifdef CONFIG_X86_32
 static inline void native_load_user_cs_desc(int cpu, struct mm_struct *mm)
 {
 	get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = mm->context.user_cs;
 }
+#endif
 
 #ifdef CONFIG_X86_32
 extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index ff8d218..7d7070a 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -113,7 +113,9 @@ struct pv_cpu_ops {
 	void (*store_gdt)(struct desc_ptr *);
 	void (*store_idt)(struct desc_ptr *);
 	void (*set_ldt)(const void *desc, unsigned entries);
+#ifdef CONFIG_X86_32
 	void (*load_user_cs_desc)(int cpu, struct mm_struct *mm);
+#endif
 	unsigned long (*store_tr)(void);
 	void (*load_tls)(struct thread_struct *t, unsigned int cpu);
 	void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum,
@@ -755,11 +757,13 @@ static inline void set_ldt(const void *addr, unsigned entries)
 {
 	PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
 }
+#ifdef CONFIG_X86_32
 static inline void load_user_cs_desc(unsigned int cpu, 
 				     struct mm_struct *mm)
 {
 	PVOP_VCALL2(pv_cpu_ops.load_user_cs_desc, cpu, mm);
 }
+#endif
 static inline void store_gdt(struct desc_ptr *dtr)
 {
 	PVOP_VCALL1(pv_cpu_ops.store_gdt, dtr);
-- 
1.5.4.1


linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch:

--- NEW FILE linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch ---
>From 0fd8f984f8bfaca42bcd5958f835d01c4d59e80a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 2 Apr 2008 18:17:24 +0100
Subject: [PATCH] xen x86_64: Initial x86_64 support for Xen paravirt_ops

Taken from the xen-pvops-64-2.6.25-rc8-markmc1 tag.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/Kconfig                 |    3 +-
 arch/x86/kernel/asm-offsets_64.c |   15 +
 arch/x86/kernel/early_printk.c   |    5 +-
 arch/x86/kernel/entry_32.S       |   83 +------
 arch/x86/kernel/entry_64.S       |   72 +++++-
 arch/x86/kernel/genapic_64.c     |   12 +
 arch/x86/kernel/head64.c         |    4 +
 arch/x86/kernel/head_64.S        |   23 ++
 arch/x86/kernel/irq_64.c         |    5 +
 arch/x86/kernel/paravirt.c       |    5 +
 arch/x86/kernel/process_64.c     |    9 +
 arch/x86/kernel/setup64.c        |    5 +
 arch/x86/kernel/setup_64.c       |   41 +++-
 arch/x86/kernel/smpboot_64.c     |    4 +-
 arch/x86/kernel/vsyscall_64.c    |   29 ++-
 arch/x86/mm/init_64.c            |  568 ++++++++++++++++++++++++++++++++++++--
 arch/x86/mm/pgtable_32.c         |   15 +-
 arch/x86/vdso/vdso32-setup.c     |    4 +
 arch/x86/xen/Kconfig             |    1 -
 arch/x86/xen/Makefile            |    6 +
 arch/x86/xen/enlighten.c         |  309 +++++++++++++++------
 arch/x86/xen/entry.S             |    5 +
 arch/x86/xen/entry_32.S          |   81 ++++++
 arch/x86/xen/entry_64.S          |   68 +++++
 arch/x86/xen/events.c            |   13 +-
 arch/x86/xen/genapic.c           |  190 +++++++++++++
 arch/x86/xen/init.h              |   20 ++
 arch/x86/xen/init_32.c           |    3 +
 arch/x86/xen/init_64.c           |  181 ++++++++++++
 arch/x86/xen/mmu.c               |  447 ++++++++++++++++++++----------
 arch/x86/xen/mmu.h               |   47 ++--
 arch/x86/xen/multicalls.c        |    9 +-
 arch/x86/xen/setup.c             |   22 ++
 arch/x86/xen/smp.c               |   16 +
 arch/x86/xen/xen-asm.S           |  224 +++------------
 arch/x86/xen/xen-asm_32.S        |  184 ++++++++++++
 arch/x86/xen/xen-asm_64.S        |   75 +++++
 arch/x86/xen/xen-head.S          |   21 ++-
 arch/x86/xen/xen-ops.h           |   11 +
 drivers/acpi/thermal.c           |    5 +
 drivers/char/hvc_xen.c           |    6 +
 include/asm-x86/asm-hack.h       |   27 ++
 include/asm-x86/cmpxchg_64.h     |   36 +++
 include/asm-x86/desc_defs.h      |    4 +
 include/asm-x86/fixmap_32.h      |   16 +-
 include/asm-x86/fixmap_64.h      |   28 ++-
 include/asm-x86/mmu_context_64.h |    6 +-
 include/asm-x86/page_64.h        |    2 +-
 include/asm-x86/paravirt.h       |   59 ++++-
 include/asm-x86/percpu.h         |   32 +++
 include/asm-x86/pgalloc_64.h     |   69 ++++-
 include/asm-x86/pgtable.h        |   15 +-
 include/asm-x86/pgtable_32.h     |    3 +
 include/asm-x86/pgtable_64.h     |    7 +-
 include/asm-x86/proto.h          |    1 +
 include/asm-x86/smp_64.h         |    3 +
 include/asm-x86/system.h         |    3 +-
 include/asm-x86/xen/hypercall.h  |  205 +++++++++++---
 include/asm-x86/xen/hypervisor.h |    3 -
 include/asm-x86/xen/interface.h  |   35 ++-
 include/linux/dmi.h              |    1 +
 include/linux/elfnote.h          |    2 +-
 include/xen/events.h             |    2 +
 include/xen/interface/elfnote.h  |   16 +
 include/xen/page.h               |   34 ++-
 init/main.c                      |   10 +
 mm/slab.c                        |    8 +-
 67 files changed, 2796 insertions(+), 677 deletions(-)
 create mode 100644 arch/x86/xen/entry.S
 create mode 100644 arch/x86/xen/entry_32.S
 create mode 100644 arch/x86/xen/entry_64.S
 create mode 100644 arch/x86/xen/genapic.c
 create mode 100644 arch/x86/xen/init.h
 create mode 100644 arch/x86/xen/init_32.c
 create mode 100644 arch/x86/xen/init_64.c
 create mode 100644 arch/x86/xen/xen-asm_32.S
 create mode 100644 arch/x86/xen/xen-asm_64.S
 create mode 100644 include/asm-x86/asm-hack.h

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6c70fed..f18418d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -89,7 +89,7 @@ config ARCH_MAY_HAVE_PC_FDC
 	def_bool y
 
 config DMI
-	def_bool y
+	def_bool !XEN
 
 config RWSEM_GENERIC_SPINLOCK
 	def_bool !X86_XADD
@@ -327,6 +327,7 @@ config X86_RDC321X
 
 config X86_VSMP
 	bool "Support for ScaleMP vSMP"
+	depends on !XEN
 	depends on X86_64 && PCI
 	 help
 	  Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 494e1e0..d0fabfd 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -25,6 +25,8 @@
 #define OFFSET(sym, str, mem) \
 	DEFINE(sym, offsetof(struct str, mem))
 
+#include <xen/interface/xen.h>
+
 #define __NO_STUBS 1
 #undef __SYSCALL
 #undef _ASM_X86_64_UNISTD_H_
@@ -92,6 +94,13 @@ int main(void)
 	       offsetof (struct rt_sigframe32, uc.uc_mcontext));
 	BLANK();
 #endif
+
+#ifdef CONFIG_XEN
+	BLANK();
+	OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
+	OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
+#endif
+
 	DEFINE(pbe_address, offsetof(struct pbe, address));
 	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
 	DEFINE(pbe_next, offsetof(struct pbe, next));
@@ -130,6 +139,12 @@ int main(void)
 	BLANK();
 	DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
 
+	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+	DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
+	DEFINE(PTRS_PER_PTE, PTRS_PER_PTE);
+	DEFINE(PTRS_PER_PMD, PTRS_PER_PMD);
+	DEFINE(PTRS_PER_PGD, PTRS_PER_PGD);
+
 	BLANK();
 	OFFSET(BP_scratch, boot_params, scratch);
 	OFFSET(BP_loadflags, boot_params, hdr.loadflags);
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index cff84cd..4c70cc4 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -193,7 +193,7 @@ static struct console simnow_console = {
 };
 
 /* Direct interface for emergencies */
-static struct console *early_console = &early_vga_console;
+static struct console *early_console;
 static int early_console_initialized = 0;
 
 void early_printk(const char *fmt, ...)
@@ -204,7 +204,8 @@ void early_printk(const char *fmt, ...)
 
 	va_start(ap,fmt);
 	n = vscnprintf(buf,512,fmt,ap);
-	early_console->write(early_console,buf,n);
+	if (likely(early_console))
+		early_console->write(early_console,buf,n);
 	va_end(ap);
 }
 
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 4b87c32..4ef3881 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -1023,88 +1023,7 @@ ENTRY(kernel_thread_helper)
 ENDPROC(kernel_thread_helper)
 
 #ifdef CONFIG_XEN
-ENTRY(xen_hypervisor_callback)
-	CFI_STARTPROC
-	pushl $0
-	CFI_ADJUST_CFA_OFFSET 4
-	SAVE_ALL
-	TRACE_IRQS_OFF
-
-	/* Check to see if we got the event in the critical
-	   region in xen_iret_direct, after we've reenabled
-	   events and checked for pending events.  This simulates
-	   iret instruction's behaviour where it delivers a
-	   pending interrupt when enabling interrupts. */
-	movl PT_EIP(%esp),%eax
-	cmpl $xen_iret_start_crit,%eax
-	jb   1f
-	cmpl $xen_iret_end_crit,%eax
-	jae  1f
-
[...5417 lines suppressed...]
-#define ELFNOTE(name, type, desc)		\
+#define ELFNOTE(name, type, desc...)		\
 	ELFNOTE_START(name, type, "")		\
 		desc			;	\
 	ELFNOTE_END
diff --git a/include/xen/events.h b/include/xen/events.h
index 2bde54d..c18d2bf 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -3,6 +3,8 @@
 
 #include <linux/interrupt.h>
 
+#include <asm/xen/interface.h>
+#include <xen/interface/xen.h>
 #include <xen/interface/event_channel.h>
 #include <asm/xen/hypercall.h>
 
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
index a64d3df..ee5501d 100644
--- a/include/xen/interface/elfnote.h
+++ b/include/xen/interface/elfnote.h
@@ -120,6 +120,22 @@
  */
 #define XEN_ELFNOTE_BSD_SYMTAB    11
 
+/*
+ * The lowest address the hypervisor hole can begin at (numeric).
+ *
+ * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
+ * also indicates to the hypervisor that the kernel can deal with the
+ * hole starting at a higher address.
+ */
+#define XEN_ELFNOTE_HV_START_LOW  12
+
+/*
+ * List of maddr_t-sized mask/value pairs describing how to recognize
+ * (non-present) L1 page table entries carrying valid MFNs (numeric).
+ */
+#define XEN_ELFNOTE_L1_MFN_VALID  13
+
+
 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
 
 /*
diff --git a/include/xen/page.h b/include/xen/page.h
index 031ef22..158fb60 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -8,6 +8,10 @@
 
 #include <xen/features.h>
 
+#include <asm/xen/interface.h>
+
+#include <xen/hvc-console.h>
+
 #ifdef CONFIG_X86_PAE
 /* Xen machine address */
 typedef struct xmaddr {
@@ -70,6 +74,8 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
 #endif
 
 	pfn = 0;
+	//xprintk("mfn_to_pfn(%lx):\n", mfn);
+
 	/*
 	 * The array access can fail (e.g., device space beyond end of RAM).
 	 * In such cases it doesn't matter what we return (we return garbage),
@@ -77,6 +83,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
 	 */
 	__get_user(pfn, &machine_to_phys_mapping[mfn]);
 
+	//xprintk("mfn_to_pfn(%lx) = %lx\n", mfn, pfn);
 	return pfn;
 }
 
@@ -143,34 +150,29 @@ static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 
 static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot)
 {
-	pte_t pte;
-
-	pte.pte_high = (page_nr >> (32 - PAGE_SHIFT)) |
-		(pgprot_val(pgprot) >> 32);
-	pte.pte_high &= (__supported_pte_mask >> 32);
-	pte.pte_low = ((page_nr << PAGE_SHIFT) | pgprot_val(pgprot));
-	pte.pte_low &= __supported_pte_mask;
-
-	return pte;
+	pteval_t val;
+	
+	val = (page_nr << PAGE_SHIFT) | pgprot_val(pgprot);
+	val &= __supported_pte_mask;
+	return native_make_pte(val);
 }
 
-static inline unsigned long long pte_val_ma(pte_t x)
+static inline pteval_t pte_val_ma(pte_t x)
 {
-	return x.pte;
+	return native_pte_val(x);
 }
-#define pmd_val_ma(v) ((v).pmd)
-#define pud_val_ma(v) ((v).pgd.pgd)
-#define __pte_ma(x)	((pte_t) { .pte = (x) })
+#define __pte_ma(x)	(native_make_pte(x))
 #define __pmd_ma(x)	((pmd_t) { (x) } )
 #else  /* !X86_PAE */
-#define pte_mfn(_pte) ((_pte).pte_low >> PAGE_SHIFT)
+#define pte_mfn(_pte) ((native_pte_val(_pte) & __PHYSICAL_MASK) >> PAGE_SHIFT)
 #define mfn_pte(pfn, prot)	__pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 #define pte_val_ma(x)	((x).pte)
-#define pmd_val_ma(v)	((v).pud.pgd.pgd)
 #define __pte_ma(x)	((pte_t) { (x) } )
 #endif	/* CONFIG_X86_PAE */
 
 #define pgd_val_ma(x)	((x).pgd)
+#define pmd_val_ma(x)	(native_pmd_val((x)))
+#define pud_val_ma(x)	(native_pud_val((x)))
 
 
 xmaddr_t arbitrary_virt_to_machine(unsigned long address);
diff --git a/init/main.c b/init/main.c
index 530b36f..9341b4c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -584,17 +584,25 @@ asmlinkage void __init start_kernel(void)
 	rcu_init();
 	init_IRQ();
 	pidhash_init();
+	printk("init_timers:\n");
 	init_timers();
 	hrtimers_init();
 	softirq_init();
+	printk("timekeeping:\n");
 	timekeeping_init();
+	printk("time:\n");
 	time_init();
+	printk("profile:\n");
 	profile_init();
+	printk("irqs_disabled:\n");
 	if (!irqs_disabled())
 		printk("start_kernel(): bug: interrupts were enabled early\n");
+	printk("early_boot_irqs_on:\n");
 	early_boot_irqs_on();
+	printk("local_irq_enable:\n");
 	local_irq_enable();
 
+	printk("console_init:\n");
 	/*
 	 * HACK ALERT! This is early. We're enabling the console before
 	 * we've done PCI setups etc, and console_init() must be aware of
@@ -631,7 +639,9 @@ asmlinkage void __init start_kernel(void)
 	numa_policy_init();
 	if (late_time_init)
 		late_time_init();
+	printk("calibrate_delay:\n");
 	calibrate_delay();
+	printk("pidmap_init:\n");
 	pidmap_init();
 	pgtable_cache_init();
 	prio_tree_init();
diff --git a/mm/slab.c b/mm/slab.c
index ed27eb8..d434cc3 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3201,6 +3201,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 		STATS_INC_ALLOCHIT(cachep);
 		ac->touched = 1;
 		objp = ac->entry[--ac->avail];
+		if (!objp)
+			printk("really weird: avail objp for cache %s is null\n", cachep->name);
 	} else {
 		STATS_INC_ALLOCMISS(cachep);
 		objp = cache_alloc_refill(cachep, flags);
@@ -3463,8 +3465,10 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
 	unsigned long save_flags;
 	void *objp;
 
-	if (should_failslab(cachep, flags))
+	if (should_failslab(cachep, flags)) {
+		printk("cache %s should fail\n", cachep->name);
 		return NULL;
+	}
 
 	cache_alloc_debugcheck_before(cachep, flags);
 	local_irq_save(save_flags);
@@ -3476,6 +3480,8 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
 	if (unlikely((flags & __GFP_ZERO) && objp))
 		memset(objp, 0, obj_size(cachep));
 
+	if (!objp)
+		printk("allocation from cache %s failed!!!\n", cachep->name);
 	return objp;
 }
 
-- 
1.5.4.1







Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel.spec,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- kernel.spec	3 Apr 2008 23:00:45 -0000	1.29
+++ kernel.spec	4 Apr 2008 17:23:58 -0000	1.30
@@ -674,20 +674,20 @@
 Patch5003: linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch
 Patch5004: linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
 Patch5005: linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
-Patch5006: linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
-Patch5007: linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
-Patch5008: linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
-Patch5009: linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
-Patch5010: linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
-Patch5011: linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
-Patch5012: linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
-Patch5013: linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
-Patch5014: linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
-Patch5015: linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
-Patch5016: linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
-Patch5017: linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
-Patch5018: linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
-Patch5019: linux-2.6-xen-0020-reserve_early-kernel-text-and-data-segments.patch
+Patch5006: linux-2.6-xen-0007-xen-Enable-Xen-console-by-default-in-domU.patch
+Patch5007: linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
+Patch5008: linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
+Patch5009: linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
+Patch5010: linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
+Patch5011: linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
+Patch5012: linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
+Patch5013: linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
+Patch5014: linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
+Patch5015: linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
+Patch5016: linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
+Patch5017: linux-2.6-xen-0018-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
+Patch5018: linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
+Patch5019: linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
 # kernel-xen patches end
 
 # Xen hypervisor patches (20000+)
@@ -1231,21 +1231,21 @@
 ApplyPatch linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch
 ApplyPatch linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
 ApplyPatch linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
-ApplyPatch linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
-ApplyPatch linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
-ApplyPatch linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
-ApplyPatch linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
-ApplyPatch linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
-ApplyPatch linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
-ApplyPatch linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
-ApplyPatch linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
-ApplyPatch linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
-ApplyPatch linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
-ApplyPatch linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
-ApplyPatch linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
+ApplyPatch linux-2.6-xen-0007-xen-Enable-Xen-console-by-default-in-domU.patch
+ApplyPatch linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
+ApplyPatch linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
+ApplyPatch linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
+ApplyPatch linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
+ApplyPatch linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
+ApplyPatch linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
+ApplyPatch linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
+ApplyPatch linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
+ApplyPatch linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
+ApplyPatch linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
+ApplyPatch linux-2.6-xen-0018-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
+ApplyPatch linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
 %ifarch x86_64
-ApplyPatch linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
-ApplyPatch linux-2.6-xen-0020-reserve_early-kernel-text-and-data-segments.patch
+ApplyPatch linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
 %endif
 # kernel-xen apply end
 
@@ -1855,6 +1855,11 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Fri Apr  4 2008 Mark McLoughlin <markmc at redhat.com>
+- Add patch from armbru to intelligently choose the preferred
+  console (#434761)
+- Couple of x86_64 fixes
+
 * Thu Apr 03 2008 Eduardo Habkost <ehabkost at redhat.com>
 - x86_64: Reserve kernel text and data segments at boot (bug #438000)
 


--- linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch DELETED ---


--- linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch DELETED ---


--- linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch DELETED ---


--- linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch DELETED ---


--- linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch DELETED ---


--- linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch DELETED ---


--- linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch DELETED ---


--- linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch DELETED ---


--- linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch DELETED ---


--- linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch DELETED ---


--- linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch DELETED ---


--- linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch DELETED ---


--- linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch DELETED ---


--- linux-2.6-xen-0020-reserve_early-kernel-text-and-data-segments.patch DELETED ---




More information about the scm-commits mailing list