In these following patches: [PATCH 1/5] xenbus_walk - walk XenStore keys, calling callback. [PATCH 2/5] In xen_create_msi_irq, extract the domain id of the MSI device. We employ an mechanism (as compared to 2.6.18), to extract the domain id of the non-privileged domain. Specifically we enumerate the XenStore keys and if a match is found we can extract the domain id. With the domain id we can make the Xen-HYPERCALL to set the "owner" of the MSI device. The next patches: [PATCH 3/5] Add MSI capability to the pciback driver. [PATCH 4/5] Return the physical IRQ number instead of the allocated IRQ number to pcifront. Copy-n-paste the MSI support from 2.6.18 and augment it to return the proper IRQ number to the pcifront. The last patch: [PATCH 5/5] Fix checkpatch warnings and errors for pciback/ directory. is just to have a clean base for futher work. And the diffstat of all the changes: drivers/xen/events.c | 53 +++++++- drivers/xen/pciback/Makefile | 1 + drivers/xen/pciback/conf_space.c | 34 ++-- drivers/xen/pciback/conf_space.h | 30 ++-- drivers/xen/pciback/conf_space_capability.c | 5 +- drivers/xen/pciback/conf_space_capability.h | 3 + drivers/xen/pciback/conf_space_capability_msi.c | 84 +++++++++++ drivers/xen/pciback/conf_space_capability_pm.c | 4 +- drivers/xen/pciback/conf_space_capability_vpd.c | 2 +- drivers/xen/pciback/conf_space_header.c | 7 +- drivers/xen/pciback/conf_space_quirks.c | 16 +- drivers/xen/pciback/controller.c | 15 +- drivers/xen/pciback/passthrough.c | 6 +- drivers/xen/pciback/pci_stub.c | 180 ++++++++++++----------- drivers/xen/pciback/pciback.h | 34 ++++- drivers/xen/pciback/pciback_ops.c | 64 +++++---- drivers/xen/pciback/slot.c | 22 ++- drivers/xen/pciback/vpci.c | 28 ++-- drivers/xen/pciback/xenbus.c | 42 +++--- drivers/xen/xenbus/xenbus_xs.c | 130 ++++++++++++++++ include/xen/xenbus.h | 2 + 21 files changed, 538 insertions(+), 224 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2009-Nov-05 20:25 UTC
[Xen-devel] [PATCH 1/5] xenbus_walk - walk XenStore keys, calling callback.
This is quite similar to ''pci_walk_bus.'' We walk the XenStore keys, starting at the initial path, calling the callback with each key that has a value. If the callback returns a negative value we stop, clean up, and return the value back. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/xen/xenbus/xenbus_xs.c | 130 ++++++++++++++++++++++++++++++++++++++++ include/xen/xenbus.h | 2 + 2 files changed, 132 insertions(+), 0 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index eab33f1..6a03d22 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -67,6 +67,13 @@ struct xs_stored_msg { } u; }; +/* Temporary structure used by xenbus_walk to collect all of the + * paths in a stack for traversing. */ +struct xs_data_tuple { + struct list_head list; + char *path; +}; + struct xs_handle { /* A list of replies. Currently only one will ever be outstanding. */ struct list_head reply_list; @@ -111,6 +118,35 @@ static pid_t xenwatch_pid; static DEFINE_MUTEX(xenwatch_mutex); static DECLARE_WAIT_QUEUE_HEAD(watch_events_waitq); +static struct xs_data_tuple *add_tuple(struct list_head *list, char *path) +{ + struct xs_data_tuple *data; + + data = kzalloc(sizeof(struct xs_data_tuple), GFP_KERNEL); + if (!data) { + printk(KERN_ERR "%s: could not allocate memory\n", __func__); + return NULL; + } + + data->path = path; + list_add_tail(&data->list, list); + + return data; +} + +static int free_tuple(struct xs_data_tuple *data) +{ + + if (!data) + return 0; + + kfree(data->path); + + kfree(data); + return 0; +} + + static int get_error(const char *errorstring) { unsigned int i; @@ -367,6 +403,100 @@ void *xenbus_read(struct xenbus_transaction t, } EXPORT_SYMBOL_GPL(xenbus_read); + +/* + * A traverse of XenStore directory using a stack based + * implementation. For each file the callback function + * is called with: + * cb(path, filename, value, userdata); + * + * Zero return value continues the walk, while any other + * exits and returns the value. The value passed in the callback + * are automatically free-d. + * + */ +int xenbus_walk(char *start_path, + int (*cb)(char *, char *, char *, void *), + void *userdata) +{ + + struct list_head list; + struct xs_data_tuple *tuple, *tmp; + char **dir; + char *newpath, *val; + unsigned int i, dir_n; + int rc = 0; + + if (!cb) + return -ENONET; + + if (!xenstored_ready) + return -EBUSY; + + INIT_LIST_HEAD(&list); + + /* Item added to the top. */ + newpath = kasprintf(GFP_KERNEL, "%s", start_path); + if (!add_tuple(&list, newpath)) + goto err_start; + + tuple = list_entry(&list, struct xs_data_tuple, list); + while (!list_empty(&list) && !rc) { + /* Pop first element. */ + tuple = list_entry(list.next, struct xs_data_tuple, list); + if (!tuple) + goto err_while; + list_del(&tuple->list); + /* And start listening ''em. */ + dir = xenbus_directory(XBT_NIL, tuple->path, "", &dir_n); + if (IS_ERR(dir)) { + /* This will happen on XenStore directories we don''t + * have access to. (Like for other domains).*/ + free_tuple(tuple); + continue; + } + for (i = 0; i < dir_n; i++) { + if (tuple->path && + tuple->path[strlen(tuple->path)-1] != ''/'') { + val = xenbus_read(XBT_NIL, tuple->path, dir[i], + NULL); + if (!IS_ERR(val)) { + /* Same thing as with xenbus_directory. + * Some values are protected.*/ + rc = cb(tuple->path, dir[i], + val, userdata); + kfree(val); + } + } + if (rc) + break; + newpath = kasprintf(GFP_KERNEL, "%s%s%s", tuple->path, + tuple->path[strlen(tuple->path)-1] =+ ''/'' ? "" : "/", + dir[i]); + + if (!newpath) + goto err_loop; + if (!add_tuple(&list, newpath)) + goto err_loop; + } + kfree(dir); + free_tuple(tuple); + } + goto err_while; +err_loop: + kfree(dir); +err_start: + kfree(newpath); +err_while: + list_for_each_entry_safe(tuple, tmp, &list, list) { + list_del(&tuple->list); + free_tuple(tuple); + } + return rc; +} +EXPORT_SYMBOL_GPL(xenbus_walk); + /* Write the value of a single file. * Returns -err on failure. */ diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 542ca7c..84dc8b0 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h @@ -229,4 +229,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); +int xenbus_walk(char *start_path, int (*cb)(char *, char *, char *, void *), + void *userdata); #endif /* _XEN_XENBUS_H */ -- 1.6.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2009-Nov-05 20:25 UTC
[Xen-devel] [PATCH 2/5] In xen_create_msi_irq, extract the domain id of the MSI device.
We walk the XenStore keys to see if there is a matching PCI device that is assigned to a non-privileged PV domain (that uses the pciback module). If so, we extract the domain id and use that for to map the IPI for the MSI to the correct guest. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/xen/events.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 2 deletions(-) diff --git a/drivers/xen/events.c b/drivers/xen/events.c index d3c267f..41772d5 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -45,6 +45,7 @@ #include <xen/interface/xen.h> #include <xen/interface/event_channel.h> +#include <xen/xenbus.h> #include "../pci/msi.h" /* @@ -92,6 +93,7 @@ struct irq_info unsigned short nr; unsigned char vector; unsigned char flags; + domid_t domid; } pirq; } u; }; @@ -148,7 +150,8 @@ static struct irq_info mk_pirq_info(unsigned short evtchn, unsigned short pirq, unsigned short vector) { return (struct irq_info) { .type = IRQT_PIRQ, .evtchn = evtchn, - .cpu = 0, .u.pirq = { .nr = pirq, .vector = vector } }; + .cpu = 0, .u.pirq + { .nr = pirq, .vector = vector, .domid = DOMID_SELF } }; } /* @@ -595,7 +598,7 @@ int xen_destroy_irq(int irq) goto out; unmap_irq.pirq = info->u.pirq.nr; - unmap_irq.domid = DOMID_SELF; + unmap_irq.domid = info->u.pirq.domid; rc = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap_irq); if (rc) { printk(KERN_WARNING "unmap irq failed %d\n", rc); @@ -610,6 +613,43 @@ out: spin_unlock(&irq_mapping_update_lock); return rc; } +#define XS_PCI_SEARCH "/local/domain/0/backend/pci/" +#define XS_PCI_SEARCH_LEN 28 + +static int get_domid_for_dev(char *nodename, char *path, char *val, void *data) +{ + struct pci_dev *dev = (struct pci_dev *)data; + + /* We are looking for: + * CB inv[/local/domain/0/backend/pci/3/0/dev-1]=0000:00:14.5 */ + + if (!dev || !pci_name(dev)) + return -ENODEV; + + if (strncmp(nodename, XS_PCI_SEARCH, XS_PCI_SEARCH_LEN) == 0) + { + if (strncmp(path, "dev", 3) == 0) { + char *name = NULL; + unsigned int domid; + + /* The val contains: 0000:00:14.5 */ + if (strcmp(val, pci_name(dev)) != 0) + return 0; + + /* From here on, extract the Domain ID */ + name = strstr(nodename, "pci/"); + if (!name) + return 0; + + if (sscanf(name, "pci/%u", &domid) != 1) + return 0; + + dev_dbg(&dev->dev,"Assigned to domain %u.\n", domid); + return domid; + } + } + return 0; +} int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type) { @@ -620,6 +660,12 @@ int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type) int pos; u32 table_offset, bir; + /* Walk the XenStore keys to see if the device is assigned to any + * domain. If so, extract the domain id. */ + domid = rc = xenbus_walk( "/local/domain/0", get_domid_for_dev, dev); + if (domid <= 0) + domid = DOMID_SELF; + memset(&map_irq, 0, sizeof(map_irq)); map_irq.domid = domid; map_irq.type = MAP_PIRQ_TYPE_MSI; @@ -658,6 +704,9 @@ int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type) } irq_info[irq] = mk_pirq_info(0, map_irq.pirq, map_irq.index); + if (domid) + irq_info[irq].u.pirq.domid = domid; + set_irq_chip_and_handler_name(irq, &xen_pirq_chip, handle_level_irq, (type == PCI_CAP_ID_MSIX) ? "msi-x":"msi"); -- 1.6.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2009-Nov-05 20:25 UTC
[Xen-devel] [PATCH 3/5] Add MSI capability to the pciback driver.
This is a reverse commit of a previous patch that disabled the functionality. It is essentially a copy of the MSI functionality from the linux-2.6.18.hg tree. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/xen/pciback/Makefile | 1 + drivers/xen/pciback/conf_space_capability_msi.c | 79 +++++++++++++++++++++++ drivers/xen/pciback/pci_stub.c | 15 ++++ drivers/xen/pciback/pciback.h | 14 ++++ drivers/xen/pciback/pciback_ops.c | 14 ++++ 5 files changed, 123 insertions(+), 0 deletions(-) create mode 100644 drivers/xen/pciback/conf_space_capability_msi.c diff --git a/drivers/xen/pciback/Makefile b/drivers/xen/pciback/Makefile index a99bdaa..106dae7 100644 --- a/drivers/xen/pciback/Makefile +++ b/drivers/xen/pciback/Makefile @@ -6,6 +6,7 @@ pciback-y += conf_space.o conf_space_header.o \ conf_space_capability_vpd.o \ conf_space_capability_pm.o \ conf_space_quirks.o +pciback-$(CONFIG_PCI_MSI) += conf_space_capability_msi.o pciback-$(CONFIG_XEN_PCIDEV_BACKEND_VPCI) += vpci.o pciback-$(CONFIG_XEN_PCIDEV_BACKEND_SLOT) += slot.o pciback-$(CONFIG_XEN_PCIDEV_BACKEND_PASS) += passthrough.o diff --git a/drivers/xen/pciback/conf_space_capability_msi.c b/drivers/xen/pciback/conf_space_capability_msi.c new file mode 100644 index 0000000..762e396 --- /dev/null +++ b/drivers/xen/pciback/conf_space_capability_msi.c @@ -0,0 +1,79 @@ +/* + * PCI Backend -- Configuration overlay for MSI capability + */ +#include <linux/pci.h> +#include <linux/slab.h> +#include "conf_space.h" +#include "conf_space_capability.h" +#include <xen/interface/io/pciif.h> +#include "pciback.h" + +int pciback_enable_msi(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op) +{ + int otherend = pdev->xdev->otherend_id; + int status; + + status = pci_enable_msi(dev); + + if (status) { + printk("error enable msi for guest %x status %x\n", otherend, status); + op->value = 0; + return XEN_PCI_ERR_op_failed; + } + + op->value = dev->irq; + return 0; +} + +int pciback_disable_msi(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op) +{ + pci_disable_msi(dev); + + op->value = dev->irq; + return 0; +} + +int pciback_enable_msix(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op) +{ + int i, result; + struct msix_entry *entries; + + if (op->value > SH_INFO_MAX_VEC) + return -EINVAL; + + entries = kmalloc(op->value * sizeof(*entries), GFP_KERNEL); + if (entries == NULL) + return -ENOMEM; + + for (i = 0; i < op->value; i++) { + entries[i].entry = op->msix_entries[i].entry; + entries[i].vector = op->msix_entries[i].vector; + } + + result = pci_enable_msix(dev, entries, op->value); + + for (i = 0; i < op->value; i++) { + op->msix_entries[i].entry = entries[i].entry; + op->msix_entries[i].vector = entries[i].vector; + } + + kfree(entries); + + op->value = result; + + return result; +} + +int pciback_disable_msix(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op) +{ + + pci_disable_msix(dev); + + op->value = dev->irq; + return 0; +} + diff --git a/drivers/xen/pciback/pci_stub.c b/drivers/xen/pciback/pci_stub.c index 5ea594b..88c742b 100644 --- a/drivers/xen/pciback/pci_stub.c +++ b/drivers/xen/pciback/pci_stub.c @@ -1173,6 +1173,21 @@ static ssize_t permissive_show(struct device_driver *drv, char *buf) DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, permissive_add); +#ifdef CONFIG_PCI_MSI + +int pciback_get_owner(struct pci_dev *dev) +{ + struct pcistub_device *psdev; + + psdev = pcistub_device_find(pci_domain_nr(dev->bus), dev->bus->number, + PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); + + if (!psdev || !psdev->pdev) + return -1; + + return psdev->pdev->xdev->otherend_id; +} +#endif static void pcistub_exit(void) { diff --git a/drivers/xen/pciback/pciback.h b/drivers/xen/pciback/pciback.h index 421b81e..5e8e14e 100644 --- a/drivers/xen/pciback/pciback.h +++ b/drivers/xen/pciback/pciback.h @@ -104,6 +104,20 @@ void pciback_do_op(struct work_struct *data); int pciback_xenbus_register(void); void pciback_xenbus_unregister(void); +#ifdef CONFIG_PCI_MSI +int pciback_enable_msi(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op); + +int pciback_disable_msi(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op); + + +int pciback_enable_msix(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op); + +int pciback_disable_msix(struct pciback_device *pdev, + struct pci_dev *dev, struct xen_pci_op *op); +#endif extern int verbose_request; void test_and_schedule_op(struct pciback_device *pdev); diff --git a/drivers/xen/pciback/pciback_ops.c b/drivers/xen/pciback/pciback_ops.c index 834663d..6624faf 100644 --- a/drivers/xen/pciback/pciback_ops.c +++ b/drivers/xen/pciback/pciback_ops.c @@ -89,6 +89,20 @@ void pciback_do_op(struct work_struct *data) op->err = pciback_config_write(dev, op->offset, op->size, op->value); break; +#ifdef CONFIG_PCI_MSI + case XEN_PCI_OP_enable_msi: + op->err = pciback_enable_msi(pdev, dev, op); + break; + case XEN_PCI_OP_disable_msi: + op->err = pciback_disable_msi(pdev, dev, op); + break; + case XEN_PCI_OP_enable_msix: + op->err = pciback_enable_msix(pdev, dev, op); + break; + case XEN_PCI_OP_disable_msix: + op->err = pciback_disable_msix(pdev, dev, op); + break; +#endif default: op->err = XEN_PCI_ERR_not_implemented; break; -- 1.6.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2009-Nov-05 20:25 UTC
[Xen-devel] [PATCH 4/5] Return the physical IRQ number instead of the allocated IRQ number to pcifront.
The allocation of IRQ numbers in Linux privileged domains is based on finding the first unbound IRQ number. After the allocation is done a HYPERCALL to Xen is done, which allocates a PIRQ globally. That PIRQ->IRQ binding is saved in data structures that are used during ISR executions. Before this patch, for non-privileged domains we would return the local IRQ number instead of the PIRQ. The non-privileged domains require the PIRQ so that they can attach the their own interrupt handler to it. Fortunatly there is a function, ''xen_gsi_from_irq'' that returns that global IRQ number. This has been succesfully tested with MSI devices. I hadn''t tested it with MSI-X yet. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/xen/pciback/conf_space_capability_msi.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/xen/pciback/conf_space_capability_msi.c b/drivers/xen/pciback/conf_space_capability_msi.c index 762e396..7fb5371 100644 --- a/drivers/xen/pciback/conf_space_capability_msi.c +++ b/drivers/xen/pciback/conf_space_capability_msi.c @@ -6,6 +6,7 @@ #include "conf_space.h" #include "conf_space_capability.h" #include <xen/interface/io/pciif.h> +#include <xen/events.h> #include "pciback.h" int pciback_enable_msi(struct pciback_device *pdev, @@ -22,7 +23,9 @@ int pciback_enable_msi(struct pciback_device *pdev, return XEN_PCI_ERR_op_failed; } - op->value = dev->irq; + /* The value the guest needs is actually the IDT vector, not the + * the local domain''s IRQ number. */ + op->value = xen_gsi_from_irq(dev->irq); return 0; } @@ -31,7 +34,7 @@ int pciback_disable_msi(struct pciback_device *pdev, { pci_disable_msi(dev); - op->value = dev->irq; + op->value = xen_gsi_from_irq(dev->irq); return 0; } @@ -57,7 +60,8 @@ int pciback_enable_msix(struct pciback_device *pdev, for (i = 0; i < op->value; i++) { op->msix_entries[i].entry = entries[i].entry; - op->msix_entries[i].vector = entries[i].vector; + op->msix_entries[i].vector + xen_gsi_from_irq(entries[i].vector); } kfree(entries); @@ -73,7 +77,7 @@ int pciback_disable_msix(struct pciback_device *pdev, pci_disable_msix(dev); - op->value = dev->irq; + op->value = xen_gsi_from_irq(dev->irq); return 0; } -- 1.6.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2009-Nov-05 20:25 UTC
[Xen-devel] [PATCH 5/5] Fix checkpatch warnings and errors for pciback/ directory.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/xen/pciback/conf_space.c | 34 +++--- drivers/xen/pciback/conf_space.h | 30 ++-- drivers/xen/pciback/conf_space_capability.c | 5 +- drivers/xen/pciback/conf_space_capability.h | 3 + drivers/xen/pciback/conf_space_capability_msi.c | 3 +- drivers/xen/pciback/conf_space_capability_pm.c | 4 +- drivers/xen/pciback/conf_space_capability_vpd.c | 2 +- drivers/xen/pciback/conf_space_header.c | 7 +- drivers/xen/pciback/conf_space_quirks.c | 16 ++- drivers/xen/pciback/controller.c | 15 +- drivers/xen/pciback/passthrough.c | 6 +- drivers/xen/pciback/pci_stub.c | 165 +++++++++++------------ drivers/xen/pciback/pciback.h | 28 +++-- drivers/xen/pciback/pciback_ops.c | 74 +++++------ drivers/xen/pciback/slot.c | 22 ++-- drivers/xen/pciback/vpci.c | 28 ++-- drivers/xen/pciback/xenbus.c | 42 +++--- 17 files changed, 245 insertions(+), 239 deletions(-) diff --git a/drivers/xen/pciback/conf_space.c b/drivers/xen/pciback/conf_space.c index 0c76db1..370c18e 100644 --- a/drivers/xen/pciback/conf_space.c +++ b/drivers/xen/pciback/conf_space.c @@ -18,11 +18,11 @@ static int permissive; module_param(permissive, bool, 0644); -#define DEFINE_PCI_CONFIG(op,size,type) \ +#define DEFINE_PCI_CONFIG(op, size, type) \ int pciback_##op##_config_##size \ (struct pci_dev *dev, int offset, type value, void *data) \ { \ - return pci_##op##_config_##size (dev, offset, value); \ + return pci_##op##_config_##size(dev, offset, value); \ } DEFINE_PCI_CONFIG(read, byte, u8 *) @@ -139,14 +139,15 @@ static int pcibios_err_to_errno(int err) } int pciback_config_read(struct pci_dev *dev, int offset, int size, - u32 * ret_val) + u32 *ret_val) { int err = 0; struct pciback_dev_data *dev_data = pci_get_drvdata(dev); const struct config_field_entry *cfg_entry; const struct config_field *field; int req_start, req_end, field_start, field_end; - /* if read fails for any reason, return 0 (as if device didn''t respond) */ + /* if read fails for any reason, return 0 + * (as if device didn''t respond) */ u32 value = 0, tmp_val; if (unlikely(verbose_request)) @@ -161,10 +162,10 @@ int pciback_config_read(struct pci_dev *dev, int offset, int size, /* Get the real value first, then modify as appropriate */ switch (size) { case 1: - err = pci_read_config_byte(dev, offset, (u8 *) & value); + err = pci_read_config_byte(dev, offset, (u8 *) &value); break; case 2: - err = pci_read_config_word(dev, offset, (u16 *) & value); + err = pci_read_config_word(dev, offset, (u16 *) &value); break; case 4: err = pci_read_config_dword(dev, offset, &value); @@ -192,7 +193,7 @@ int pciback_config_read(struct pci_dev *dev, int offset, int size, } } - out: +out: if (unlikely(verbose_request)) printk(KERN_DEBUG "pciback: %s: read %d bytes at 0x%x = %x\n", pci_name(dev), size, offset, value); @@ -276,8 +277,8 @@ int pciback_config_write(struct pci_dev *dev, int offset, int size, u32 value) } else if (!dev_data->warned_on_write) { dev_data->warned_on_write = 1; dev_warn(&dev->dev, "Driver tried to write to a " - "read-only configuration space field at offset " - "0x%x, size %d. This may be harmless, but if " + "read-only configuration space field at offset" + " 0x%x, size %d. This may be harmless, but if " "you have problems with your device:\n" "1) see permissive attribute in sysfs\n" "2) report problems to the xen-devel " @@ -295,8 +296,8 @@ void pciback_config_free_dyn_fields(struct pci_dev *dev) struct config_field_entry *cfg_entry, *t; const struct config_field *field; - dev_dbg(&dev->dev, - "free-ing dynamically allocated virtual configuration space fields\n"); + dev_dbg(&dev->dev, "free-ing dynamically allocated virtual " + "configuration space fields\n"); if (!dev_data) return; @@ -306,8 +307,7 @@ void pciback_config_free_dyn_fields(struct pci_dev *dev) if (field->clean) { field->clean((struct config_field *)field); - if (cfg_entry->data) - kfree(cfg_entry->data); + kfree(cfg_entry->data); list_del(&cfg_entry->list); kfree(cfg_entry); @@ -376,7 +376,7 @@ int pciback_config_add_field_offset(struct pci_dev *dev, cfg_entry->base_offset = base_offset; /* silently ignore duplicate fields */ - err = pciback_field_is_dup(dev,OFFSET(cfg_entry)); + err = pciback_field_is_dup(dev, OFFSET(cfg_entry)); if (err) goto out; @@ -395,14 +395,14 @@ int pciback_config_add_field_offset(struct pci_dev *dev, OFFSET(cfg_entry)); list_add_tail(&cfg_entry->list, &dev_data->config_fields); - out: +out: if (err) kfree(cfg_entry); return err; } -/* This sets up the device''s virtual configuration space to keep track of +/* This sets up the device''s virtual configuration space to keep track of * certain registers (like the base address registers (BARs) so that we can * keep the client from manipulating them directly. */ @@ -425,7 +425,7 @@ int pciback_config_init_dev(struct pci_dev *dev) err = pciback_config_quirks_init(dev); - out: +out: return err; } diff --git a/drivers/xen/pciback/conf_space.h b/drivers/xen/pciback/conf_space.h index fe746ef..50ebef2 100644 --- a/drivers/xen/pciback/conf_space.h +++ b/drivers/xen/pciback/conf_space.h @@ -11,21 +11,21 @@ #include <linux/err.h> /* conf_field_init can return an errno in a ptr with ERR_PTR() */ -typedef void *(*conf_field_init) (struct pci_dev * dev, int offset); -typedef void (*conf_field_reset) (struct pci_dev * dev, int offset, void *data); -typedef void (*conf_field_free) (struct pci_dev * dev, int offset, void *data); +typedef void *(*conf_field_init) (struct pci_dev *dev, int offset); +typedef void (*conf_field_reset) (struct pci_dev *dev, int offset, void *data); +typedef void (*conf_field_free) (struct pci_dev *dev, int offset, void *data); -typedef int (*conf_dword_write) (struct pci_dev * dev, int offset, u32 value, +typedef int (*conf_dword_write) (struct pci_dev *dev, int offset, u32 value, void *data); -typedef int (*conf_word_write) (struct pci_dev * dev, int offset, u16 value, +typedef int (*conf_word_write) (struct pci_dev *dev, int offset, u16 value, void *data); -typedef int (*conf_byte_write) (struct pci_dev * dev, int offset, u8 value, +typedef int (*conf_byte_write) (struct pci_dev *dev, int offset, u8 value, void *data); -typedef int (*conf_dword_read) (struct pci_dev * dev, int offset, u32 * value, +typedef int (*conf_dword_read) (struct pci_dev *dev, int offset, u32 *value, void *data); -typedef int (*conf_word_read) (struct pci_dev * dev, int offset, u16 * value, +typedef int (*conf_word_read) (struct pci_dev *dev, int offset, u16 *value, void *data); -typedef int (*conf_byte_read) (struct pci_dev * dev, int offset, u8 * value, +typedef int (*conf_byte_read) (struct pci_dev *dev, int offset, u8 *value, void *data); /* These are the fields within the configuration space which we @@ -39,7 +39,7 @@ struct config_field { conf_field_init init; conf_field_reset reset; conf_field_free release; - void (*clean) (struct config_field * field); + void (*clean) (struct config_field *field); union { struct { conf_dword_write write; @@ -92,8 +92,8 @@ static inline int pciback_config_add_fields(struct pci_dev *dev, } static inline int pciback_config_add_fields_offset(struct pci_dev *dev, - const struct config_field *field, - unsigned int offset) + const struct config_field *field, + unsigned int offset) { int i, err = 0; for (i = 0; field[i].size != 0; i++) { @@ -105,11 +105,11 @@ static inline int pciback_config_add_fields_offset(struct pci_dev *dev, } /* Read/Write the real configuration space */ -int pciback_read_config_byte(struct pci_dev *dev, int offset, u8 * value, +int pciback_read_config_byte(struct pci_dev *dev, int offset, u8 *value, void *data); -int pciback_read_config_word(struct pci_dev *dev, int offset, u16 * value, +int pciback_read_config_word(struct pci_dev *dev, int offset, u16 *value, void *data); -int pciback_read_config_dword(struct pci_dev *dev, int offset, u32 * value, +int pciback_read_config_dword(struct pci_dev *dev, int offset, u32 *value, void *data); int pciback_write_config_byte(struct pci_dev *dev, int offset, u8 value, void *data); diff --git a/drivers/xen/pciback/conf_space_capability.c b/drivers/xen/pciback/conf_space_capability.c index 50efca4..0ea84d6 100644 --- a/drivers/xen/pciback/conf_space_capability.c +++ b/drivers/xen/pciback/conf_space_capability.c @@ -53,13 +53,10 @@ int pciback_config_capability_add_fields(struct pci_dev *dev) } } - out: +out: return err; } -extern struct pciback_config_capability pciback_config_capability_vpd; -extern struct pciback_config_capability pciback_config_capability_pm; - int pciback_config_capability_init(void) { register_capability(&pciback_config_capability_vpd); diff --git a/drivers/xen/pciback/conf_space_capability.h b/drivers/xen/pciback/conf_space_capability.h index 823392e..8da3ac4 100644 --- a/drivers/xen/pciback/conf_space_capability.h +++ b/drivers/xen/pciback/conf_space_capability.h @@ -20,4 +20,7 @@ struct pciback_config_capability { const struct config_field *fields; }; +extern struct pciback_config_capability pciback_config_capability_vpd; +extern struct pciback_config_capability pciback_config_capability_pm; + #endif diff --git a/drivers/xen/pciback/conf_space_capability_msi.c b/drivers/xen/pciback/conf_space_capability_msi.c index 7fb5371..b70ea8b 100644 --- a/drivers/xen/pciback/conf_space_capability_msi.c +++ b/drivers/xen/pciback/conf_space_capability_msi.c @@ -18,7 +18,8 @@ int pciback_enable_msi(struct pciback_device *pdev, status = pci_enable_msi(dev); if (status) { - printk("error enable msi for guest %x status %x\n", otherend, status); + printk(KERN_ERR "error enable msi for guest %x status %x\n", + otherend, status); op->value = 0; return XEN_PCI_ERR_op_failed; } diff --git a/drivers/xen/pciback/conf_space_capability_pm.c b/drivers/xen/pciback/conf_space_capability_pm.c index e1d3af4..0442616 100644 --- a/drivers/xen/pciback/conf_space_capability_pm.c +++ b/drivers/xen/pciback/conf_space_capability_pm.c @@ -20,7 +20,7 @@ static int pm_caps_read(struct pci_dev *dev, int offset, u16 *value, *value = real_value & ~PCI_PM_CAP_PME_MASK; - out: +out: return err; } @@ -77,7 +77,7 @@ static void *pm_ctrl_init(struct pci_dev *dev, int offset) err = pci_write_config_word(dev, offset, value); } - out: +out: return ERR_PTR(err); } diff --git a/drivers/xen/pciback/conf_space_capability_vpd.c b/drivers/xen/pciback/conf_space_capability_vpd.c index 920cb4a..e7b4d66 100644 --- a/drivers/xen/pciback/conf_space_capability_vpd.c +++ b/drivers/xen/pciback/conf_space_capability_vpd.c @@ -33,7 +33,7 @@ static const struct config_field caplist_vpd[] = { }, {} }; - + struct pciback_config_capability pciback_config_capability_vpd = { .capability = PCI_CAP_ID_VPD, .fields = caplist_vpd, diff --git a/drivers/xen/pciback/conf_space_header.c b/drivers/xen/pciback/conf_space_header.c index 5a9e028..3ae7da1 100644 --- a/drivers/xen/pciback/conf_space_header.c +++ b/drivers/xen/pciback/conf_space_header.c @@ -51,7 +51,8 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data) err = pci_set_mwi(dev); if (err) { printk(KERN_WARNING - "pciback: %s: cannot enable memory-write-invalidate (%d)\n", + "pciback: %s: cannot enable " + "memory-write-invalidate (%d)\n", pci_name(dev), err); value &= ~PCI_COMMAND_INVALIDATE; } @@ -206,7 +207,7 @@ static int bist_write(struct pci_dev *dev, int offset, u8 value, void *data) || value == PCI_BIST_START) err = pci_write_config_byte(dev, offset, value); - out: +out: return err; } @@ -312,6 +313,6 @@ int pciback_config_header_add_fields(struct pci_dev *dev) break; } - out: +out: return err; } diff --git a/drivers/xen/pciback/conf_space_quirks.c b/drivers/xen/pciback/conf_space_quirks.c index 244a438..45c31fb 100644 --- a/drivers/xen/pciback/conf_space_quirks.c +++ b/drivers/xen/pciback/conf_space_quirks.c @@ -18,8 +18,10 @@ match_one_device(const struct pci_device_id *id, const struct pci_dev *dev) { if ((id->vendor == PCI_ANY_ID || id->vendor == dev->vendor) && (id->device == PCI_ANY_ID || id->device == dev->device) && - (id->subvendor == PCI_ANY_ID || id->subvendor == dev->subsystem_vendor) && - (id->subdevice == PCI_ANY_ID || id->subdevice == dev->subsystem_device) && + (id->subvendor == PCI_ANY_ID || + id->subvendor == dev->subsystem_vendor) && + (id->subdevice == PCI_ANY_ID || + id->subdevice == dev->subsystem_device) && !((id->class ^ dev->class) & id->class_mask)) return id; return NULL; @@ -35,7 +37,7 @@ struct pciback_config_quirk *pciback_find_quirk(struct pci_dev *dev) tmp_quirk = NULL; printk(KERN_DEBUG "quirk didn''t match any device pciback knows about\n"); - out: +out: return tmp_quirk; } @@ -51,7 +53,7 @@ int pciback_field_is_dup(struct pci_dev *dev, unsigned int reg) struct config_field_entry *cfg_entry; list_for_each_entry(cfg_entry, &dev_data->config_fields, list) { - if ( OFFSET(cfg_entry) == reg) { + if (OFFSET(cfg_entry) == reg) { ret = 1; break; } @@ -84,7 +86,7 @@ int pciback_config_quirks_add_field(struct pci_dev *dev, struct config_field pciback_config_add_field(dev, field); - out: +out: return err; } @@ -110,7 +112,7 @@ int pciback_config_quirks_init(struct pci_dev *dev) quirk->pdev = dev; register_quirk(quirk); - out: +out: return ret; } @@ -133,6 +135,6 @@ int pciback_config_quirk_release(struct pci_dev *dev) list_del(&quirk->quirks_list); kfree(quirk); - out: +out: return ret; } diff --git a/drivers/xen/pciback/controller.c b/drivers/xen/pciback/controller.c index 294e48f..7f04f11 100644 --- a/drivers/xen/pciback/controller.c +++ b/drivers/xen/pciback/controller.c @@ -259,7 +259,7 @@ static acpi_status write_xenbus_resource(struct acpi_resource *res, void *data) !(addr.resource_type == ACPI_IO_RANGE && addr.info.io.translation)) return AE_OK; - + /* Store the resource in xenbus for the guest */ len = snprintf(str, sizeof(str), "root-%d-resource-%d", info->root_num, info->resource_count); @@ -314,7 +314,7 @@ int pciback_publish_pci_roots(struct pciback_device *pdev, goto out; /* - * Now figure out which root-%d this belongs to + * Now figure out which root-%d this belongs to * so we can associate resources with it. */ err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, @@ -407,8 +407,8 @@ void pciback_release_devices(struct pciback_device *pdev) pdev->pci_dev_data = NULL; } -int pciback_get_pcifront_dev(struct pci_dev *pcidev, - struct pciback_device *pdev, +int pciback_get_pcifront_dev(struct pci_dev *pcidev, + struct pciback_device *pdev, unsigned int *domain, unsigned int *bus, unsigned int *devfn) { struct controller_dev_data *dev_data = pdev->pci_dev_data; @@ -420,13 +420,12 @@ int pciback_get_pcifront_dev(struct pci_dev *pcidev, list_for_each_entry(cntrl_entry, &dev_data->list, list) { list_for_each_entry(dev_entry, &cntrl_entry->dev_list, list) { - if ( (dev_entry->dev->bus->number == + if ((dev_entry->dev->bus->number = pcidev->bus->number) && - (dev_entry->dev->devfn =+ (dev_entry->dev->devfn = pcidev->devfn) && (pci_domain_nr(dev_entry->dev->bus) =- pci_domain_nr(pcidev->bus))) - { + pci_domain_nr(pcidev->bus))) { found = 1; *domain = cntrl_entry->domain; *bus = cntrl_entry->bus; diff --git a/drivers/xen/pciback/passthrough.c b/drivers/xen/pciback/passthrough.c index 9e7a0c4..5386beb 100644 --- a/drivers/xen/pciback/passthrough.c +++ b/drivers/xen/pciback/passthrough.c @@ -165,8 +165,10 @@ void pciback_release_devices(struct pciback_device *pdev) pdev->pci_dev_data = NULL; } -int pciback_get_pcifront_dev(struct pci_dev *pcidev, struct pciback_device *pdev, - unsigned int *domain, unsigned int *bus, unsigned int *devfn) +int pciback_get_pcifront_dev(struct pci_dev *pcidev, + struct pciback_device *pdev, + unsigned int *domain, unsigned int *bus, + unsigned int *devfn) { *domain = pci_domain_nr(pcidev->bus); diff --git a/drivers/xen/pciback/pci_stub.c b/drivers/xen/pciback/pci_stub.c index 88c742b..c65c7c1 100644 --- a/drivers/xen/pciback/pci_stub.c +++ b/drivers/xen/pciback/pci_stub.c @@ -18,7 +18,7 @@ #include "conf_space.h" #include "conf_space_quirks.h" -static char *pci_devs_to_hide = NULL; +static char *pci_devs_to_hide; wait_queue_head_t aer_wait_queue; /*Add sem for sync AER handling and pciback remove/reconfigue ops, * We want to avoid in middle of AER ops, pciback devices is being removed @@ -41,7 +41,7 @@ struct pcistub_device { spinlock_t lock; struct pci_dev *dev; - struct pciback_device *pdev; /* non-NULL if struct pci_dev is in use */ + struct pciback_device *pdev;/* non-NULL if struct pci_dev is in use */ }; /* Access to pcistub_devices & seized_devices lists and the initialize_devices @@ -53,7 +53,7 @@ static LIST_HEAD(pcistub_devices); /* wait for device_initcall before initializing our devices * (see pcistub_init_devices_late) */ -static int initialize_devices = 0; +static int initialize_devices; static LIST_HEAD(seized_devices); static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev) @@ -130,7 +130,7 @@ static struct pcistub_device *pcistub_device_find(int domain, int bus, /* didn''t find it */ psdev = NULL; - out: +out: spin_unlock_irqrestore(&pcistub_devices_lock, flags); return psdev; } @@ -319,10 +319,10 @@ static int __devinit pcistub_init_device(struct pci_dev *dev) return 0; - config_release: +config_release: pciback_config_free_dev(dev); - out: +out: pci_set_drvdata(dev, NULL); kfree(dev_data); return err; @@ -441,7 +441,7 @@ static int __devinit pcistub_probe(struct pci_dev *dev, /* Didn''t find the device */ err = -ENODEV; - out: +out: return err; } @@ -509,26 +509,24 @@ static void kill_domain_by_device(struct pcistub_device *psdev) int err; char nodename[1024]; - if (!psdev) + if (!psdev) dev_err(&psdev->dev->dev, "device is NULL when do AER recovery/kill_domain\n"); - sprintf(nodename, "/local/domain/0/backend/pci/%d/0", + sprintf(nodename, "/local/domain/0/backend/pci/%d/0", psdev->pdev->xdev->otherend_id); nodename[strlen(nodename)] = ''\0''; again: err = xenbus_transaction_start(&xbt); - if (err) - { + if (err) { dev_err(&psdev->dev->dev, "error %d when start xenbus transaction\n", err); return; } /*PV AER handlers will set this flag*/ - xenbus_printf(xbt, nodename, "aerState" , "aerfail" ); + xenbus_printf(xbt, nodename, "aerState" , "aerfail"); err = xenbus_transaction_end(xbt, 0); - if (err) - { + if (err) { if (err == -EAGAIN) goto again; dev_err(&psdev->dev->dev, @@ -539,9 +537,9 @@ again: /* For each aer recovery step error_detected, mmio_enabled, etc, front_end and * backend need to have cooperation. In pciback, those steps will do similar - * jobs: send service request and waiting for front_end response. + * jobs: send service request and waiting for front_end response. */ -static pci_ers_result_t common_process(struct pcistub_device *psdev, +static pci_ers_result_t common_process(struct pcistub_device *psdev, pci_channel_state_t state, int aer_cmd, pci_ers_result_t result) { pci_ers_result_t res = result; @@ -559,12 +557,12 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, if (!ret) { dev_err(&psdev->dev->dev, "pciback: failed to get pcifront device\n"); - return PCI_ERS_RESULT_NONE; + return PCI_ERS_RESULT_NONE; } wmb(); - dev_dbg(&psdev->dev->dev, - "pciback: aer_op %x dom %x bus %x devfn %x\n", + dev_dbg(&psdev->dev->dev, + "pciback: aer_op %x dom %x bus %x devfn %x\n", aer_cmd, aer_op->domain, aer_op->bus, aer_op->devfn); /*local flag to mark there''s aer request, pciback callback will use this * flag to judge whether we need to check pci-front give aer service @@ -573,21 +571,21 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, set_bit(_PCIB_op_pending, (unsigned long *)&psdev->pdev->flags); /*It is possible that a pcifront conf_read_write ops request invokes - * the callback which cause the spurious execution of wake_up. + * the callback which cause the spurious execution of wake_up. * Yet it is harmless and better than a spinlock here */ - set_bit(_XEN_PCIB_active, + set_bit(_XEN_PCIB_active, (unsigned long *)&psdev->pdev->sh_info->flags); wmb(); notify_remote_via_irq(psdev->pdev->evtchn_irq); ret = wait_event_timeout(aer_wait_queue, !(test_bit(_XEN_PCIB_active, - (unsigned long *)&psdev->pdev->sh_info->flags)), 300*HZ); + (unsigned long *)&psdev->pdev->sh_info->flags)), 300*HZ); if (!ret) { - if (test_bit(_XEN_PCIB_active, + if (test_bit(_XEN_PCIB_active, (unsigned long *)&psdev->pdev->sh_info->flags)) { - dev_err(&psdev->dev->dev, + dev_err(&psdev->dev->dev, "pcifront aer process not responding!\n"); clear_bit(_XEN_PCIB_active, (unsigned long *)&psdev->pdev->sh_info->flags); @@ -597,16 +595,16 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, } clear_bit(_PCIB_op_pending, (unsigned long *)&psdev->pdev->flags); - if ( test_bit( _XEN_PCIF_active, - (unsigned long*)&psdev->pdev->sh_info->flags)) { - dev_dbg(&psdev->dev->dev, + if (test_bit(_XEN_PCIF_active, + (unsigned long *)&psdev->pdev->sh_info->flags)) { + dev_dbg(&psdev->dev->dev, "schedule pci_conf service in pciback \n"); test_and_schedule_op(psdev->pdev); } res = (pci_ers_result_t)aer_op->err; return res; -} +} /* * pciback_slot_reset: it will send the slot_reset request to pcifront in case @@ -630,24 +628,22 @@ static pci_ers_result_t pciback_slot_reset(struct pci_dev *dev) PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); - if ( !psdev || !psdev->pdev ) - { - dev_err(&dev->dev, + if (!psdev || !psdev->pdev) { + dev_err(&dev->dev, "pciback device is not found/assigned\n"); goto end; } - if ( !psdev->pdev->sh_info ) - { + if (!psdev->pdev->sh_info) { dev_err(&dev->dev, "pciback device is not connected or owned" " by HVM, kill it\n"); kill_domain_by_device(psdev); goto release; } - if ( !test_bit(_XEN_PCIB_AERHANDLER, - (unsigned long *)&psdev->pdev->sh_info->flags) ) { - dev_err(&dev->dev, + if (!test_bit(_XEN_PCIB_AERHANDLER, + (unsigned long *)&psdev->pdev->sh_info->flags)) { + dev_err(&dev->dev, "guest with no AER driver should have been killed\n"); goto release; } @@ -655,7 +651,7 @@ static pci_ers_result_t pciback_slot_reset(struct pci_dev *dev) if (result == PCI_ERS_RESULT_NONE || result == PCI_ERS_RESULT_DISCONNECT) { - dev_dbg(&dev->dev, + dev_dbg(&dev->dev, "No AER slot_reset service or disconnected!\n"); kill_domain_by_device(psdev); } @@ -668,9 +664,9 @@ end: } -/*pciback_mmio_enabled: it will send the mmio_enabled request to pcifront -* in case of the device driver could provide this service, and then wait -* for pcifront ack. +/*pciback_mmio_enabled: it will send the mmio_enabled request to pcifront +* in case of the device driver could provide this service, and then wait +* for pcifront ack * @dev: pointer to PCI devices * return value is used by aer_core do_recovery policy */ @@ -690,24 +686,22 @@ static pci_ers_result_t pciback_mmio_enabled(struct pci_dev *dev) PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); - if ( !psdev || !psdev->pdev ) - { - dev_err(&dev->dev, + if (!psdev || !psdev->pdev) { + dev_err(&dev->dev, "pciback device is not found/assigned\n"); goto end; } - if ( !psdev->pdev->sh_info ) - { + if (!psdev->pdev->sh_info) { dev_err(&dev->dev, "pciback device is not connected or owned" " by HVM, kill it\n"); kill_domain_by_device(psdev); goto release; } - if ( !test_bit(_XEN_PCIB_AERHANDLER, - (unsigned long *)&psdev->pdev->sh_info->flags) ) { - dev_err(&dev->dev, + if (!test_bit(_XEN_PCIB_AERHANDLER, + (unsigned long *)&psdev->pdev->sh_info->flags)) { + dev_err(&dev->dev, "guest with no AER driver should have been killed\n"); goto release; } @@ -715,7 +709,7 @@ static pci_ers_result_t pciback_mmio_enabled(struct pci_dev *dev) if (result == PCI_ERS_RESULT_NONE || result == PCI_ERS_RESULT_DISCONNECT) { - dev_dbg(&dev->dev, + dev_dbg(&dev->dev, "No AER mmio_enabled service or disconnected!\n"); kill_domain_by_device(psdev); } @@ -726,8 +720,8 @@ end: return result; } -/*pciback_error_detected: it will send the error_detected request to pcifront -* in case of the device driver could provide this service, and then wait +/*pciback_error_detected: it will send the error_detected request to pcifront +* in case of the device driver could provide this service, and then wait * for pcifront ack. * @dev: pointer to PCI devices * @error: the current PCI connection state @@ -750,15 +744,13 @@ static pci_ers_result_t pciback_error_detected(struct pci_dev *dev, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); - if ( !psdev || !psdev->pdev ) - { - dev_err(&dev->dev, + if (!psdev || !psdev->pdev) { + dev_err(&dev->dev, "pciback device is not found/assigned\n"); goto end; } - if ( !psdev->pdev->sh_info ) - { + if (!psdev->pdev->sh_info) { dev_err(&dev->dev, "pciback device is not connected or owned" " by HVM, kill it\n"); kill_domain_by_device(psdev); @@ -766,8 +758,8 @@ static pci_ers_result_t pciback_error_detected(struct pci_dev *dev, } /*Guest owns the device yet no aer handler regiested, kill guest*/ - if ( !test_bit(_XEN_PCIB_AERHANDLER, - (unsigned long *)&psdev->pdev->sh_info->flags) ) { + if (!test_bit(_XEN_PCIB_AERHANDLER, + (unsigned long *)&psdev->pdev->sh_info->flags)) { dev_dbg(&dev->dev, "guest may have no aer driver, kill it\n"); kill_domain_by_device(psdev); goto release; @@ -776,7 +768,7 @@ static pci_ers_result_t pciback_error_detected(struct pci_dev *dev, if (result == PCI_ERS_RESULT_NONE || result == PCI_ERS_RESULT_DISCONNECT) { - dev_dbg(&dev->dev, + dev_dbg(&dev->dev, "No AER error_detected service or disconnected!\n"); kill_domain_by_device(psdev); } @@ -787,8 +779,8 @@ end: return result; } -/*pciback_error_resume: it will send the error_resume request to pcifront -* in case of the device driver could provide this service, and then wait +/*pciback_error_resume: it will send the error_resume request to pcifront +* in case of the device driver could provide this service, and then wait * for pcifront ack. * @dev: pointer to PCI devices */ @@ -806,29 +798,28 @@ static void pciback_error_resume(struct pci_dev *dev) PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); - if ( !psdev || !psdev->pdev ) - { - dev_err(&dev->dev, + if (!psdev || !psdev->pdev) { + dev_err(&dev->dev, "pciback device is not found/assigned\n"); goto end; } - if ( !psdev->pdev->sh_info ) - { + if (!psdev->pdev->sh_info) { dev_err(&dev->dev, "pciback device is not connected or owned" " by HVM, kill it\n"); kill_domain_by_device(psdev); goto release; } - if ( !test_bit(_XEN_PCIB_AERHANDLER, - (unsigned long *)&psdev->pdev->sh_info->flags) ) { - dev_err(&dev->dev, + if (!test_bit(_XEN_PCIB_AERHANDLER, + (unsigned long *)&psdev->pdev->sh_info->flags)) { + dev_err(&dev->dev, "guest with no AER driver should have been killed\n"); kill_domain_by_device(psdev); goto release; } - common_process(psdev, 1, XEN_PCI_OP_aer_resume, PCI_ERS_RESULT_RECOVERED); + common_process(psdev, 1, XEN_PCI_OP_aer_resume, + PCI_ERS_RESULT_RECOVERED); release: pcistub_device_put(psdev); end: @@ -921,8 +912,8 @@ static int pcistub_device_id_remove(int domain, int bus, int slot, int func) unsigned long flags; spin_lock_irqsave(&device_ids_lock, flags); - list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) { - + list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, + slot_list) { if (pci_dev_id->domain == domain && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) { /* Don''t break; here because it''s possible the same @@ -974,7 +965,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func, int reg, err = pciback_config_quirks_add_field(dev, field); if (err) kfree(field); - out: +out: return err; } @@ -990,7 +981,7 @@ static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf, err = pcistub_device_id_add(domain, bus, slot, func); - out: +out: if (!err) err = count; return err; @@ -1010,7 +1001,7 @@ static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf, err = pcistub_device_id_remove(domain, bus, slot, func); - out: +out: if (!err) err = count; return err; @@ -1055,7 +1046,7 @@ static ssize_t pcistub_quirk_add(struct device_driver *drv, const char *buf, err = pcistub_reg_add(domain, bus, slot, func, reg, size, mask); - out: +out: if (!err) err = count; return err; @@ -1065,7 +1056,6 @@ static ssize_t pcistub_quirk_show(struct device_driver *drv, char *buf) { int count = 0; unsigned long flags; - extern struct list_head pciback_quirks; struct pciback_config_quirk *quirk; struct pciback_dev_data *dev_data; const struct config_field *field; @@ -1094,12 +1084,13 @@ static ssize_t pcistub_quirk_show(struct device_driver *drv, char *buf) count += scnprintf(buf + count, PAGE_SIZE - count, "\t\t%08x:%01x:%08x\n", - cfg_entry->base_offset + field->offset, - field->size, field->mask); + cfg_entry->base_offset + + field->offset, field->size, + field->mask); } } - out: +out: spin_unlock_irqrestore(&device_ids_lock, flags); return count; @@ -1135,14 +1126,14 @@ static ssize_t permissive_add(struct device_driver *drv, const char *buf, if (!dev_data->permissive) { dev_data->permissive = 1; /* Let user know that what they''re doing could be unsafe */ - dev_warn(&psdev->dev->dev, - "enabling permissive mode configuration space accesses!\n"); + dev_warn(&psdev->dev->dev, "enabling permissive mode " + "configuration space accesses!\n"); dev_warn(&psdev->dev->dev, "permissive mode is potentially unsafe!\n"); } - release: +release: pcistub_device_put(psdev); - out: +out: if (!err) err = count; return err; @@ -1259,10 +1250,10 @@ static int __init pcistub_init(void) if (err) pcistub_exit(); - out: +out: return err; - parse_error: +parse_error: printk(KERN_ERR "pciback: Error parsing pci_devs_to_hide at \"%s\"\n", pci_devs_to_hide + pos); return -EINVAL; @@ -1271,7 +1262,7 @@ static int __init pcistub_init(void) #ifndef MODULE /* * fs_initcall happens before device_initcall - * so pciback *should* get called first (b/c we + * so pciback *should* get called first (b/c we * want to suck up any device before other drivers * get a chance by being the first pci device * driver to register) diff --git a/drivers/xen/pciback/pciback.h b/drivers/xen/pciback/pciback.h index 5e8e14e..98e2912 100644 --- a/drivers/xen/pciback/pciback.h +++ b/drivers/xen/pciback/pciback.h @@ -49,6 +49,12 @@ struct pciback_dev_data { int warned_on_write; }; +/* Used by XenBus and pciback_ops.c */ +extern wait_queue_head_t aer_wait_queue; +extern struct workqueue_struct *pciback_wq; +/* Used by pcistub.c and conf_space_quirks.c */ +extern struct list_head pciback_quirks; + /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */ struct pci_dev *pcistub_get_pci_dev_by_slot(struct pciback_device *pdev, int domain, int bus, @@ -67,14 +73,14 @@ void pciback_config_free_dyn_fields(struct pci_dev *dev); void pciback_config_reset_dev(struct pci_dev *dev); void pciback_config_free_dev(struct pci_dev *dev); int pciback_config_read(struct pci_dev *dev, int offset, int size, - u32 * ret_val); + u32 *ret_val); int pciback_config_write(struct pci_dev *dev, int offset, int size, u32 value); /* Handle requests for specific devices from the frontend */ typedef int (*publish_pci_dev_cb) (struct pciback_device *pdev, unsigned int domain, unsigned int bus, unsigned int devfn, unsigned int devid); -typedef int (*publish_pci_root_cb) (struct pciback_device * pdev, +typedef int (*publish_pci_root_cb) (struct pciback_device *pdev, unsigned int domain, unsigned int bus); int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev, int devid, publish_pci_dev_cb publish_cb); @@ -83,15 +89,17 @@ struct pci_dev *pciback_get_pci_dev(struct pciback_device *pdev, unsigned int domain, unsigned int bus, unsigned int devfn); -/** +/** * Add for domain0 PCIE-AER handling. Get guest domain/bus/devfn in pciback -* before sending aer request to pcifront, so that guest could identify +* before sending aer request to pcifront, so that guest could identify * device, coopearte with pciback to finish aer recovery job if device driver * has the capability */ -int pciback_get_pcifront_dev(struct pci_dev *pcidev, struct pciback_device *pdev, - unsigned int *domain, unsigned int *bus, unsigned int *devfn); +int pciback_get_pcifront_dev(struct pci_dev *pcidev, + struct pciback_device *pdev, + unsigned int *domain, unsigned int *bus, + unsigned int *devfn); int pciback_init_devices(struct pciback_device *pdev); int pciback_publish_pci_roots(struct pciback_device *pdev, publish_pci_root_cb cb); @@ -106,17 +114,17 @@ void pciback_xenbus_unregister(void); #ifdef CONFIG_PCI_MSI int pciback_enable_msi(struct pciback_device *pdev, - struct pci_dev *dev, struct xen_pci_op *op); + struct pci_dev *dev, struct xen_pci_op *op); int pciback_disable_msi(struct pciback_device *pdev, - struct pci_dev *dev, struct xen_pci_op *op); + struct pci_dev *dev, struct xen_pci_op *op); int pciback_enable_msix(struct pciback_device *pdev, - struct pci_dev *dev, struct xen_pci_op *op); + struct pci_dev *dev, struct xen_pci_op *op); int pciback_disable_msix(struct pciback_device *pdev, - struct pci_dev *dev, struct xen_pci_op *op); + struct pci_dev *dev, struct xen_pci_op *op); #endif extern int verbose_request; diff --git a/drivers/xen/pciback/pciback_ops.c b/drivers/xen/pciback/pciback_ops.c index 6624faf..bf83dca 100644 --- a/drivers/xen/pciback/pciback_ops.c +++ b/drivers/xen/pciback/pciback_ops.c @@ -5,11 +5,11 @@ */ #include <linux/module.h> #include <linux/wait.h> -#include <asm/bitops.h> +#include <linux/bitops.h> #include <xen/events.h> #include "pciback.h" -int verbose_request = 0; +int verbose_request; module_param(verbose_request, int, 0644); /* Ensure a device is "turned off" and ready to be exported. @@ -37,12 +37,10 @@ void pciback_reset_device(struct pci_dev *dev) } } } -extern wait_queue_head_t aer_wait_queue; -extern struct workqueue_struct *pciback_wq; /* * Now the same evtchn is used for both pcifront conf_read_write request * as well as pcie aer front end ack. We use a new work_queue to schedule -* pciback conf_read_write service for avoiding confict with aer_core +* pciback conf_read_write service for avoiding confict with aer_core * do_recovery job which also use the system default work_queue */ void test_and_schedule_op(struct pciback_device *pdev) @@ -50,14 +48,13 @@ void test_and_schedule_op(struct pciback_device *pdev) /* Check that frontend is requesting an operation and that we are not * already processing a request */ if (test_bit(_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags) - && !test_and_set_bit(_PDEVF_op_active, &pdev->flags)) - { + && !test_and_set_bit(_PDEVF_op_active, &pdev->flags)) { queue_work(pciback_wq, &pdev->op_work); } /*_XEN_PCIB_active should have been cleared by pcifront. And also make sure pciback is waiting for ack by checking _PCIB_op_pending*/ - if (!test_bit(_XEN_PCIB_active,(unsigned long *)&pdev->sh_info->flags) - &&test_bit(_PCIB_op_pending, &pdev->flags)) { + if (!test_bit(_XEN_PCIB_active, (unsigned long *)&pdev->sh_info->flags) + && test_bit(_PCIB_op_pending, &pdev->flags)) { wake_up(&aer_wait_queue); } } @@ -69,7 +66,8 @@ void test_and_schedule_op(struct pciback_device *pdev) void pciback_do_op(struct work_struct *data) { - struct pciback_device *pdev = container_of(data, struct pciback_device, op_work); + struct pciback_device *pdev + container_of(data, struct pciback_device, op_work); struct pci_dev *dev; struct xen_pci_op *op = &pdev->sh_info->op; @@ -77,38 +75,36 @@ void pciback_do_op(struct work_struct *data) if (dev == NULL) op->err = XEN_PCI_ERR_dev_not_found; - else - { - switch (op->cmd) - { - case XEN_PCI_OP_conf_read: - op->err = pciback_config_read(dev, - op->offset, op->size, &op->value); - break; - case XEN_PCI_OP_conf_write: - op->err = pciback_config_write(dev, - op->offset, op->size, op->value); - break; + else { + switch (op->cmd) { + case XEN_PCI_OP_conf_read: + op->err = pciback_config_read(dev, + op->offset, op->size, &op->value); + break; + case XEN_PCI_OP_conf_write: + op->err = pciback_config_write(dev, + op->offset, op->size, op->value); + break; #ifdef CONFIG_PCI_MSI - case XEN_PCI_OP_enable_msi: - op->err = pciback_enable_msi(pdev, dev, op); - break; - case XEN_PCI_OP_disable_msi: - op->err = pciback_disable_msi(pdev, dev, op); - break; - case XEN_PCI_OP_enable_msix: - op->err = pciback_enable_msix(pdev, dev, op); - break; - case XEN_PCI_OP_disable_msix: - op->err = pciback_disable_msix(pdev, dev, op); - break; + case XEN_PCI_OP_enable_msi: + op->err = pciback_enable_msi(pdev, dev, op); + break; + case XEN_PCI_OP_disable_msi: + op->err = pciback_disable_msi(pdev, dev, op); + break; + case XEN_PCI_OP_enable_msix: + op->err = pciback_enable_msix(pdev, dev, op); + break; + case XEN_PCI_OP_disable_msix: + op->err = pciback_disable_msix(pdev, dev, op); + break; #endif - default: - op->err = XEN_PCI_ERR_not_implemented; - break; + default: + op->err = XEN_PCI_ERR_not_implemented; + break; } } - /* Tell the driver domain that we''re done. */ + /* Tell the driver domain that we''re done. */ wmb(); clear_bit(_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags); notify_remote_via_irq(pdev->evtchn_irq); @@ -119,7 +115,7 @@ void pciback_do_op(struct work_struct *data) smp_mb__after_clear_bit(); /* /before/ final check for work */ /* Check to see if the driver domain tried to start another request in - * between clearing _XEN_PCIF_active and clearing _PDEVF_op_active. + * between clearing _XEN_PCIF_active and clearing _PDEVF_op_active. */ test_and_schedule_op(pdev); } diff --git a/drivers/xen/pciback/slot.c b/drivers/xen/pciback/slot.c index 105a8b6..efb922d 100644 --- a/drivers/xen/pciback/slot.c +++ b/drivers/xen/pciback/slot.c @@ -65,7 +65,8 @@ int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev, for (slot = 0; slot < PCI_SLOT_MAX; slot++) { if (slot_dev->slots[bus][slot] == NULL) { printk(KERN_INFO - "pciback: slot: %s: assign to virtual slot %d, bus %d\n", + "pciback: slot: %s: assign to virtual " + "slot %d, bus %d\n", pci_name(dev), slot, bus); slot_dev->slots[bus][slot] = dev; goto unlock; @@ -76,14 +77,14 @@ int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev, xenbus_dev_fatal(pdev->xdev, err, "No more space on root virtual PCI bus"); - unlock: +unlock: spin_unlock_irqrestore(&slot_dev->lock, flags); /* Publish this device. */ - if(!err) + if (!err) err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, 0), devid); - out: +out: return err; } @@ -105,7 +106,7 @@ void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev) } } - out: +out: spin_unlock_irqrestore(&slot_dev->lock, flags); if (found_dev) @@ -156,8 +157,10 @@ void pciback_release_devices(struct pciback_device *pdev) pdev->pci_dev_data = NULL; } -int pciback_get_pcifront_dev(struct pci_dev *pcidev, struct pciback_device *pdev, - unsigned int *domain, unsigned int *bus, unsigned int *devfn) +int pciback_get_pcifront_dev(struct pci_dev *pcidev, + struct pciback_device *pdev, + unsigned int *domain, unsigned int *bus, + unsigned int *devfn) { int slot, busnr; struct slot_dev_data *slot_dev = pdev->pci_dev_data; @@ -172,11 +175,12 @@ int pciback_get_pcifront_dev(struct pci_dev *pcidev, struct pciback_device *pdev dev = slot_dev->slots[busnr][slot]; if (dev && dev->bus->number == pcidev->bus->number && dev->devfn == pcidev->devfn - && pci_domain_nr(dev->bus) == pci_domain_nr(pcidev->bus)) { + && pci_domain_nr(dev->bus) =+ pci_domain_nr(pcidev->bus)) { found = 1; *domain = 0; *bus = busnr; - *devfn = PCI_DEVFN(slot,0); + *devfn = PCI_DEVFN(slot, 0); goto out; } } diff --git a/drivers/xen/pciback/vpci.c b/drivers/xen/pciback/vpci.c index a5b7ece..721b81b 100644 --- a/drivers/xen/pciback/vpci.c +++ b/drivers/xen/pciback/vpci.c @@ -125,14 +125,14 @@ int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev, xenbus_dev_fatal(pdev->xdev, err, "No more space on root virtual PCI bus"); - unlock: +unlock: spin_unlock_irqrestore(&vpci_dev->lock, flags); /* Publish this device. */ - if(!err) + if (!err) err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, func), devid); - out: +out: return err; } @@ -158,7 +158,7 @@ void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev) } } - out: +out: spin_unlock_irqrestore(&vpci_dev->lock, flags); if (found_dev) @@ -176,9 +176,8 @@ int pciback_init_devices(struct pciback_device *pdev) spin_lock_init(&vpci_dev->lock); - for (slot = 0; slot < PCI_SLOT_MAX; slot++) { + for (slot = 0; slot < PCI_SLOT_MAX; slot++) INIT_LIST_HEAD(&vpci_dev->dev_list[slot]); - } pdev->pci_dev_data = vpci_dev; @@ -211,8 +210,10 @@ void pciback_release_devices(struct pciback_device *pdev) pdev->pci_dev_data = NULL; } -int pciback_get_pcifront_dev(struct pci_dev *pcidev, struct pciback_device *pdev, - unsigned int *domain, unsigned int *bus, unsigned int *devfn) +int pciback_get_pcifront_dev(struct pci_dev *pcidev, + struct pciback_device *pdev, + unsigned int *domain, unsigned int *bus, + unsigned int *devfn) { struct pci_dev_entry *entry; struct pci_dev *dev = NULL; @@ -227,15 +228,16 @@ int pciback_get_pcifront_dev(struct pci_dev *pcidev, struct pciback_device *pdev list) { dev = entry->dev; if (dev && dev->bus->number == pcidev->bus->number - && pci_domain_nr(dev->bus) == pci_domain_nr(pcidev->bus) - && dev->devfn == pcidev->devfn) - { + && pci_domain_nr(dev->bus) =+ pci_domain_nr(pcidev->bus) + && dev->devfn == pcidev->devfn) { found = 1; *domain = 0; *bus = 0; - *devfn = PCI_DEVFN(slot, PCI_FUNC(pcidev->devfn)); + *devfn = PCI_DEVFN(slot, + PCI_FUNC(pcidev->devfn)); } - } + } } spin_unlock_irqrestore(&vpci_dev->lock, flags); return found; diff --git a/drivers/xen/pciback/xenbus.c b/drivers/xen/pciback/xenbus.c index a85c413..efec585 100644 --- a/drivers/xen/pciback/xenbus.c +++ b/drivers/xen/pciback/xenbus.c @@ -40,7 +40,7 @@ static struct pciback_device *alloc_pdev(struct xenbus_device *xdev) kfree(pdev); pdev = NULL; } - out: +out: return pdev; } @@ -111,7 +111,7 @@ static int pciback_do_attach(struct pciback_device *pdev, int gnt_ref, err = 0; dev_dbg(&pdev->xdev->dev, "Attached!\n"); - out: +out: return err; } @@ -166,11 +166,10 @@ static int pciback_attach(struct pciback_device *pdev) "Error switching to connected state!"); dev_dbg(&pdev->xdev->dev, "Connected? %d\n", err); - out: +out: spin_unlock(&pdev->dev_lock); - if (magic) - kfree(magic); + kfree(magic); return err; } @@ -193,7 +192,7 @@ static int pciback_publish_pci_dev(struct pciback_device *pdev, "%04x:%02x:%02x.%02x", domain, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); - out: +out: return err; } @@ -230,7 +229,7 @@ static int pciback_export_device(struct pciback_device *pdev, * to other driver domains (as he who controls the bridge can disable * it and stop the other devices from working). */ - out: +out: return err; } @@ -253,8 +252,8 @@ static int pciback_remove_device(struct pciback_device *pdev, } pciback_release_pci_dev(pdev, dev); - - out: + +out: return err; } @@ -314,7 +313,7 @@ static int pciback_publish_pci_root(struct pciback_device *pdev, err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, "root_num", "%d", (root_num + 1)); - out: +out: return err; } @@ -358,7 +357,7 @@ static int pciback_reconfigure(struct pciback_device *pdev) } err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, state_str, "%d", &substate); - if (err != 1) + if (err != 1) substate = XenbusStateUnknown; switch (substate) { @@ -389,14 +388,15 @@ static int pciback_reconfigure(struct pciback_device *pdev) "configuration"); goto out; } - + err = pciback_export_device(pdev, domain, bus, slot, func, i); if (err) goto out; /* Publish pci roots. */ - err = pciback_publish_pci_roots(pdev, pciback_publish_pci_root); + err = pciback_publish_pci_roots(pdev, + pciback_publish_pci_root); if (err) { xenbus_dev_fatal(pdev->xdev, err, "Error while publish PCI root" @@ -412,7 +412,7 @@ static int pciback_reconfigure(struct pciback_device *pdev) "Error switching substate of " "dev-%d\n", i); goto out; - } + } break; case XenbusStateClosing: @@ -445,7 +445,7 @@ static int pciback_reconfigure(struct pciback_device *pdev) err = pciback_remove_device(pdev, domain, bus, slot, func); - if(err) + if (err) goto out; /* TODO: If at some point we implement support for pci @@ -466,8 +466,8 @@ static int pciback_reconfigure(struct pciback_device *pdev) "Error switching to reconfigured state!"); goto out; } - - out: + +out: spin_unlock(&pdev->dev_lock); return 0; @@ -591,7 +591,7 @@ static int pciback_setup_backend(struct pciback_device *pdev) xenbus_dev_fatal(pdev->xdev, err, "Error switching " "substate of dev-%d\n", i); goto out; - } + } } err = pciback_publish_pci_roots(pdev, pciback_publish_pci_root); @@ -607,7 +607,7 @@ static int pciback_setup_backend(struct pciback_device *pdev) xenbus_dev_fatal(pdev->xdev, err, "Error switching to initialised state!"); - out: +out: spin_unlock(&pdev->dev_lock); if (!err) @@ -663,7 +663,7 @@ static int pciback_xenbus_probe(struct xenbus_device *dev, */ pciback_be_watch(&pdev->be_watch, NULL, 0); - out: +out: return err; } @@ -679,7 +679,7 @@ static int pciback_xenbus_remove(struct xenbus_device *dev) static const struct xenbus_device_id xenpci_ids[] = { {"pci"}, - {{0}}, + {""}, }; static struct xenbus_driver xenbus_pciback_driver = { -- 1.6.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel