aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/cpu_hotplug.c3
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c8
-rw-r--r--drivers/xen/xen-pciback/xenbus.c5
-rw-r--r--drivers/xen/xenbus/xenbus_dev_frontend.c4
4 files changed, 13 insertions, 7 deletions
diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
index 14e2d995e958..4dcfced107f5 100644
--- a/drivers/xen/cpu_hotplug.c
+++ b/drivers/xen/cpu_hotplug.c
@@ -30,7 +30,8 @@ static int vcpu_online(unsigned int cpu)
30 sprintf(dir, "cpu/%u", cpu); 30 sprintf(dir, "cpu/%u", cpu);
31 err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state); 31 err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
32 if (err != 1) { 32 if (err != 1) {
33 printk(KERN_ERR "XENBUS: Unable to read cpu state\n"); 33 if (!xen_initial_domain())
34 printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
34 return err; 35 return err;
35 } 36 }
36 37
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 7944a17f5cbf..19834d1c7c36 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -884,7 +884,7 @@ static inline int str_to_quirk(const char *buf, int *domain, int *bus, int
884 int err; 884 int err;
885 885
886 err = 886 err =
887 sscanf(buf, " %04x:%02x:%02x.%1x-%08x:%1x:%08x", domain, bus, slot, 887 sscanf(buf, " %04x:%02x:%02x.%d-%08x:%1x:%08x", domain, bus, slot,
888 func, reg, size, mask); 888 func, reg, size, mask);
889 if (err == 7) 889 if (err == 7)
890 return 0; 890 return 0;
@@ -904,7 +904,7 @@ static int pcistub_device_id_add(int domain, int bus, int slot, int func)
904 pci_dev_id->bus = bus; 904 pci_dev_id->bus = bus;
905 pci_dev_id->devfn = PCI_DEVFN(slot, func); 905 pci_dev_id->devfn = PCI_DEVFN(slot, func);
906 906
907 pr_debug(DRV_NAME ": wants to seize %04x:%02x:%02x.%01x\n", 907 pr_debug(DRV_NAME ": wants to seize %04x:%02x:%02x.%d\n",
908 domain, bus, slot, func); 908 domain, bus, slot, func);
909 909
910 spin_lock_irqsave(&device_ids_lock, flags); 910 spin_lock_irqsave(&device_ids_lock, flags);
@@ -934,7 +934,7 @@ static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
934 934
935 err = 0; 935 err = 0;
936 936
937 pr_debug(DRV_NAME ": removed %04x:%02x:%02x.%01x from " 937 pr_debug(DRV_NAME ": removed %04x:%02x:%02x.%d from "
938 "seize list\n", domain, bus, slot, func); 938 "seize list\n", domain, bus, slot, func);
939 } 939 }
940 } 940 }
@@ -1029,7 +1029,7 @@ static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf)
1029 break; 1029 break;
1030 1030
1031 count += scnprintf(buf + count, PAGE_SIZE - count, 1031 count += scnprintf(buf + count, PAGE_SIZE - count,
1032 "%04x:%02x:%02x.%01x\n", 1032 "%04x:%02x:%02x.%d\n",
1033 pci_dev_id->domain, pci_dev_id->bus, 1033 pci_dev_id->domain, pci_dev_id->bus,
1034 PCI_SLOT(pci_dev_id->devfn), 1034 PCI_SLOT(pci_dev_id->devfn),
1035 PCI_FUNC(pci_dev_id->devfn)); 1035 PCI_FUNC(pci_dev_id->devfn));
diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
index d5dcf8d5d3d9..64b11f99eacc 100644
--- a/drivers/xen/xen-pciback/xenbus.c
+++ b/drivers/xen/xen-pciback/xenbus.c
@@ -206,6 +206,7 @@ static int xen_pcibk_publish_pci_dev(struct xen_pcibk_device *pdev,
206 goto out; 206 goto out;
207 } 207 }
208 208
209 /* Note: The PV protocol uses %02x, don't change it */
209 err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str, 210 err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str,
210 "%04x:%02x:%02x.%02x", domain, bus, 211 "%04x:%02x:%02x.%02x", domain, bus,
211 PCI_SLOT(devfn), PCI_FUNC(devfn)); 212 PCI_SLOT(devfn), PCI_FUNC(devfn));
@@ -229,7 +230,7 @@ static int xen_pcibk_export_device(struct xen_pcibk_device *pdev,
229 err = -EINVAL; 230 err = -EINVAL;
230 xenbus_dev_fatal(pdev->xdev, err, 231 xenbus_dev_fatal(pdev->xdev, err,
231 "Couldn't locate PCI device " 232 "Couldn't locate PCI device "
232 "(%04x:%02x:%02x.%01x)! " 233 "(%04x:%02x:%02x.%d)! "
233 "perhaps already in-use?", 234 "perhaps already in-use?",
234 domain, bus, slot, func); 235 domain, bus, slot, func);
235 goto out; 236 goto out;
@@ -274,7 +275,7 @@ static int xen_pcibk_remove_device(struct xen_pcibk_device *pdev,
274 if (!dev) { 275 if (!dev) {
275 err = -EINVAL; 276 err = -EINVAL;
276 dev_dbg(&pdev->xdev->dev, "Couldn't locate PCI device " 277 dev_dbg(&pdev->xdev->dev, "Couldn't locate PCI device "
277 "(%04x:%02x:%02x.%01x)! not owned by this domain\n", 278 "(%04x:%02x:%02x.%d)! not owned by this domain\n",
278 domain, bus, slot, func); 279 domain, bus, slot, func);
279 goto out; 280 goto out;
280 } 281 }
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
index 527dc2a3b89f..89f76252a16f 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -369,6 +369,10 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
369 goto out; 369 goto out;
370 } 370 }
371 token++; 371 token++;
372 if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) {
373 rc = -EILSEQ;
374 goto out;
375 }
372 376
373 if (msg_type == XS_WATCH) { 377 if (msg_type == XS_WATCH) {
374 watch = alloc_watch_adapter(path, token); 378 watch = alloc_watch_adapter(path, token);