ia64/xen-unstable

changeset 9674:edefe24d78bd

Merged.
author emellor@leeni.uk.xensource.com
date Tue Apr 11 12:51:48 2006 +0100 (2006-04-11)
parents 7ad21a787d3f 4d4b41264b84
children 5cc367720223 19c55935580f
files
line diff
     1.1 --- a/buildconfigs/linux-defconfig_xen0_ia64	Tue Apr 11 12:46:39 2006 +0100
     1.2 +++ b/buildconfigs/linux-defconfig_xen0_ia64	Tue Apr 11 12:51:48 2006 +0100
     1.3 @@ -95,6 +95,7 @@ CONFIG_ARCH_XEN=y
     1.4  CONFIG_XEN_PRIVILEGED_GUEST=y
     1.5  CONFIG_XEN_BLKDEV_GRANT=y
     1.6  CONFIG_XEN_BLKDEV_FRONTEND=y
     1.7 +CONFIG_XEN_BACKEND=y
     1.8  CONFIG_XEN_BLKDEV_BACKEND=y
     1.9  CONFIG_XEN_SYSFS=y
    1.10  CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
     2.1 --- a/buildconfigs/linux-defconfig_xen0_x86_32	Tue Apr 11 12:46:39 2006 +0100
     2.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_32	Tue Apr 11 12:51:48 2006 +0100
     2.3 @@ -1316,6 +1316,7 @@ CONFIG_XEN_INTERFACE_VERSION=0x00030101
     2.4  #
     2.5  CONFIG_XEN_PRIVILEGED_GUEST=y
     2.6  # CONFIG_XEN_UNPRIVILEGED_GUEST is not set
     2.7 +CONFIG_XEN_BACKEND=y
     2.8  CONFIG_XEN_PCIDEV_BACKEND=y
     2.9  # CONFIG_XEN_PCIDEV_BACKEND_VPCI is not set
    2.10  CONFIG_XEN_PCIDEV_BACKEND_PASS=y
     3.1 --- a/buildconfigs/linux-defconfig_xen0_x86_64	Tue Apr 11 12:46:39 2006 +0100
     3.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_64	Tue Apr 11 12:51:48 2006 +0100
     3.3 @@ -1246,6 +1246,7 @@ CONFIG_NO_IDLE_HZ=y
     3.4  #
     3.5  CONFIG_XEN_PRIVILEGED_GUEST=y
     3.6  # CONFIG_XEN_UNPRIVILEGED_GUEST is not set
     3.7 +CONFIG_XEN_BACKEND=y
     3.8  CONFIG_XEN_PCIDEV_BACKEND=y
     3.9  # CONFIG_XEN_PCIDEV_BACKEND_VPCI is not set
    3.10  CONFIG_XEN_PCIDEV_BACKEND_PASS=y
     4.1 --- a/buildconfigs/linux-defconfig_xenU_ia64	Tue Apr 11 12:46:39 2006 +0100
     4.2 +++ b/buildconfigs/linux-defconfig_xenU_ia64	Tue Apr 11 12:51:48 2006 +0100
     4.3 @@ -92,6 +92,7 @@ CONFIG_ARCH_XEN=y
     4.4  CONFIG_XEN_PRIVILEGED_GUEST=y
     4.5  CONFIG_XEN_BLKDEV_GRANT=y
     4.6  CONFIG_XEN_BLKDEV_FRONTEND=y
     4.7 +CONFIG_XEN_BACKEND=y
     4.8  CONFIG_XEN_BLKDEV_BACKEND=y
     4.9  CONFIG_XEN_SYSFS=y
    4.10  CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
     5.1 --- a/buildconfigs/linux-defconfig_xenU_x86_32	Tue Apr 11 12:46:39 2006 +0100
     5.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_32	Tue Apr 11 12:51:48 2006 +0100
     5.3 @@ -859,13 +859,9 @@ CONFIG_NO_IDLE_HZ=y
     5.4  #
     5.5  # CONFIG_XEN_PRIVILEGED_GUEST is not set
     5.6  CONFIG_XEN_UNPRIVILEGED_GUEST=y
     5.7 -# CONFIG_XEN_PCIDEV_BACKEND is not set
     5.8 -# CONFIG_XEN_BLKDEV_BACKEND is not set
     5.9 -# CONFIG_XEN_NETDEV_BACKEND is not set
    5.10 -# CONFIG_XEN_TPMDEV_BACKEND is not set
    5.11 +# CONFIG_XEN_BACKEND is not set
    5.12  CONFIG_XEN_BLKDEV_FRONTEND=y
    5.13  CONFIG_XEN_NETDEV_FRONTEND=y
    5.14 -# CONFIG_XEN_BLKDEV_TAP is not set
    5.15  # CONFIG_XEN_TPMDEV_FRONTEND is not set
    5.16  CONFIG_XEN_SCRUB_PAGES=y
    5.17  CONFIG_XEN_DISABLE_SERIAL=y
     6.1 --- a/buildconfigs/linux-defconfig_xenU_x86_64	Tue Apr 11 12:46:39 2006 +0100
     6.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_64	Tue Apr 11 12:51:48 2006 +0100
     6.3 @@ -1135,13 +1135,9 @@ CONFIG_NO_IDLE_HZ=y
     6.4  #
     6.5  # CONFIG_XEN_PRIVILEGED_GUEST is not set
     6.6  CONFIG_XEN_UNPRIVILEGED_GUEST=y
     6.7 -# CONFIG_XEN_PCIDEV_BACKEND is not set
     6.8 -# CONFIG_XEN_BLKDEV_BACKEND is not set
     6.9 -# CONFIG_XEN_NETDEV_BACKEND is not set
    6.10 -# CONFIG_XEN_TPMDEV_BACKEND is not set
    6.11 +# CONFIG_XEN_BACKEND is not set
    6.12  CONFIG_XEN_BLKDEV_FRONTEND=y
    6.13  CONFIG_XEN_NETDEV_FRONTEND=y
    6.14 -# CONFIG_XEN_BLKDEV_TAP is not set
    6.15  # CONFIG_XEN_TPMDEV_FRONTEND is not set
    6.16  CONFIG_XEN_SCRUB_PAGES=y
    6.17  CONFIG_XEN_DISABLE_SERIAL=y
     7.1 --- a/buildconfigs/linux-defconfig_xen_ia64	Tue Apr 11 12:46:39 2006 +0100
     7.2 +++ b/buildconfigs/linux-defconfig_xen_ia64	Tue Apr 11 12:51:48 2006 +0100
     7.3 @@ -95,6 +95,7 @@ CONFIG_ARCH_XEN=y
     7.4  CONFIG_XEN_PRIVILEGED_GUEST=y
     7.5  CONFIG_XEN_BLKDEV_GRANT=y
     7.6  CONFIG_XEN_BLKDEV_FRONTEND=y
     7.7 +CONFIG_XEN_BACKEND=y
     7.8  CONFIG_XEN_BLKDEV_BACKEND=y
     7.9  CONFIG_XEN_SYSFS=y
    7.10  CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
     8.1 --- a/buildconfigs/linux-defconfig_xen_x86_32	Tue Apr 11 12:46:39 2006 +0100
     8.2 +++ b/buildconfigs/linux-defconfig_xen_x86_32	Tue Apr 11 12:51:48 2006 +0100
     8.3 @@ -2979,6 +2979,7 @@ CONFIG_NO_IDLE_HZ=y
     8.4  #
     8.5  CONFIG_XEN_PRIVILEGED_GUEST=y
     8.6  # CONFIG_XEN_UNPRIVILEGED_GUEST is not set
     8.7 +CONFIG_XEN_BACKEND=y
     8.8  CONFIG_XEN_PCIDEV_BACKEND=y
     8.9  # CONFIG_XEN_PCIDEV_BACKEND_VPCI is not set
    8.10  CONFIG_XEN_PCIDEV_BACKEND_PASS=y
     9.1 --- a/buildconfigs/linux-defconfig_xen_x86_64	Tue Apr 11 12:46:39 2006 +0100
     9.2 +++ b/buildconfigs/linux-defconfig_xen_x86_64	Tue Apr 11 12:51:48 2006 +0100
     9.3 @@ -2656,6 +2656,7 @@ CONFIG_NO_IDLE_HZ=y
     9.4  #
     9.5  CONFIG_XEN_PRIVILEGED_GUEST=y
     9.6  # CONFIG_XEN_UNPRIVILEGED_GUEST is not set
     9.7 +CONFIG_XEN_BACKEND=y
     9.8  CONFIG_XEN_PCIDEV_BACKEND=y
     9.9  # CONFIG_XEN_PCIDEV_BACKEND_VPCI is not set
    9.10  CONFIG_XEN_PCIDEV_BACKEND_PASS=y
    10.1 --- a/linux-2.6-xen-sparse/arch/ia64/Kconfig	Tue Apr 11 12:46:39 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig	Tue Apr 11 12:51:48 2006 +0100
    10.3 @@ -79,8 +79,13 @@ config XEN_BLKDEV_FRONTEND
    10.4  	bool
    10.5  	default y
    10.6  
    10.7 +config XEN_BACKEND
    10.8 +	depends on XEN
    10.9 +	bool
   10.10 +	default y
   10.11 +
   10.12  config XEN_BLKDEV_BACKEND
   10.13 -	depends on XEN
   10.14 +	depends on XEN && XEN_BACKEND
   10.15  	bool
   10.16  	default y
   10.17  
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/Kconfig	Tue Apr 11 12:46:39 2006 +0100
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig	Tue Apr 11 12:51:48 2006 +0100
    11.3 @@ -28,9 +28,16 @@ config XEN_UNPRIVILEGED_GUEST
    11.4  	bool
    11.5  	default !XEN_PRIVILEGED_GUEST
    11.6  
    11.7 +config XEN_BACKEND
    11.8 +        tristate "Backend driver support"
    11.9 +        default y
   11.10 +        help
   11.11 +          Support for backend device drivers that provide I/O services
   11.12 +          to other virtual machines.
   11.13 +
   11.14  config XEN_PCIDEV_BACKEND
   11.15  	tristate "PCI device backend driver"
   11.16 -	depends PCI
   11.17 +	depends on PCI && XEN_BACKEND
   11.18  	default XEN_PRIVILEGED_GUEST
   11.19  	help
   11.20  	  The PCI device backend driver allows the kernel to export arbitrary
   11.21 @@ -70,6 +77,7 @@ config XEN_PCIDEV_BE_DEBUG
   11.22  
   11.23  config XEN_BLKDEV_BACKEND
   11.24  	tristate "Block-device backend driver"
   11.25 +        depends on XEN_BACKEND
   11.26  	default y
   11.27  	help
   11.28  	  The block-device backend driver allows the kernel to export its
   11.29 @@ -91,6 +99,7 @@ config XEN_BLKDEV_TAP_BE
   11.30  
   11.31  config XEN_NETDEV_BACKEND
   11.32  	tristate "Network-device backend driver"
   11.33 +        depends on XEN_BACKEND
   11.34  	default y
   11.35  	help
   11.36  	  The network-device backend driver allows the kernel to export its
   11.37 @@ -120,6 +129,7 @@ config XEN_NETDEV_LOOPBACK
   11.38  
   11.39  config XEN_TPMDEV_BACKEND
   11.40  	tristate "TPM-device backend driver"
   11.41 +        depends on XEN_BACKEND
   11.42  	default n
   11.43  	help
   11.44  	  The TPM-device backend driver
   11.45 @@ -155,6 +165,7 @@ config XEN_NETDEV_FRONTEND
   11.46  
   11.47  config XEN_BLKDEV_TAP
   11.48  	tristate "Block device tap driver"
   11.49 +        depends on XEN_BACKEND
   11.50  	default n
   11.51  	help
   11.52  	  This driver allows a VM to interact on block device channels
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Apr 11 12:46:39 2006 +0100
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Apr 11 12:51:48 2006 +0100
    12.3 @@ -300,13 +300,6 @@ again:
    12.4  		goto abort_transaction;
    12.5  	}
    12.6  
    12.7 -	err = xenbus_printf(xbt, dev->nodename,
    12.8 -			    "state", "%d", XenbusStateConnected);
    12.9 -	if (err) {
   12.10 -		message = "writing frontend XenbusStateConnected";
   12.11 -		goto abort_transaction;
   12.12 -	}
   12.13 -
   12.14  	err = xenbus_transaction_end(xbt, 0);
   12.15  	if (err) {
   12.16  		if (err == -EAGAIN)
   12.17 @@ -315,6 +308,8 @@ again:
   12.18  		goto destroy_ring;
   12.19  	}
   12.20  
   12.21 +	xenbus_switch_state(dev, XenbusStateConnected);
   12.22 +
   12.23  	return 0;
   12.24  
   12.25   abort_transaction:
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile	Tue Apr 11 12:46:39 2006 +0100
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile	Tue Apr 11 12:51:48 2006 +0100
    13.3 @@ -1,4 +1,8 @@
    13.4  obj-y	+= xenbus.o
    13.5 +obj-$(CONFIG_XEN_BACKEND) += xenbus_be.o
    13.6 +
    13.7 +xenbus_be-objs =
    13.8 +xenbus_be-objs += xenbus_backend_client.o
    13.9  
   13.10  xenbus-objs =
   13.11  xenbus-objs += xenbus_client.o
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_backend_client.c	Tue Apr 11 12:51:48 2006 +0100
    14.3 @@ -0,0 +1,173 @@
    14.4 +/******************************************************************************
    14.5 + * Backend-client-facing interface for the Xenbus driver.  In other words, the
    14.6 + * interface between the Xenbus and the device-specific code in the backend
    14.7 + * driver.
    14.8 + *
    14.9 + * Copyright (C) 2005-2006 XenSource Ltd
   14.10 + * 
   14.11 + * This program is free software; you can redistribute it and/or
   14.12 + * modify it under the terms of the GNU General Public License version 2
   14.13 + * as published by the Free Software Foundation; or, when distributed
   14.14 + * separately from the Linux kernel or incorporated into other
   14.15 + * software packages, subject to the following license:
   14.16 + * 
   14.17 + * Permission is hereby granted, free of charge, to any person obtaining a copy
   14.18 + * of this source file (the "Software"), to deal in the Software without
   14.19 + * restriction, including without limitation the rights to use, copy, modify,
   14.20 + * merge, publish, distribute, sublicense, and/or sell copies of the Software,
   14.21 + * and to permit persons to whom the Software is furnished to do so, subject to
   14.22 + * the following conditions:
   14.23 + * 
   14.24 + * The above copyright notice and this permission notice shall be included in
   14.25 + * all copies or substantial portions of the Software.
   14.26 + * 
   14.27 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   14.28 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   14.29 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   14.30 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   14.31 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   14.32 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
   14.33 + * IN THE SOFTWARE.
   14.34 + */
   14.35 +
   14.36 +#include <xen/gnttab.h>
   14.37 +#include <xen/xenbus.h>
   14.38 +#include <xen/driver_util.h>
   14.39 +
   14.40 +/* Based on Rusty Russell's skeleton driver's map_page */
   14.41 +int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr)
   14.42 +{
   14.43 +	struct gnttab_map_grant_ref op = {
   14.44 +		.flags = GNTMAP_host_map,
   14.45 +		.ref   = gnt_ref,
   14.46 +		.dom   = dev->otherend_id,
   14.47 +	};
   14.48 +	struct vm_struct *area;
   14.49 +
   14.50 +	*vaddr = NULL;
   14.51 +
   14.52 +	area = alloc_vm_area(PAGE_SIZE);
   14.53 +	if (!area)
   14.54 +		return -ENOMEM;
   14.55 +
   14.56 +	op.host_addr = (unsigned long)area->addr;
   14.57 +
   14.58 +	lock_vm_area(area);
   14.59 +	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1));
   14.60 +	unlock_vm_area(area);
   14.61 +
   14.62 +	if (op.status != GNTST_okay) {
   14.63 +		free_vm_area(area);
   14.64 +		xenbus_dev_fatal(dev, op.status,
   14.65 +				 "mapping in shared page %d from domain %d",
   14.66 +				 gnt_ref, dev->otherend_id);
   14.67 +		return op.status;
   14.68 +	}
   14.69 +
   14.70 +	/* Stuff the handle in an unused field */
   14.71 +	area->phys_addr = (unsigned long)op.handle;
   14.72 +
   14.73 +	*vaddr = area->addr;
   14.74 +	return 0;
   14.75 +}
   14.76 +EXPORT_SYMBOL_GPL(xenbus_map_ring_valloc);
   14.77 +
   14.78 +
   14.79 +int xenbus_map_ring(struct xenbus_device *dev, int gnt_ref,
   14.80 +		   grant_handle_t *handle, void *vaddr)
   14.81 +{
   14.82 +	struct gnttab_map_grant_ref op = {
   14.83 +		.host_addr = (unsigned long)vaddr,
   14.84 +		.flags     = GNTMAP_host_map,
   14.85 +		.ref       = gnt_ref,
   14.86 +		.dom       = dev->otherend_id,
   14.87 +	};
   14.88 +
   14.89 +	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1));
   14.90 +
   14.91 +	if (op.status != GNTST_okay) {
   14.92 +		xenbus_dev_fatal(dev, op.status,
   14.93 +				 "mapping in shared page %d from domain %d",
   14.94 +				 gnt_ref, dev->otherend_id);
   14.95 +	} else
   14.96 +		*handle = op.handle;
   14.97 +
   14.98 +	return op.status;
   14.99 +}
  14.100 +EXPORT_SYMBOL_GPL(xenbus_map_ring);
  14.101 +
  14.102 +
  14.103 +/* Based on Rusty Russell's skeleton driver's unmap_page */
  14.104 +int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr)
  14.105 +{
  14.106 +	struct vm_struct *area;
  14.107 +	struct gnttab_unmap_grant_ref op = {
  14.108 +		.host_addr = (unsigned long)vaddr,
  14.109 +	};
  14.110 +
  14.111 +	/* It'd be nice if linux/vmalloc.h provided a find_vm_area(void *addr)
  14.112 +	 * method so that we don't have to muck with vmalloc internals here.
  14.113 +	 * We could force the user to hang on to their struct vm_struct from
  14.114 +	 * xenbus_map_ring_valloc, but these 6 lines considerably simplify
  14.115 +	 * this API.
  14.116 +	 */
  14.117 +	read_lock(&vmlist_lock);
  14.118 +	for (area = vmlist; area != NULL; area = area->next) {
  14.119 +		if (area->addr == vaddr)
  14.120 +			break;
  14.121 +	}
  14.122 +	read_unlock(&vmlist_lock);
  14.123 +
  14.124 +	if (!area) {
  14.125 +		xenbus_dev_error(dev, -ENOENT,
  14.126 +				 "can't find mapped virtual address %p", vaddr);
  14.127 +		return GNTST_bad_virt_addr;
  14.128 +	}
  14.129 +
  14.130 +	op.handle = (grant_handle_t)area->phys_addr;
  14.131 +
  14.132 +	lock_vm_area(area);
  14.133 +	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1));
  14.134 +	unlock_vm_area(area);
  14.135 +
  14.136 +	if (op.status == GNTST_okay)
  14.137 +		free_vm_area(area);
  14.138 +	else
  14.139 +		xenbus_dev_error(dev, op.status,
  14.140 +				 "unmapping page at handle %d error %d",
  14.141 +				 (int16_t)area->phys_addr, op.status);
  14.142 +
  14.143 +	return op.status;
  14.144 +}
  14.145 +EXPORT_SYMBOL_GPL(xenbus_unmap_ring_vfree);
  14.146 +
  14.147 +
  14.148 +int xenbus_unmap_ring(struct xenbus_device *dev,
  14.149 +		     grant_handle_t handle, void *vaddr)
  14.150 +{
  14.151 +	struct gnttab_unmap_grant_ref op = {
  14.152 +		.host_addr = (unsigned long)vaddr,
  14.153 +		.handle    = handle,
  14.154 +	};
  14.155 +
  14.156 +	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1));
  14.157 +
  14.158 +	if (op.status != GNTST_okay)
  14.159 +		xenbus_dev_error(dev, op.status,
  14.160 +				 "unmapping page at handle %d error %d",
  14.161 +				 handle, op.status);
  14.162 +
  14.163 +	return op.status;
  14.164 +}
  14.165 +EXPORT_SYMBOL_GPL(xenbus_unmap_ring);
  14.166 +
  14.167 +
  14.168 +/*
  14.169 + * Local variables:
  14.170 + *  c-file-style: "linux"
  14.171 + *  indent-tabs-mode: t
  14.172 + *  c-indent-level: 8
  14.173 + *  c-basic-offset: 8
  14.174 + *  tab-width: 8
  14.175 + * End:
  14.176 + */
    15.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Tue Apr 11 12:46:39 2006 +0100
    15.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Tue Apr 11 12:51:48 2006 +0100
    15.3 @@ -261,134 +261,6 @@ int xenbus_free_evtchn(struct xenbus_dev
    15.4  }
    15.5  
    15.6  
    15.7 -/* Based on Rusty Russell's skeleton driver's map_page */
    15.8 -int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr)
    15.9 -{
   15.10 -	struct gnttab_map_grant_ref op = {
   15.11 -		.flags = GNTMAP_host_map,
   15.12 -		.ref   = gnt_ref,
   15.13 -		.dom   = dev->otherend_id,
   15.14 -	};
   15.15 -	struct vm_struct *area;
   15.16 -
   15.17 -	*vaddr = NULL;
   15.18 -
   15.19 -	area = alloc_vm_area(PAGE_SIZE);
   15.20 -	if (!area)
   15.21 -		return -ENOMEM;
   15.22 -
   15.23 -	op.host_addr = (unsigned long)area->addr;
   15.24 -
   15.25 -	lock_vm_area(area);
   15.26 -	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1));
   15.27 -	unlock_vm_area(area);
   15.28 -
   15.29 -	if (op.status != GNTST_okay) {
   15.30 -		free_vm_area(area);
   15.31 -		xenbus_dev_fatal(dev, op.status,
   15.32 -				 "mapping in shared page %d from domain %d",
   15.33 -				 gnt_ref, dev->otherend_id);
   15.34 -		return op.status;
   15.35 -	}
   15.36 -
   15.37 -	/* Stuff the handle in an unused field */
   15.38 -	area->phys_addr = (unsigned long)op.handle;
   15.39 -
   15.40 -	*vaddr = area->addr;
   15.41 -	return 0;
   15.42 -}
   15.43 -EXPORT_SYMBOL_GPL(xenbus_map_ring_valloc);
   15.44 -
   15.45 -
   15.46 -int xenbus_map_ring(struct xenbus_device *dev, int gnt_ref,
   15.47 -		   grant_handle_t *handle, void *vaddr)
   15.48 -{
   15.49 -	struct gnttab_map_grant_ref op = {
   15.50 -		.host_addr = (unsigned long)vaddr,
   15.51 -		.flags     = GNTMAP_host_map,
   15.52 -		.ref       = gnt_ref,
   15.53 -		.dom       = dev->otherend_id,
   15.54 -	};
   15.55 -
   15.56 -	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1));
   15.57 -
   15.58 -	if (op.status != GNTST_okay) {
   15.59 -		xenbus_dev_fatal(dev, op.status,
   15.60 -				 "mapping in shared page %d from domain %d",
   15.61 -				 gnt_ref, dev->otherend_id);
   15.62 -	} else
   15.63 -		*handle = op.handle;
   15.64 -
   15.65 -	return op.status;
   15.66 -}
   15.67 -EXPORT_SYMBOL_GPL(xenbus_map_ring);
   15.68 -
   15.69 -
   15.70 -/* Based on Rusty Russell's skeleton driver's unmap_page */
   15.71 -int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr)
   15.72 -{
   15.73 -	struct vm_struct *area;
   15.74 -	struct gnttab_unmap_grant_ref op = {
   15.75 -		.host_addr = (unsigned long)vaddr,
   15.76 -	};
   15.77 -
   15.78 -	/* It'd be nice if linux/vmalloc.h provided a find_vm_area(void *addr)
   15.79 -	 * method so that we don't have to muck with vmalloc internals here.
   15.80 -	 * We could force the user to hang on to their struct vm_struct from
   15.81 -	 * xenbus_map_ring_valloc, but these 6 lines considerably simplify
   15.82 -	 * this API.
   15.83 -	 */
   15.84 -	read_lock(&vmlist_lock);
   15.85 -	for (area = vmlist; area != NULL; area = area->next) {
   15.86 -		if (area->addr == vaddr)
   15.87 -			break;
   15.88 -	}
   15.89 -	read_unlock(&vmlist_lock);
   15.90 -
   15.91 -	if (!area) {
   15.92 -		xenbus_dev_error(dev, -ENOENT,
   15.93 -				 "can't find mapped virtual address %p", vaddr);
   15.94 -		return GNTST_bad_virt_addr;
   15.95 -	}
   15.96 -
   15.97 -	op.handle = (grant_handle_t)area->phys_addr;
   15.98 -
   15.99 -	lock_vm_area(area);
  15.100 -	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1));
  15.101 -	unlock_vm_area(area);
  15.102 -
  15.103 -	if (op.status == GNTST_okay)
  15.104 -		free_vm_area(area);
  15.105 -	else
  15.106 -		xenbus_dev_error(dev, op.status,
  15.107 -				 "unmapping page at handle %d error %d",
  15.108 -				 (int16_t)area->phys_addr, op.status);
  15.109 -
  15.110 -	return op.status;
  15.111 -}
  15.112 -EXPORT_SYMBOL_GPL(xenbus_unmap_ring_vfree);
  15.113 -
  15.114 -
  15.115 -int xenbus_unmap_ring(struct xenbus_device *dev,
  15.116 -		     grant_handle_t handle, void *vaddr)
  15.117 -{
  15.118 -	struct gnttab_unmap_grant_ref op = {
  15.119 -		.host_addr = (unsigned long)vaddr,
  15.120 -		.handle    = handle,
  15.121 -	};
  15.122 -
  15.123 -	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1));
  15.124 -
  15.125 -	if (op.status != GNTST_okay)
  15.126 -		xenbus_dev_error(dev, op.status,
  15.127 -				 "unmapping page at handle %d error %d",
  15.128 -				 handle, op.status);
  15.129 -
  15.130 -	return op.status;
  15.131 -}
  15.132 -EXPORT_SYMBOL_GPL(xenbus_unmap_ring);
  15.133 -
  15.134 -
  15.135  XenbusState xenbus_read_driver_state(const char *path)
  15.136  {
  15.137  	XenbusState result;
    16.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Apr 11 12:46:39 2006 +0100
    16.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Apr 11 12:51:48 2006 +0100
    16.3 @@ -1065,19 +1065,16 @@ postcore_initcall(xenbus_probe_init);
    16.4   */
    16.5  static int __init wait_for_devices(void)
    16.6  {
    16.7 -	int i;
    16.8 +	unsigned long timeout = jiffies + 10*HZ;
    16.9  
   16.10 -	for (i = 0; i < 10 * HZ; i++) {
   16.11 -		if (all_devices_ready()) {
   16.12 -			return;
   16.13 -		}
   16.14 -
   16.15 -		set_current_state(TASK_INTERRUPTIBLE);
   16.16 -		schedule_timeout(1);
   16.17 +	while (time_before(jiffies, timeout)) {
   16.18 +		if (all_devices_ready())
   16.19 +			return 0;
   16.20 +		schedule_timeout_interruptible(HZ/10);
   16.21  	}
   16.22  
   16.23 -	printk(KERN_WARNING
   16.24 -	       "XENBUS: Timeout connecting to devices!\n");
   16.25 +	printk(KERN_WARNING "XENBUS: Timeout connecting to devices!\n");
   16.26 +	return 0;
   16.27  }
   16.28  
   16.29  late_initcall(wait_for_devices);
    17.1 --- a/tools/xenstat/xentop/Makefile	Tue Apr 11 12:46:39 2006 +0100
    17.2 +++ b/tools/xenstat/xentop/Makefile	Tue Apr 11 12:51:48 2006 +0100
    17.3 @@ -34,9 +34,6 @@ LDLIBS += -lxenstat -lncurses
    17.4  .PHONY: all
    17.5  all: xentop
    17.6  
    17.7 -.PHONY: xentop
    17.8 -xentop: xentop.o
    17.9 -
   17.10  .PHONY: install
   17.11  install: xentop xentop.1
   17.12  	$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
    18.1 --- a/tools/xenstore/Makefile	Tue Apr 11 12:46:39 2006 +0100
    18.2 +++ b/tools/xenstore/Makefile	Tue Apr 11 12:51:48 2006 +0100
    18.3 @@ -57,14 +57,12 @@ xenstored_test: xenstored_core_test.o xe
    18.4  xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
    18.5  	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
    18.6  
    18.7 -.PHONY: xs_test xs_random xs_stress xs_crashme
    18.8  xs_test xs_random xs_stress xs_crashme: LDFLAGS+=-lpthread
    18.9  xs_test: xs_test.o xs_lib.o utils.o
   18.10  xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
   18.11  xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
   18.12  xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
   18.13  
   18.14 -.PHONY: speedtest
   18.15  speedtest: speedtest.o xs.o xs_lib.o utils.o talloc.o
   18.16  
   18.17  .PHONY: check-speed
    19.1 --- a/xen/arch/ia64/tools/privop/Makefile	Tue Apr 11 12:46:39 2006 +0100
    19.2 +++ b/xen/arch/ia64/tools/privop/Makefile	Tue Apr 11 12:51:48 2006 +0100
    19.3 @@ -4,7 +4,6 @@ CFLAGS=-O -Wall
    19.4  .PHONY: all
    19.5  all: postat
    19.6  
    19.7 -.PHONY: postat
    19.8  postat: postat.c pohcalls.o
    19.9  
   19.10  .PHONY: clean
    20.1 --- a/xen/arch/x86/hvm/platform.c	Tue Apr 11 12:46:39 2006 +0100
    20.2 +++ b/xen/arch/x86/hvm/platform.c	Tue Apr 11 12:51:48 2006 +0100
    20.3 @@ -401,6 +401,11 @@ static int hvm_decode(int realmode, unsi
    20.4          GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
    20.5          return reg_mem(instr->op_size, opcode, instr, rex);
    20.6  
    20.7 +    case 0x3B: /* cmp m32/16, r32/16 */
    20.8 +        instr->instr = INSTR_CMP;
    20.9 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
   20.10 +        return mem_reg(instr->op_size, opcode, instr, rex);
   20.11 +
   20.12      case 0x80:
   20.13      case 0x81:
   20.14          {
    21.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Tue Apr 11 12:46:39 2006 +0100
    21.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Apr 11 12:51:48 2006 +0100
    21.3 @@ -1947,7 +1947,7 @@ static inline void vmx_vmexit_do_extint(
    21.4          && !(vector & INTR_INFO_VALID_MASK))
    21.5          __hvm_bug(regs);
    21.6  
    21.7 -    vector &= 0xff;
    21.8 +    vector &= INTR_INFO_VECTOR_MASK;
    21.9      local_irq_disable();
   21.10      TRACE_VMEXIT(1,vector);
   21.11  
   21.12 @@ -2077,10 +2077,8 @@ asmlinkage void vmx_vmexit_handler(struc
   21.13          return;
   21.14      }
   21.15  
   21.16 -    {
   21.17 -        __vmread(GUEST_RIP, &eip);
   21.18 -        TRACE_VMEXIT(0,exit_reason);
   21.19 -    }
   21.20 +    __vmread(GUEST_RIP, &eip);
   21.21 +    TRACE_VMEXIT(0,exit_reason);
   21.22  
   21.23      switch (exit_reason) {
   21.24      case EXIT_REASON_EXCEPTION_NMI:
   21.25 @@ -2097,7 +2095,7 @@ asmlinkage void vmx_vmexit_handler(struc
   21.26          if ((error = __vmread(VM_EXIT_INTR_INFO, &vector))
   21.27              || !(vector & INTR_INFO_VALID_MASK))
   21.28              __hvm_bug(&regs);
   21.29 -        vector &= 0xff;
   21.30 +        vector &= INTR_INFO_VECTOR_MASK;
   21.31  
   21.32          TRACE_VMEXIT(1,vector);
   21.33          perfc_incra(cause_vector, vector);
    22.1 --- a/xen/include/asm-ia64/event.h	Tue Apr 11 12:46:39 2006 +0100
    22.2 +++ b/xen/include/asm-ia64/event.h	Tue Apr 11 12:51:48 2006 +0100
    22.3 @@ -32,4 +32,9 @@ static inline void evtchn_notify(struct 
    22.4  	vcpu_pend_interrupt(v, v->vcpu_info->arch.evtchn_vector);
    22.5  }
    22.6  
    22.7 +/* Note: Bitwise operations result in fast code with no branches. */
    22.8 +#define event_pending(v)                        \
    22.9 +    (!!(v)->vcpu_info->evtchn_upcall_pending &  \
   22.10 +      !(v)->vcpu_info->evtchn_upcall_mask)
   22.11 +
   22.12  #endif
    23.1 --- a/xen/include/asm-x86/event.h	Tue Apr 11 12:46:39 2006 +0100
    23.2 +++ b/xen/include/asm-x86/event.h	Tue Apr 11 12:51:48 2006 +0100
    23.3 @@ -26,4 +26,9 @@ static inline void evtchn_notify(struct 
    23.4          smp_send_event_check_cpu(v->processor);
    23.5  }
    23.6  
    23.7 +/* Note: Bitwise operations result in fast code with no branches. */
    23.8 +#define event_pending(v)                        \
    23.9 +    (!!(v)->vcpu_info->evtchn_upcall_pending &  \
   23.10 +      !(v)->vcpu_info->evtchn_upcall_mask)
   23.11 +
   23.12  #endif
    24.1 --- a/xen/include/asm-x86/hvm/io.h	Tue Apr 11 12:46:39 2006 +0100
    24.2 +++ b/xen/include/asm-x86/hvm/io.h	Tue Apr 11 12:51:48 2006 +0100
    24.3 @@ -77,7 +77,7 @@ struct instruction {
    24.4      __u32   flags;
    24.5  };
    24.6  
    24.7 -#define MAX_INST_LEN      32
    24.8 +#define MAX_INST_LEN      15 /* Maximum instruction length = 15 bytes */
    24.9  
   24.10  struct mmio_op {
   24.11      int                    flags;
    25.1 --- a/xen/include/xen/event.h	Tue Apr 11 12:46:39 2006 +0100
    25.2 +++ b/xen/include/xen/event.h	Tue Apr 11 12:51:48 2006 +0100
    25.3 @@ -38,11 +38,6 @@ extern void send_guest_global_virq(struc
    25.4   */
    25.5  extern void send_guest_pirq(struct domain *d, int pirq);
    25.6  
    25.7 -/* Note: Bitwise operations result in fast code with no branches. */
    25.8 -#define event_pending(v)                        \
    25.9 -    (!!(v)->vcpu_info->evtchn_upcall_pending &  \
   25.10 -      !(v)->vcpu_info->evtchn_upcall_mask)
   25.11 -
   25.12  #define evtchn_pending(d, p)                    \
   25.13      (test_bit((p), &(d)->shared_info->evtchn_pending[0]))
   25.14  
    26.1 --- a/xen/tools/Makefile	Tue Apr 11 12:46:39 2006 +0100
    26.2 +++ b/xen/tools/Makefile	Tue Apr 11 12:51:48 2006 +0100
    26.3 @@ -11,6 +11,5 @@ clean:
    26.4  	$(MAKE) -C figlet clean
    26.5  	rm -f *.o symbols
    26.6  
    26.7 -.PHONY: symbols
    26.8  symbols: symbols.c
    26.9  	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<