ia64/linux-2.6.18-xen.hg

changeset 773:28acedb66302

merge with linux-2.6.18-xen.hg
author Isaku Yamahata <yamahata@valinux.co.jp>
date Wed Jan 07 12:21:54 2009 +0900 (2009-01-07)
parents 79bf5894b3f9 79e82ae1bad0
children 4caff484c9f4 107e10e0e07c
files
line diff
     1.1 --- a/Documentation/kernel-parameters.txt	Mon Jan 05 14:13:49 2009 +0900
     1.2 +++ b/Documentation/kernel-parameters.txt	Wed Jan 07 12:21:54 2009 +0900
     1.3 @@ -1240,6 +1240,21 @@ running once the system is up.
     1.4  				bootloader. This is currently used on
     1.5  				IXP2000 systems where the bus has to be
     1.6  				configured a certain way for adjunct CPUs.
     1.7 +		reassigndev=
     1.8 +				Format: [<segment>:]<bus>:<dev>.<func>[,[<segment>:]<bus>:<dev>.<func>[,...]]
     1.9 +				Specifies device to reassign page-aligned memory
    1.10 +				resources. PCI-PCI bridge can be specified, if
    1.11 +				resource windows need to be expanded.
    1.12 +		reassign_resources
    1.13 +				Use guestdev parameter to reassign device's
    1.14 +				resources.
    1.15 +		guestdev=
    1.16 +				Format: <device path>[,<device path>[,...]]
    1.17 +				Format of device path: <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[...]]
    1.18 +				Specifies PCI device for guest domain.
    1.19 +				If PCI-PCI bridge is specified, all
    1.20 +				PCI devices behind PCI-PCI bridge are
    1.21 +				reserved.
    1.22  
    1.23  	pcmv=		[HW,PCMCIA] BadgePAD 4
    1.24  
     2.1 --- a/drivers/acpi/pci_root.c	Mon Jan 05 14:13:49 2009 +0900
     2.2 +++ b/drivers/acpi/pci_root.c	Wed Jan 07 12:21:54 2009 +0900
     2.3 @@ -151,6 +151,36 @@ static acpi_status try_get_root_bridge_b
     2.4  	return AE_OK;
     2.5  }
     2.6  
     2.7 +ssize_t
     2.8 +acpi_device_seg_show(struct acpi_device *acpi_dev, char *buf) 
     2.9 +{
    2.10 +	struct list_head *entry;
    2.11 +
    2.12 +	list_for_each(entry, &acpi_pci_roots) {
    2.13 +		struct acpi_pci_root *root;
    2.14 +		root = list_entry(entry, struct acpi_pci_root, node);
    2.15 +		if (root->device == acpi_dev)
    2.16 +			return sprintf(buf, "%04x\n", root->id.segment);
    2.17 +	}
    2.18 +	return 0;
    2.19 +}
    2.20 +ACPI_DEVICE_ATTR(seg, 0444, acpi_device_seg_show, NULL);
    2.21 +
    2.22 +ssize_t
    2.23 +acpi_device_bbn_show(struct acpi_device *acpi_dev, char *buf) 
    2.24 +{
    2.25 +	struct list_head *entry;
    2.26 +
    2.27 +	list_for_each(entry, &acpi_pci_roots) {
    2.28 +		struct acpi_pci_root *root;
    2.29 +		root = list_entry(entry, struct acpi_pci_root, node);
    2.30 +		if (root->device == acpi_dev)
    2.31 +			return sprintf(buf, "%02x\n", root->id.bus);
    2.32 +	}
    2.33 +	return 0;
    2.34 +}
    2.35 +ACPI_DEVICE_ATTR(bbn, 0444, acpi_device_bbn_show, NULL);
    2.36 +
    2.37  static int acpi_pci_root_add(struct acpi_device *device)
    2.38  {
    2.39  	int result = 0;
    2.40 @@ -298,6 +328,12 @@ static int acpi_pci_root_add(struct acpi
    2.41  	if (ACPI_SUCCESS(status))
    2.42  		result = acpi_pci_irq_add_prt(device->handle, root->id.segment,
    2.43  					      root->id.bus);
    2.44 +	if (result)
    2.45 +		goto end;
    2.46 +
    2.47 +	sysfs_create_file(&device->kobj, &acpi_device_attr_seg.attr);
    2.48 +
    2.49 +	sysfs_create_file(&device->kobj, &acpi_device_attr_bbn.attr);
    2.50  
    2.51        end:
    2.52  	if (result) {
    2.53 @@ -356,3 +392,32 @@ static int __init acpi_pci_root_init(voi
    2.54  }
    2.55  
    2.56  subsys_initcall(acpi_pci_root_init);
    2.57 +
    2.58 +int acpi_pci_get_root_seg_bbn(char *hid, char *uid, int *seg, int *bbn)
    2.59 +{
    2.60 +	struct list_head *entry;
    2.61 +
    2.62 +	list_for_each(entry, &acpi_pci_roots) {
    2.63 +		struct acpi_pci_root *root;
    2.64 +		root = list_entry(entry, struct acpi_pci_root, node);
    2.65 +		if (!root->device->flags.hardware_id)
    2.66 +			continue;
    2.67 +
    2.68 +		if (strcmp(root->device->pnp.hardware_id, hid))
    2.69 +			continue;
    2.70 +
    2.71 +		if (!root->device->flags.unique_id) {
    2.72 +			if (strlen(uid))
    2.73 +				continue;
    2.74 +		} else {
    2.75 +			if (strcmp(root->device->pnp.unique_id, uid))
    2.76 +				continue;
    2.77 +		}
    2.78 +
    2.79 +		*seg = (int)root->id.segment;
    2.80 +		*bbn = (int)root->id.bus;
    2.81 +		return TRUE;
    2.82 +	}
    2.83 +	return FALSE;
    2.84 +}
    2.85 +EXPORT_SYMBOL(acpi_pci_get_root_seg_bbn);
     3.1 --- a/drivers/acpi/scan.c	Mon Jan 05 14:13:49 2009 +0900
     3.2 +++ b/drivers/acpi/scan.c	Wed Jan 07 12:21:54 2009 +0900
     3.3 @@ -32,12 +32,6 @@ static void acpi_device_release(struct k
     3.4  	kfree(dev);
     3.5  }
     3.6  
     3.7 -struct acpi_device_attribute {
     3.8 -	struct attribute attr;
     3.9 -	 ssize_t(*show) (struct acpi_device *, char *);
    3.10 -	 ssize_t(*store) (struct acpi_device *, const char *, size_t);
    3.11 -};
    3.12 -
    3.13  typedef void acpi_device_sysfs_files(struct kobject *,
    3.14  				     const struct attribute *);
    3.15  
    3.16 @@ -111,6 +105,42 @@ static struct kset acpi_namespace_kset =
    3.17  	.uevent_ops = &namespace_uevent_ops,
    3.18  };
    3.19  
    3.20 +static ssize_t
    3.21 +acpi_device_hid_show(struct acpi_device *acpi_dev, char *buf) 
    3.22 +{
    3.23 +	return sprintf(buf, "%s\n", acpi_dev->pnp.hardware_id);
    3.24 +}
    3.25 +ACPI_DEVICE_ATTR(hid, 0444, acpi_device_hid_show, NULL);
    3.26 +
    3.27 +static ssize_t
    3.28 +acpi_device_uid_show(struct acpi_device *acpi_dev, char *buf) 
    3.29 +{
    3.30 +	return sprintf(buf, "%s\n", acpi_dev->pnp.unique_id);
    3.31 +}
    3.32 +ACPI_DEVICE_ATTR(uid, 0444, acpi_device_uid_show, NULL);
    3.33 +
    3.34 +static int acpi_device_setup_files(struct acpi_device *dev)
    3.35 +{
    3.36 +	int result = 0;
    3.37 +
    3.38 +	if (dev->flags.hardware_id) {
    3.39 +		result = sysfs_create_file(&dev->kobj,
    3.40 +					&acpi_device_attr_hid.attr);
    3.41 +		if (result)
    3.42 +			goto end;
    3.43 +	}
    3.44 +
    3.45 +	if (dev->flags.unique_id) {
    3.46 +		result = sysfs_create_file(&dev->kobj,
    3.47 +					&acpi_device_attr_uid.attr);
    3.48 +		if (result)
    3.49 +			goto end;
    3.50 +	}
    3.51 +
    3.52 +      end:
    3.53 +	return result;
    3.54 +}
    3.55 +
    3.56  static void acpi_device_register(struct acpi_device *device,
    3.57  				 struct acpi_device *parent)
    3.58  {
    3.59 @@ -146,6 +176,7 @@ static void acpi_device_register(struct 
    3.60  		printk(KERN_WARNING "%s: kobject_register error: %d\n",
    3.61  			__FUNCTION__, err);
    3.62  	create_sysfs_device_files(device);
    3.63 +	acpi_device_setup_files(device);
    3.64  }
    3.65  
    3.66  static void acpi_device_unregister(struct acpi_device *device, int type)
    3.67 @@ -344,10 +375,6 @@ static int acpi_bus_get_wakeup_device_fl
    3.68  static ssize_t acpi_eject_store(struct acpi_device *device,
    3.69  				const char *buf, size_t count);
    3.70  
    3.71 -#define ACPI_DEVICE_ATTR(_name,_mode,_show,_store) \
    3.72 -static struct acpi_device_attribute acpi_device_attr_##_name = \
    3.73 -		__ATTR(_name, _mode, _show, _store)
    3.74 -
    3.75  ACPI_DEVICE_ATTR(eject, 0200, NULL, acpi_eject_store);
    3.76  
    3.77  /**
     4.1 --- a/drivers/pci/Kconfig	Mon Jan 05 14:13:49 2009 +0900
     4.2 +++ b/drivers/pci/Kconfig	Wed Jan 07 12:21:54 2009 +0900
     4.3 @@ -30,3 +30,10 @@ config PCI_DEBUG
     4.4  
     4.5  	  When in doubt, say N.
     4.6  
     4.7 +config PCI_GUESTDEV
     4.8 +	bool "PCI Device Reservation for Passthrough"
     4.9 +	depends on PCI
    4.10 +	default y
    4.11 +	help
    4.12 +	  Say Y here if you want to reserve PCI device for passthrough.
    4.13 +
     5.1 --- a/drivers/pci/Makefile	Mon Jan 05 14:13:49 2009 +0900
     5.2 +++ b/drivers/pci/Makefile	Wed Jan 07 12:21:54 2009 +0900
     5.3 @@ -6,6 +6,7 @@ obj-y		+= access.o bus.o probe.o remove.
     5.4  			pci-driver.o search.o pci-sysfs.o rom.o setup-res.o
     5.5  obj-$(CONFIG_PCI_REASSIGN) += reassigndev.o
     5.6  obj-$(CONFIG_PROC_FS) += proc.o
     5.7 +obj-$(CONFIG_PCI_GUESTDEV) += guestdev.o
     5.8  
     5.9  # Build PCI Express stuff if needed
    5.10  obj-$(CONFIG_PCIEPORTBUS) += pcie/
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/drivers/pci/guestdev.c	Wed Jan 07 12:21:54 2009 +0900
     6.3 @@ -0,0 +1,668 @@
     6.4 +/*
     6.5 + * Copyright (c) 2008, NEC Corporation.
     6.6 + *
     6.7 + * This program is free software; you can redistribute it and/or modify it
     6.8 + * under the terms and conditions of the GNU General Public License,
     6.9 + * version 2, as published by the Free Software Foundation.
    6.10 + *
    6.11 + * This program is distributed in the hope it will be useful, but WITHOUT
    6.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    6.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    6.14 + * more details.
    6.15 + *
    6.16 + * You should have received a copy of the GNU General Public License along with
    6.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    6.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    6.19 + */
    6.20 +
    6.21 +#include <linux/kernel.h>
    6.22 +#include <linux/list.h>
    6.23 +#include <linux/mm.h>
    6.24 +#include <linux/pci.h>
    6.25 +#include <linux/module.h>
    6.26 +#include <linux/string.h>
    6.27 +#include <linux/acpi.h>
    6.28 +#include <asm-x86_64/setup.h>
    6.29 +
    6.30 +#define HID_LEN 8
    6.31 +#define UID_LEN 8
    6.32 +#define DEV_LEN 2
    6.33 +#define FUNC_LEN 1
    6.34 +#define DEV_NUM_MAX 31
    6.35 +#define FUNC_NUM_MAX 7
    6.36 +#define INVALID_SEG (-1)
    6.37 +#define INVALID_BBN (-1)
    6.38 +#define PATH_STR_MAX 128
    6.39 +
    6.40 +struct guestdev {
    6.41 +	struct list_head root_list;
    6.42 +	char hid[HID_LEN + 1];
    6.43 +	char uid[UID_LEN + 1];
    6.44 +	int seg;
    6.45 +	int bbn;
    6.46 +	struct guestdev_node *child;
    6.47 +};
    6.48 +
    6.49 +struct guestdev_node {
    6.50 +	int dev;
    6.51 +	int func;
    6.52 +	struct guestdev_node *child;
    6.53 +};
    6.54 +
    6.55 +struct pcidev_sbdf {
    6.56 +	int seg;
    6.57 +	int bus;
    6.58 +	struct pcidev_sbdf_node *child;
    6.59 +};
    6.60 +
    6.61 +struct pcidev_sbdf_node {
    6.62 +	int dev;
    6.63 +	int func;
    6.64 +	struct pcidev_sbdf_node *child;
    6.65 +};
    6.66 +
    6.67 +static int reassign_resources = 0;
    6.68 +
    6.69 +static char guestdev_param[COMMAND_LINE_SIZE];
    6.70 +LIST_HEAD(guestdev_list);
    6.71 +
    6.72 +/* Get hid and uid */
    6.73 +static int pci_get_hid_uid(char *str, char *hid, char *uid)
    6.74 +{
    6.75 +	char *sp, *ep;
    6.76 +	int len;
    6.77 +
    6.78 +	sp = str;
    6.79 +	ep = strchr(sp, ':');
    6.80 +	if (!ep) {
    6.81 +		ep = strchr(sp, '-');
    6.82 +		if (!ep)
    6.83 +			goto format_err_end;
    6.84 +	}
    6.85 +	/* hid length */
    6.86 +	len = ep - sp;
    6.87 +	if (len <= 0 || HID_LEN < len)
    6.88 +		goto format_err_end;
    6.89 +
    6.90 +	strncpy(hid, sp, len);
    6.91 +	hid[len] = '\0';
    6.92 +
    6.93 +	if (*ep == '-') { /* no uid */
    6.94 +		uid[0] = '\0';
    6.95 +		return TRUE;
    6.96 +	}
    6.97 +
    6.98 +	sp = ep + 1;
    6.99 +	ep = strchr(sp, '-');
   6.100 +	if (!ep)
   6.101 +		ep = strchr(sp, '\0');
   6.102 +
   6.103 +	/* uid length */
   6.104 +	len = ep - sp;
   6.105 +	if (len <= 0 || UID_LEN < len)
   6.106 +		goto format_err_end;
   6.107 +
   6.108 +	strncpy(uid, sp, len);
   6.109 +	uid[len] = '\0';
   6.110 +	return TRUE;
   6.111 +
   6.112 +format_err_end:
   6.113 +	return FALSE;
   6.114 +}
   6.115 +
   6.116 +/* Get device and function */
   6.117 +static int pci_get_dev_func(char *str, int *dev, int *func)
   6.118 +{
   6.119 +	if (sscanf(str, "%02x.%01x", dev, func) != 2)
   6.120 +		goto format_err_end;
   6.121 +
   6.122 +	if (*dev < 0 || DEV_NUM_MAX < *dev)
   6.123 +		goto format_err_end;
   6.124 +
   6.125 +	if (*func < 0 || FUNC_NUM_MAX < *func)
   6.126 +		goto format_err_end;
   6.127 +
   6.128 +	return TRUE;
   6.129 +
   6.130 +format_err_end:
   6.131 +	return FALSE;
   6.132 +}
   6.133 +
   6.134 +/* Check extended guestdev parameter format error */
   6.135 +static int pci_check_extended_guestdev_format(char *str)
   6.136 +{
   6.137 +	int flg;
   6.138 +	char *p;
   6.139 +
   6.140 +	/* Check extended format */
   6.141 +	if (strpbrk(str, "(|)") == NULL)
   6.142 +		return TRUE;
   6.143 +
   6.144 +	flg = 0;
   6.145 +	p = str;
   6.146 +	while (*p) {
   6.147 +		switch (*p) {
   6.148 +		case '(':
   6.149 +			/* Check nesting error */
   6.150 +			if (flg != 0)
   6.151 +				goto format_err_end;
   6.152 +			flg = 1;
   6.153 +			/* Check position of '(' is head or
   6.154 +			   previos charactor of '(' is not '-'. */
   6.155 +			if (p == str || *(p - 1) != '-')
   6.156 +				goto format_err_end;
   6.157 +			break;
   6.158 +		case ')':
   6.159 +			/* Check nesting error */
   6.160 +			if (flg != 1)
   6.161 +				goto format_err_end;
   6.162 +			flg = 0;
   6.163 +			/* Check next charactor of ')' is not '\0' */
   6.164 +			if (*(p + 1) != '\0')
   6.165 +				goto format_err_end;
   6.166 +			break;
   6.167 +		case '|':
   6.168 +			/* Check position of '|' is outside of '(' and ')' */
   6.169 +			if (flg != 1)
   6.170 +				goto format_err_end;
   6.171 +			break;
   6.172 +		default:
   6.173 +			break;
   6.174 +		}
   6.175 +		p++;
   6.176 +	}
   6.177 +	/* Check number of '(' and ')' are not equal */
   6.178 +	if (flg != 0)
   6.179 +		goto format_err_end;
   6.180 +	return TRUE;
   6.181 +
   6.182 +format_err_end:
   6.183 +	printk(KERN_ERR
   6.184 +		"PCI: The format of the guestdev parameter is illegal. [%s]\n",
   6.185 +		str);
   6.186 +	return FALSE;
   6.187 +}
   6.188 +
   6.189 +/* Make guestdev strings */
   6.190 +static void pci_make_guestdev_path_str(struct guestdev *gdev,
   6.191 +					char *gdev_str, int buf_size)
   6.192 +{
   6.193 +	struct guestdev_node *node;
   6.194 +	/* max length for "HID:UID" (hid+uid+':'+'\0') */
   6.195 +	const int hid_uid_len = HID_LEN + UID_LEN + 2;
   6.196 +	/* max length for "-DEV#.FUNC#" (dev+func+'-'+'.'+'\0') */
   6.197 +	const int dev_func_len = DEV_LEN + FUNC_LEN + 3;
   6.198 +
   6.199 +	/* check buffer size for HID:UID */
   6.200 +	if (buf_size < hid_uid_len)
   6.201 +		return;
   6.202 +
   6.203 +	memset(gdev_str, 0, buf_size);
   6.204 +
   6.205 +	if (strlen(gdev->uid))
   6.206 +		sprintf(gdev_str, "%s:%s", gdev->hid, gdev->uid);
   6.207 +	else
   6.208 +		sprintf(gdev_str, "%s", gdev->hid);
   6.209 +	buf_size -= strlen(gdev_str);
   6.210 +
   6.211 +	node = gdev->child;
   6.212 +	while (node) {
   6.213 +		/* check buffer size for -DEV#.FUNC# */
   6.214 +		if (buf_size < dev_func_len)
   6.215 +			return;
   6.216 +		sprintf(gdev_str + strlen(gdev_str), "-%02x.%01x",
   6.217 +			node->dev, node->func);
   6.218 +		buf_size -= dev_func_len;
   6.219 +		node = node->child;
   6.220 +	}
   6.221 +}
   6.222 +
   6.223 +/* Free guestdev and nodes */
   6.224 +static void pci_free_guestdev(struct guestdev *gdev)
   6.225 +{
   6.226 +	struct guestdev_node *node, *next;
   6.227 +
   6.228 +	if (!gdev)
   6.229 +		return;
   6.230 +
   6.231 +	node = gdev->child;
   6.232 +	while (node) {
   6.233 +		next = node->child;
   6.234 +		kfree(node);
   6.235 +		node = next;
   6.236 +	}
   6.237 +	list_del(&gdev->root_list);
   6.238 +	kfree(gdev);
   6.239 +}
   6.240 +
   6.241 +/* Free guestdev_list */
   6.242 +static void pci_free_guestdev_list(void)
   6.243 +{
   6.244 +	struct list_head *head, *tmp;
   6.245 +	struct guestdev *gdev;
   6.246 +
   6.247 +	list_for_each_safe(head, tmp, &guestdev_list) {
   6.248 +		gdev = list_entry(head, struct guestdev, root_list);
   6.249 +		pci_free_guestdev(gdev);
   6.250 +	}
   6.251 +}
   6.252 +
   6.253 +/* Copy guestdev and nodes */
   6.254 +struct guestdev *pci_copy_guestdev(struct guestdev *gdev_src)
   6.255 +{
   6.256 +	struct guestdev *gdev;
   6.257 +	struct guestdev_node *node, *node_src, *node_upper;
   6.258 +
   6.259 +	gdev = kmalloc(sizeof(*gdev), GFP_KERNEL);
   6.260 +	if (!gdev)
   6.261 +		goto allocate_err_end;
   6.262 +
   6.263 +	memset(gdev, 0, sizeof(*gdev));
   6.264 +	INIT_LIST_HEAD(&gdev->root_list);
   6.265 +	strcpy(gdev->hid, gdev_src->hid);
   6.266 +	strcpy(gdev->uid, gdev_src->uid);
   6.267 +	gdev->seg = gdev_src->seg;
   6.268 +	gdev->bbn = gdev_src->bbn;
   6.269 +
   6.270 +	node_upper = NULL;
   6.271 +
   6.272 +	node_src = gdev_src->child;
   6.273 +	while (node_src) {
   6.274 +		node = kmalloc(sizeof(*node), GFP_KERNEL);
   6.275 +		if (!node)
   6.276 +			goto allocate_err_end;
   6.277 +		memset(node, 0, sizeof(*node));
   6.278 +		node->dev = node_src->dev;
   6.279 +		node->func = node_src->func;
   6.280 +		if (!node_upper)
   6.281 +			gdev->child = node;
   6.282 +		else
   6.283 +			node_upper->child = node;
   6.284 +		node_upper = node;
   6.285 +		node_src = node_src->child;
   6.286 +	}
   6.287 +
   6.288 +	return gdev;
   6.289 +
   6.290 +allocate_err_end:
   6.291 +	if (gdev)
   6.292 +		pci_free_guestdev(gdev);
   6.293 +	printk(KERN_ERR "PCI: Failed to allocate memory.\n");
   6.294 +	return NULL;
   6.295 +}
   6.296 +
   6.297 +/* Make guestdev from path strings */
   6.298 +static int pci_make_guestdev(char *path_str)
   6.299 +{
   6.300 +	char hid[HID_LEN + 1], uid[UID_LEN + 1];
   6.301 +	char *sp, *ep;
   6.302 +	struct guestdev *gdev, *gdev_org;
   6.303 +	struct guestdev_node *node, *node_tmp;
   6.304 +	int dev, func, ret_val;
   6.305 +
   6.306 +	ret_val = 0;
   6.307 +	gdev = gdev_org = NULL;
   6.308 +	sp = path_str;
   6.309 +	/* Look for end of hid:uid'-' */
   6.310 +	ep = strchr(sp, '-');
   6.311 +	/* Only hid, uid. (No dev, func) */
   6.312 +	if (!ep)
   6.313 +		goto format_err_end;
   6.314 +
   6.315 +	memset(hid, 0 ,sizeof(hid));
   6.316 +	memset(uid, 0, sizeof(uid));
   6.317 +	if (!pci_get_hid_uid(sp, hid, uid))
   6.318 +		goto format_err_end;
   6.319 +
   6.320 +	gdev_org = kmalloc(sizeof(*gdev_org), GFP_KERNEL);
   6.321 +	if (!gdev_org)
   6.322 +		goto allocate_err_end;
   6.323 +	memset(gdev_org, 0, sizeof(*gdev_org));
   6.324 +	INIT_LIST_HEAD(&gdev_org->root_list);
   6.325 +	strcpy(gdev_org->hid, hid);
   6.326 +	strcpy(gdev_org->uid, uid);
   6.327 +	gdev_org->seg = INVALID_SEG;
   6.328 +	gdev_org->bbn = INVALID_BBN;
   6.329 +
   6.330 +	gdev = gdev_org;
   6.331 +
   6.332 +	sp = ep + 1;
   6.333 +	ep = sp;
   6.334 +	do {
   6.335 +		if (*sp == '(') {
   6.336 +			sp++;
   6.337 +			if (strchr(sp, '|')) {
   6.338 +				gdev = pci_copy_guestdev(gdev_org);
   6.339 +				if (!gdev) {
   6.340 +					ret_val = -ENOMEM;
   6.341 +					goto err_end;
   6.342 +				}
   6.343 +			}
   6.344 +			continue;
   6.345 +		}
   6.346 +		if (pci_get_dev_func(sp, &dev, &func)) {
   6.347 +			node = kmalloc(sizeof(*node), GFP_KERNEL);
   6.348 +			if (!node)
   6.349 +				goto allocate_err_end;
   6.350 +			memset(node, 0, sizeof(*node));
   6.351 +			node->dev = dev;
   6.352 +			node->func = func;
   6.353 +			/* add node to end of guestdev */
   6.354 +			if (gdev->child) {
   6.355 +				node_tmp = gdev->child;
   6.356 +				while (node_tmp->child) {
   6.357 +					node_tmp = node_tmp->child;
   6.358 +				}
   6.359 +				node_tmp->child = node;
   6.360 +			} else
   6.361 +				gdev->child = node;
   6.362 +		} else
   6.363 +			goto format_err_end;
   6.364 +
   6.365 +		ep = strpbrk(sp, "-|)");
   6.366 +		if (!ep)
   6.367 +			ep = strchr(sp, '\0');
   6.368 +		/* *ep is '|' OR ')' OR '\0' ? */
   6.369 +		if (*ep != '-') {
   6.370 +			list_add_tail(&gdev->root_list, &guestdev_list);
   6.371 +			if (*ep == '|') {
   6.372 +				/* Between '|' and '|' ? */
   6.373 +				if (strchr(ep + 1, '|')) {
   6.374 +					gdev = pci_copy_guestdev(gdev_org);
   6.375 +					if (!gdev) {
   6.376 +						ret_val = -ENOMEM;
   6.377 +						goto err_end;
   6.378 +					}
   6.379 +				} else
   6.380 +					gdev = gdev_org;
   6.381 +			}
   6.382 +		}
   6.383 +		if (*ep == ')')
   6.384 +			ep++;
   6.385 +		sp = ep + 1;
   6.386 +	} while (*ep != '\0');
   6.387 +
   6.388 +	return ret_val;
   6.389 +
   6.390 +format_err_end:
   6.391 +	printk(KERN_ERR
   6.392 +		"PCI: The format of the guestdev parameter is illegal. [%s]\n",
   6.393 +		path_str);
   6.394 +	ret_val = -EINVAL;
   6.395 +	goto err_end;
   6.396 +
   6.397 +allocate_err_end:
   6.398 +	printk(KERN_ERR "PCI: Failed to allocate memory.\n");
   6.399 +	ret_val = -ENOMEM;
   6.400 +	goto err_end;
   6.401 +
   6.402 +err_end:
   6.403 +	if (gdev_org && (gdev_org != gdev))
   6.404 +		pci_free_guestdev(gdev_org);
   6.405 +	if (gdev)
   6.406 +		pci_free_guestdev(gdev);
   6.407 +	return ret_val;
   6.408 +}
   6.409 +
   6.410 +/* Parse guestdev parameter */
   6.411 +static int __init pci_parse_guestdev(void)
   6.412 +{
   6.413 +	int len, ret_val;
   6.414 +	char *sp, *ep;
   6.415 +	struct list_head *head;
   6.416 +	struct guestdev *gdev;
   6.417 +	char path_str[PATH_STR_MAX];
   6.418 +
   6.419 +	ret_val = 0;
   6.420 +
   6.421 +	len = strlen(guestdev_param);
   6.422 +	if (len == 0)
   6.423 +		goto end;
   6.424 +
   6.425 +	sp = guestdev_param;
   6.426 +
   6.427 +	do {
   6.428 +		ep = strchr(sp, ',');
   6.429 +		/* Chop */
   6.430 +		if (ep)
   6.431 +			*ep = '\0';
   6.432 +		if (!pci_check_extended_guestdev_format(sp)) {
   6.433 +			pci_free_guestdev_list();
   6.434 +			return -EINVAL;
   6.435 +		}
   6.436 +
   6.437 +		ret_val = pci_make_guestdev(sp);
   6.438 +		if (ret_val) {
   6.439 +			pci_free_guestdev_list();
   6.440 +			return ret_val;
   6.441 +		}
   6.442 +		sp = ep + 1;
   6.443 +	} while (ep);
   6.444 +
   6.445 +	list_for_each(head, &guestdev_list) {
   6.446 +		gdev = list_entry(head, struct guestdev, root_list);
   6.447 +		pci_make_guestdev_path_str(gdev, path_str, PATH_STR_MAX);
   6.448 +		printk(KERN_DEBUG
   6.449 +			"PCI: %s has been reserved for guest domain.\n",
   6.450 +			path_str);
   6.451 +	}
   6.452 +
   6.453 +end:
   6.454 +	return ret_val;
   6.455 +}
   6.456 +
   6.457 +arch_initcall(pci_parse_guestdev);
   6.458 +
   6.459 +/* Get command line */
   6.460 +static int __init pci_guestdev_setup(char *str)
   6.461 +{
   6.462 +	if (strlen(str) >= COMMAND_LINE_SIZE)
   6.463 +		return 0;
   6.464 +	strcpy(guestdev_param, str);
   6.465 +	return 1;
   6.466 +}
   6.467 +
   6.468 +__setup("guestdev=", pci_guestdev_setup);
   6.469 +
   6.470 +/* Free sbdf and nodes */
   6.471 +static void pci_free_sbdf(struct pcidev_sbdf *sbdf)
   6.472 +{
   6.473 +	struct pcidev_sbdf_node *node, *next;
   6.474 +
   6.475 +	node = sbdf->child;
   6.476 +	while (node) {
   6.477 +		next = node->child;
   6.478 +		kfree(node);
   6.479 +		node = next;
   6.480 +	}
   6.481 +	/* Skip kfree(sbdf) */
   6.482 +}
   6.483 +
   6.484 +/* Is sbdf within guestdev */
   6.485 +static int pci_sbdf_in_guestdev_sub_tree(struct guestdev *gdev, 
   6.486 +					struct pcidev_sbdf *sbdf)
   6.487 +{
   6.488 +	int seg, bbn;
   6.489 +	struct guestdev_node *gdev_node;
   6.490 +	struct pcidev_sbdf_node *sbdf_node;
   6.491 +
   6.492 +	if (!gdev || !sbdf)
   6.493 +		return FALSE;
   6.494 +
   6.495 +	/* Compare seg and bbn */
   6.496 +	if (gdev->seg == INVALID_SEG || 
   6.497 +	    gdev->bbn == INVALID_BBN) {
   6.498 +		if (acpi_pci_get_root_seg_bbn(gdev->hid, 
   6.499 +		    gdev->uid, &seg, &bbn)) {
   6.500 +			gdev->seg = seg;
   6.501 +			gdev->bbn = bbn;
   6.502 +		} else
   6.503 +			return FALSE;
   6.504 +	}
   6.505 +
   6.506 +	if (gdev->seg != sbdf->seg || gdev->bbn != sbdf->bus)
   6.507 +		return FALSE;
   6.508 +
   6.509 +	gdev_node = gdev->child;
   6.510 +	sbdf_node = sbdf->child;
   6.511 +
   6.512 +	/* Compare dev and func */
   6.513 +	while (gdev_node) {
   6.514 +		if (!sbdf_node)
   6.515 +			return FALSE;
   6.516 +		if (gdev_node->dev != sbdf_node->dev ||
   6.517 +		    gdev_node->func != sbdf_node->func)
   6.518 +			return FALSE;
   6.519 +		gdev_node = gdev_node->child;
   6.520 +		sbdf_node = sbdf_node->child;
   6.521 +	}
   6.522 +	return TRUE;
   6.523 +}
   6.524 +
   6.525 +/* Get sbdf from device */
   6.526 +static int pci_get_sbdf_from_pcidev(
   6.527 +	struct pci_dev *dev, struct pcidev_sbdf *sbdf)
   6.528 +{
   6.529 +	struct pcidev_sbdf_node *node;
   6.530 +
   6.531 +	if (!dev)
   6.532 +		return FALSE;
   6.533 +
   6.534 +	for(;;) {
   6.535 +		node = kmalloc(sizeof(*node), GFP_KERNEL);
   6.536 +		if (!node) {
   6.537 +			printk(KERN_ERR "PCI: Failed to allocate memory.\n");
   6.538 +			goto err_end;
   6.539 +		}
   6.540 +		memset(node, 0, sizeof(*node));
   6.541 +		node->dev = PCI_SLOT(dev->devfn);
   6.542 +		node->func = PCI_FUNC(dev->devfn);
   6.543 +
   6.544 +		if (!sbdf->child)
   6.545 +			sbdf->child = node;
   6.546 +		else {
   6.547 +			node->child = sbdf->child;
   6.548 +			sbdf->child = node;
   6.549 +		}
   6.550 +		if (!dev->bus)
   6.551 +			goto err_end;
   6.552 +		if (!dev->bus->self)
   6.553 +			break;
   6.554 +		dev = dev->bus->self;
   6.555 +	}
   6.556 +	if (sscanf(dev->dev.bus_id, "%04x:%02x", &sbdf->seg, &sbdf->bus) != 2)
   6.557 +		goto err_end;
   6.558 +	return TRUE;
   6.559 +
   6.560 +err_end:
   6.561 +	pci_free_sbdf(sbdf);
   6.562 +	return FALSE;
   6.563 +}
   6.564 +
   6.565 +/* Is PCI device belongs to the subtree of the guestdev parameter */
   6.566 +int pci_is_guestdev(struct pci_dev *dev)
   6.567 +{
   6.568 +	struct guestdev *gdev;
   6.569 +	struct pcidev_sbdf sbdf;
   6.570 +	struct list_head *head;
   6.571 +	int result;
   6.572 +
   6.573 +	if (!dev)
   6.574 +		return FALSE;
   6.575 +	memset(&sbdf, 0 ,sizeof(sbdf));
   6.576 +	if (!pci_get_sbdf_from_pcidev(dev, &sbdf))
   6.577 +		return FALSE;
   6.578 +
   6.579 +	result = FALSE;
   6.580 +	list_for_each(head, &guestdev_list) {
   6.581 +		gdev = list_entry(head, struct guestdev, root_list);
   6.582 +		if (pci_sbdf_in_guestdev_sub_tree(gdev, &sbdf)) {
   6.583 +			result = TRUE;
   6.584 +			break;
   6.585 +		}
   6.586 +	}
   6.587 +	pci_free_sbdf(&sbdf);
   6.588 +	return result;
   6.589 +}
   6.590 +EXPORT_SYMBOL(pci_is_guestdev);
   6.591 +
   6.592 +static int __init pci_set_reassign_resources(char *str)
   6.593 +{
   6.594 +	reassign_resources = 1;
   6.595 +
   6.596 +	return 1;
   6.597 +}
   6.598 +
   6.599 +__setup("reassign_resources", pci_set_reassign_resources);
   6.600 +
   6.601 +int pci_is_guestdev_to_reassign(struct pci_dev *dev)
   6.602 +{
   6.603 +	if (reassign_resources)
   6.604 +		return pci_is_guestdev(dev);
   6.605 +	return FALSE;
   6.606 +}
   6.607 +EXPORT_SYMBOL(pci_is_guestdev_to_reassign);
   6.608 +
   6.609 +/* Check whether the guestdev exists under the pci root bus */
   6.610 +static int __init pci_check_guestdev_path_exists(
   6.611 +		struct guestdev *gdev, struct pci_bus *bus)
   6.612 +{
   6.613 +	struct guestdev_node *node;
   6.614 +	struct pci_dev *dev;
   6.615 +
   6.616 +	node = gdev->child;
   6.617 +	while (node) {
   6.618 +		if (!bus)
   6.619 +			return FALSE;
   6.620 +		dev = pci_get_slot(bus, PCI_DEVFN(node->dev, node->func));
   6.621 +		if (!dev) {
   6.622 +			pci_dev_put(dev);
   6.623 +			return FALSE;
   6.624 +		}
   6.625 +		bus = dev->subordinate;
   6.626 +		node = node->child;
   6.627 +		pci_dev_put(dev);
   6.628 +	}
   6.629 +	return TRUE;
   6.630 +}
   6.631 +
   6.632 +/* Check whether the guestdev exists in the PCI device tree */
   6.633 +static int __init pci_check_guestdev_exists(void)
   6.634 +{
   6.635 +	struct list_head *head;
   6.636 +	struct guestdev *gdev;
   6.637 +	int seg, bbn;
   6.638 +	struct pci_bus *bus;
   6.639 +	char path_str[PATH_STR_MAX];
   6.640 +
   6.641 +	list_for_each(head, &guestdev_list) {
   6.642 +		gdev = list_entry(head, struct guestdev, root_list);
   6.643 +		if (gdev->seg == INVALID_SEG ||
   6.644 +			gdev->bbn == INVALID_BBN) {
   6.645 +			if (acpi_pci_get_root_seg_bbn(gdev->hid,
   6.646 +				gdev->uid, &seg, &bbn)) {
   6.647 +				gdev->seg = seg;
   6.648 +				gdev->bbn = bbn;
   6.649 +			} else {
   6.650 +				pci_make_guestdev_path_str(gdev, path_str,
   6.651 +					PATH_STR_MAX);
   6.652 +				printk(KERN_INFO
   6.653 +					"PCI: Device does not exist. %s\n",
   6.654 +					path_str);
   6.655 +				continue;
   6.656 +			}
   6.657 +		}
   6.658 +
   6.659 +		bus = pci_find_bus(gdev->seg, gdev->bbn);
   6.660 +		if (!bus || !pci_check_guestdev_path_exists(gdev, bus)) {
   6.661 +			pci_make_guestdev_path_str(gdev, path_str,
   6.662 +				PATH_STR_MAX);
   6.663 +			printk(KERN_INFO
   6.664 +				"PCI: Device does not exist. %s\n", path_str);
   6.665 +		}
   6.666 +	}
   6.667 +	return 0;
   6.668 +}
   6.669 +
   6.670 +fs_initcall(pci_check_guestdev_exists);
   6.671 +
     7.1 --- a/drivers/pci/pci.h	Mon Jan 05 14:13:49 2009 +0900
     7.2 +++ b/drivers/pci/pci.h	Wed Jan 07 12:21:54 2009 +0900
     7.3 @@ -100,8 +100,12 @@ pci_match_one_device(const struct pci_de
     7.4  }
     7.5  
     7.6  #ifdef CONFIG_PCI_REASSIGN
     7.7 -extern int is_reassigndev(struct pci_dev *dev);
     7.8 +extern int pci_is_reassigndev(struct pci_dev *dev);
     7.9  extern void pci_disable_bridge_window(struct pci_dev *dev);
    7.10  #else
    7.11 -#define is_reassigndev(dev) 0
    7.12 +#define pci_is_reassigndev(dev) 0
    7.13  #endif
    7.14 +
    7.15 +#ifdef CONFIG_PCI_GUESTDEV
    7.16 +int pci_is_guestdev_to_reassign(struct pci_dev *dev);
    7.17 +#endif /* CONFIG_PCI_GUESTDEV */
     8.1 --- a/drivers/pci/quirks.c	Mon Jan 05 14:13:49 2009 +0900
     8.2 +++ b/drivers/pci/quirks.c	Wed Jan 07 12:21:54 2009 +0900
     8.3 @@ -36,7 +36,7 @@ static void __devinit quirk_release_reso
     8.4  	int i;
     8.5  	struct resource *r;
     8.6  
     8.7 -	if (is_reassigndev(dev)) {
     8.8 +	if (pci_is_reassigndev(dev)) {
     8.9  		if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
    8.10  		    (dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) {
    8.11  			/* PCI Host Bridge isn't a target device */
     9.1 --- a/drivers/pci/reassigndev.c	Mon Jan 05 14:13:49 2009 +0900
     9.2 +++ b/drivers/pci/reassigndev.c	Wed Jan 07 12:21:54 2009 +0900
     9.3 @@ -26,20 +26,27 @@
     9.4  
     9.5  static char param_reassigndev[REASSIGNDEV_PARAM_MAX] = {0};
     9.6  
     9.7 -static int __init reassigndev_setup(char *str)
     9.8 +static int __init pci_reassigndev_setup(char *str)
     9.9  {
    9.10  	strncpy(param_reassigndev, str, REASSIGNDEV_PARAM_MAX);
    9.11  	param_reassigndev[REASSIGNDEV_PARAM_MAX - 1] = '\0';
    9.12  	return 1;
    9.13  }
    9.14 -__setup("reassigndev=", reassigndev_setup);
    9.15 +__setup("reassigndev=", pci_reassigndev_setup);
    9.16  
    9.17 -int is_reassigndev(struct pci_dev *dev)
    9.18 +int pci_is_reassigndev(struct pci_dev *dev)
    9.19  {
    9.20  	char dev_str[TOKEN_MAX+1];
    9.21  	int seg, bus, slot, func;
    9.22  	int len;
    9.23  	char *p, *next_str;
    9.24 +	int result;
    9.25 +
    9.26 +#ifdef CONFIG_PCI_GUESTDEV
    9.27 +	result = pci_is_guestdev_to_reassign(dev);
    9.28 +	if (result)
    9.29 +		return	result;
    9.30 +#endif /* CONFIG_PCI_GUESTDEV */
    9.31  
    9.32  	p = param_reassigndev;
    9.33  	for (; p; p = next_str + 1) {
    10.1 --- a/drivers/pci/setup-bus.c	Mon Jan 05 14:13:49 2009 +0900
    10.2 +++ b/drivers/pci/setup-bus.c	Wed Jan 07 12:21:54 2009 +0900
    10.3 @@ -345,7 +345,7 @@ pbus_size_mem(struct pci_bus *bus, unsig
    10.4  
    10.5  	list_for_each_entry(dev, &bus->devices, bus_list) {
    10.6  		int i;
    10.7 -		int reassign = is_reassigndev(dev);
    10.8 +		int reassign = pci_is_reassigndev(dev);
    10.9  
   10.10  		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
   10.11  			struct resource *r = &dev->resource[i];
    11.1 --- a/drivers/pci/setup-res.c	Mon Jan 05 14:13:49 2009 +0900
    11.2 +++ b/drivers/pci/setup-res.c	Wed Jan 07 12:21:54 2009 +0900
    11.3 @@ -138,7 +138,7 @@ int pci_assign_resource(struct pci_dev *
    11.4  	struct resource *res = dev->resource + resno;
    11.5  	resource_size_t size, min, align;
    11.6  	int ret;
    11.7 -	int reassigndev = is_reassigndev(dev);
    11.8 +	int reassigndev = pci_is_reassigndev(dev);
    11.9  
   11.10  	size = res->end - res->start + 1;
   11.11  	min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
   11.12 @@ -234,7 +234,7 @@ void __devinit
   11.13  pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
   11.14  {
   11.15  	int i;
   11.16 -	int reassigndev = is_reassigndev(dev);
   11.17 +	int reassigndev = pci_is_reassigndev(dev);
   11.18  
   11.19  	for (i = 0; i < PCI_NUM_RESOURCES; i++) {
   11.20  		struct resource *r;
   11.21 @@ -271,7 +271,7 @@ pdev_sort_resources(struct pci_dev *dev,
   11.22  					ln->res->start;
   11.23  				if ((idx < PCI_BRIDGE_RESOURCES) &&
   11.24  				    (ln->res->flags & IORESOURCE_MEM) &&
   11.25 -				    is_reassigndev(ln->dev))
   11.26 +				    pci_is_reassigndev(ln->dev))
   11.27  					align = ALIGN(align, PAGE_SIZE);
   11.28  			}
   11.29  			if (r_align > align) {
    12.1 --- a/drivers/xen/evtchn/evtchn.c	Mon Jan 05 14:13:49 2009 +0900
    12.2 +++ b/drivers/xen/evtchn/evtchn.c	Wed Jan 07 12:21:54 2009 +0900
    12.3 @@ -497,20 +497,22 @@ static int __cpuinit evtchn_cpu_notify(s
    12.4  {
    12.5  	int hotcpu = (unsigned long)hcpu;
    12.6  	cpumask_t map = cpu_online_map;
    12.7 -	int port, newcpu;
    12.8 +	int i, j, newcpu;
    12.9  	struct per_user_data *u;
   12.10  
   12.11  	switch (action) {
   12.12  	case CPU_DOWN_PREPARE:
   12.13  		cpu_clear(hotcpu, map);
   12.14  		spin_lock_irq(&port_user_lock);
   12.15 -		for (port = 0; port < NR_EVENT_CHANNELS; port++) {
   12.16 -			if ((u = port_user[port]) != NULL && 
   12.17 -			    u->bind_cpu == hotcpu &&
   12.18 -			    (newcpu = next_bind_cpu(map)) < NR_CPUS) {
   12.19 -				rebind_evtchn_to_cpu(port, newcpu);
   12.20 -				u->bind_cpu = newcpu;
   12.21 -			}
   12.22 +		for (i = 0; i < NR_EVENT_CHANNELS; i++) {
   12.23 +			u = port_user[i];
   12.24 +			if ((u == NULL) || (u->bind_cpu != hotcpu))
   12.25 +				continue;
   12.26 +			newcpu = next_bind_cpu(map);
   12.27 +			for (j = i; j < NR_EVENT_CHANNELS; j++)
   12.28 +				if (port_user[j] == u)
   12.29 +					rebind_evtchn_to_cpu(j, newcpu);
   12.30 +			u->bind_cpu = newcpu;
   12.31  		}
   12.32  		spin_unlock_irq(&port_user_lock);
   12.33  		break;
    13.1 --- a/drivers/xen/pciback/pci_stub.c	Mon Jan 05 14:13:49 2009 +0900
    13.2 +++ b/drivers/xen/pciback/pci_stub.c	Wed Jan 07 12:21:54 2009 +0900
    13.3 @@ -427,6 +427,16 @@ static int __devinit pcistub_probe(struc
    13.4  
    13.5  		dev_info(&dev->dev, "seizing device\n");
    13.6  		err = pcistub_seize(dev);
    13.7 +#ifdef CONFIG_PCI_GUESTDEV
    13.8 +	} else if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
    13.9 +		if (!pci_is_guestdev(dev)) {
   13.10 +			err = -ENODEV;
   13.11 +			goto out;
   13.12 +		}
   13.13 +
   13.14 +		dev_info(&dev->dev, "seizing device\n");
   13.15 +		err = pcistub_seize(dev);
   13.16 +#endif /* CONFIG_PCI_GUESTDEV */
   13.17  	} else
   13.18  		/* Didn't find the device */
   13.19  		err = -ENODEV;
    14.1 --- a/include/acpi/acpi_bus.h	Mon Jan 05 14:13:49 2009 +0900
    14.2 +++ b/include/acpi/acpi_bus.h	Wed Jan 07 12:21:54 2009 +0900
    14.3 @@ -359,6 +359,16 @@ acpi_handle acpi_get_child(acpi_handle, 
    14.4  acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
    14.5  #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data))
    14.6  
    14.7 +#define ACPI_DEVICE_ATTR(_name,_mode,_show,_store) \
    14.8 +static struct acpi_device_attribute acpi_device_attr_##_name = \
    14.9 +		__ATTR(_name, _mode, _show, _store)
   14.10 +
   14.11 +struct acpi_device_attribute {
   14.12 +	struct attribute attr;
   14.13 +	ssize_t(*show) (struct acpi_device *, char *);
   14.14 +	ssize_t(*store) (struct acpi_device *, const char *, size_t);
   14.15 +};
   14.16 +
   14.17  #endif /* CONFIG_ACPI */
   14.18  
   14.19  #endif /*__ACPI_BUS_H__*/
    15.1 --- a/include/asm-x86_64/setup.h	Mon Jan 05 14:13:49 2009 +0900
    15.2 +++ b/include/asm-x86_64/setup.h	Wed Jan 07 12:21:54 2009 +0900
    15.3 @@ -1,6 +1,6 @@
    15.4  #ifndef _x8664_SETUP_H
    15.5  #define _x8664_SETUP_H
    15.6  
    15.7 -#define COMMAND_LINE_SIZE	256
    15.8 +#define COMMAND_LINE_SIZE	1024
    15.9  
   15.10  #endif
    16.1 --- a/include/linux/acpi.h	Mon Jan 05 14:13:49 2009 +0900
    16.2 +++ b/include/linux/acpi.h	Wed Jan 07 12:21:54 2009 +0900
    16.3 @@ -406,6 +406,7 @@ int acpi_parse_mcfg (unsigned long phys_
    16.4  void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
    16.5  void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
    16.6  void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
    16.7 +int acpi_pci_get_root_seg_bbn(char *hid, char *uid, int *seg, int *bbn);
    16.8  
    16.9  /* the following four functions are architecture-dependent */
   16.10  #ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
    17.1 --- a/include/linux/pci.h	Mon Jan 05 14:13:49 2009 +0900
    17.2 +++ b/include/linux/pci.h	Wed Jan 07 12:21:54 2009 +0900
    17.3 @@ -804,5 +804,9 @@ extern int pci_pci_problems;
    17.4  #define PCIPCI_VSFX		16
    17.5  #define PCIPCI_ALIMAGIK		32
    17.6  
    17.7 +#ifdef CONFIG_PCI_GUESTDEV
    17.8 +int pci_is_guestdev(struct pci_dev *dev);
    17.9 +#endif /* CONFIG_PCI_GUESTDEV */
   17.10 +
   17.11  #endif /* __KERNEL__ */
   17.12  #endif /* LINUX_PCI_H */