diff options
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/Makefile | 2 | ||||
-rw-r--r-- | drivers/xen/dbgp.c | 48 | ||||
-rw-r--r-- | drivers/xen/gntdev.c | 5 | ||||
-rw-r--r-- | drivers/xen/grant-table.c | 6 | ||||
-rw-r--r-- | drivers/xen/platform-pci.c | 15 | ||||
-rw-r--r-- | drivers/xen/swiotlb-xen.c | 2 | ||||
-rw-r--r-- | drivers/xen/xen-pciback/pci_stub.c | 10 |
7 files changed, 62 insertions, 26 deletions
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile index d80bea5535a2..a4a3cab2f459 100644 --- a/drivers/xen/Makefile +++ b/drivers/xen/Makefile | |||
@@ -18,7 +18,7 @@ obj-$(CONFIG_XEN_PVHVM) += platform-pci.o | |||
18 | obj-$(CONFIG_XEN_TMEM) += tmem.o | 18 | obj-$(CONFIG_XEN_TMEM) += tmem.o |
19 | obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o | 19 | obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o |
20 | obj-$(CONFIG_XEN_DOM0) += pcpu.o | 20 | obj-$(CONFIG_XEN_DOM0) += pcpu.o |
21 | obj-$(CONFIG_XEN_DOM0) += pci.o acpi.o | 21 | obj-$(CONFIG_XEN_DOM0) += pci.o dbgp.o acpi.o |
22 | obj-$(CONFIG_XEN_MCE_LOG) += mcelog.o | 22 | obj-$(CONFIG_XEN_MCE_LOG) += mcelog.o |
23 | obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/ | 23 | obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/ |
24 | obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o | 24 | obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o |
diff --git a/drivers/xen/dbgp.c b/drivers/xen/dbgp.c new file mode 100644 index 000000000000..42569c77ccc8 --- /dev/null +++ b/drivers/xen/dbgp.c | |||
@@ -0,0 +1,48 @@ | |||
1 | #include <linux/pci.h> | ||
2 | #include <linux/usb.h> | ||
3 | #include <linux/usb/ehci_def.h> | ||
4 | #include <linux/usb/hcd.h> | ||
5 | #include <asm/xen/hypercall.h> | ||
6 | #include <xen/interface/physdev.h> | ||
7 | #include <xen/xen.h> | ||
8 | |||
9 | static int xen_dbgp_op(struct usb_hcd *hcd, int op) | ||
10 | { | ||
11 | const struct device *ctrlr = hcd_to_bus(hcd)->controller; | ||
12 | struct physdev_dbgp_op dbgp; | ||
13 | |||
14 | if (!xen_initial_domain()) | ||
15 | return 0; | ||
16 | |||
17 | dbgp.op = op; | ||
18 | |||
19 | #ifdef CONFIG_PCI | ||
20 | if (ctrlr->bus == &pci_bus_type) { | ||
21 | const struct pci_dev *pdev = to_pci_dev(ctrlr); | ||
22 | |||
23 | dbgp.u.pci.seg = pci_domain_nr(pdev->bus); | ||
24 | dbgp.u.pci.bus = pdev->bus->number; | ||
25 | dbgp.u.pci.devfn = pdev->devfn; | ||
26 | dbgp.bus = PHYSDEVOP_DBGP_BUS_PCI; | ||
27 | } else | ||
28 | #endif | ||
29 | dbgp.bus = PHYSDEVOP_DBGP_BUS_UNKNOWN; | ||
30 | |||
31 | return HYPERVISOR_physdev_op(PHYSDEVOP_dbgp_op, &dbgp); | ||
32 | } | ||
33 | |||
34 | int xen_dbgp_reset_prep(struct usb_hcd *hcd) | ||
35 | { | ||
36 | return xen_dbgp_op(hcd, PHYSDEVOP_DBGP_RESET_PREPARE); | ||
37 | } | ||
38 | |||
39 | int xen_dbgp_external_startup(struct usb_hcd *hcd) | ||
40 | { | ||
41 | return xen_dbgp_op(hcd, PHYSDEVOP_DBGP_RESET_DONE); | ||
42 | } | ||
43 | |||
44 | #ifndef CONFIG_EARLY_PRINTK_DBGP | ||
45 | #include <linux/export.h> | ||
46 | EXPORT_SYMBOL_GPL(xen_dbgp_reset_prep); | ||
47 | EXPORT_SYMBOL_GPL(xen_dbgp_external_startup); | ||
48 | #endif | ||
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 1ffd03bf8e10..7f1241608489 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c | |||
@@ -314,8 +314,9 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages) | |||
314 | } | 314 | } |
315 | } | 315 | } |
316 | 316 | ||
317 | err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages + offset, | 317 | err = gnttab_unmap_refs(map->unmap_ops + offset, |
318 | pages, true); | 318 | use_ptemod ? map->kmap_ops + offset : NULL, map->pages + offset, |
319 | pages); | ||
319 | if (err) | 320 | if (err) |
320 | return err; | 321 | return err; |
321 | 322 | ||
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 0bfc1ef11259..006726688baf 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
@@ -870,7 +870,8 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
870 | EXPORT_SYMBOL_GPL(gnttab_map_refs); | 870 | EXPORT_SYMBOL_GPL(gnttab_map_refs); |
871 | 871 | ||
872 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | 872 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, |
873 | struct page **pages, unsigned int count, bool clear_pte) | 873 | struct gnttab_map_grant_ref *kmap_ops, |
874 | struct page **pages, unsigned int count) | ||
874 | { | 875 | { |
875 | int i, ret; | 876 | int i, ret; |
876 | bool lazy = false; | 877 | bool lazy = false; |
@@ -888,7 +889,8 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | |||
888 | } | 889 | } |
889 | 890 | ||
890 | for (i = 0; i < count; i++) { | 891 | for (i = 0; i < count; i++) { |
891 | ret = m2p_remove_override(pages[i], clear_pte); | 892 | ret = m2p_remove_override(pages[i], kmap_ops ? |
893 | &kmap_ops[i] : NULL); | ||
892 | if (ret) | 894 | if (ret) |
893 | return ret; | 895 | return ret; |
894 | } | 896 | } |
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c index d4c50d63acbc..97ca359ae2bd 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c | |||
@@ -101,19 +101,6 @@ static int platform_pci_resume(struct pci_dev *pdev) | |||
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | static void __devinit prepare_shared_info(void) | ||
105 | { | ||
106 | #ifdef CONFIG_KEXEC | ||
107 | unsigned long addr; | ||
108 | struct shared_info *hvm_shared_info; | ||
109 | |||
110 | addr = alloc_xen_mmio(PAGE_SIZE); | ||
111 | hvm_shared_info = ioremap(addr, PAGE_SIZE); | ||
112 | memset(hvm_shared_info, 0, PAGE_SIZE); | ||
113 | xen_hvm_prepare_kexec(hvm_shared_info, addr >> PAGE_SHIFT); | ||
114 | #endif | ||
115 | } | ||
116 | |||
117 | static int __devinit platform_pci_init(struct pci_dev *pdev, | 104 | static int __devinit platform_pci_init(struct pci_dev *pdev, |
118 | const struct pci_device_id *ent) | 105 | const struct pci_device_id *ent) |
119 | { | 106 | { |
@@ -151,8 +138,6 @@ static int __devinit platform_pci_init(struct pci_dev *pdev, | |||
151 | platform_mmio = mmio_addr; | 138 | platform_mmio = mmio_addr; |
152 | platform_mmiolen = mmio_len; | 139 | platform_mmiolen = mmio_len; |
153 | 140 | ||
154 | prepare_shared_info(); | ||
155 | |||
156 | if (!xen_have_vector_callback) { | 141 | if (!xen_have_vector_callback) { |
157 | ret = xen_allocate_irq(pdev); | 142 | ret = xen_allocate_irq(pdev); |
158 | if (ret) { | 143 | if (ret) { |
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 1afb4fba11b4..4d519488d304 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c | |||
@@ -232,7 +232,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |||
232 | return ret; | 232 | return ret; |
233 | 233 | ||
234 | if (hwdev && hwdev->coherent_dma_mask) | 234 | if (hwdev && hwdev->coherent_dma_mask) |
235 | dma_mask = hwdev->coherent_dma_mask; | 235 | dma_mask = dma_alloc_coherent_mask(hwdev, flags); |
236 | 236 | ||
237 | phys = virt_to_phys(ret); | 237 | phys = virt_to_phys(ret); |
238 | dev_addr = xen_phys_to_bus(phys); | 238 | dev_addr = xen_phys_to_bus(phys); |
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 097e536e8672..92ff01dbeb10 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c | |||
@@ -353,16 +353,16 @@ static int __devinit pcistub_init_device(struct pci_dev *dev) | |||
353 | if (err) | 353 | if (err) |
354 | goto config_release; | 354 | goto config_release; |
355 | 355 | ||
356 | dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n"); | ||
357 | __pci_reset_function_locked(dev); | ||
358 | |||
359 | /* We need the device active to save the state. */ | 356 | /* We need the device active to save the state. */ |
360 | dev_dbg(&dev->dev, "save state of device\n"); | 357 | dev_dbg(&dev->dev, "save state of device\n"); |
361 | pci_save_state(dev); | 358 | pci_save_state(dev); |
362 | dev_data->pci_saved_state = pci_store_saved_state(dev); | 359 | dev_data->pci_saved_state = pci_store_saved_state(dev); |
363 | if (!dev_data->pci_saved_state) | 360 | if (!dev_data->pci_saved_state) |
364 | dev_err(&dev->dev, "Could not store PCI conf saved state!\n"); | 361 | dev_err(&dev->dev, "Could not store PCI conf saved state!\n"); |
365 | 362 | else { | |
363 | dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n"); | ||
364 | __pci_reset_function_locked(dev); | ||
365 | } | ||
366 | /* Now disable the device (this also ensures some private device | 366 | /* Now disable the device (this also ensures some private device |
367 | * data is setup before we export) | 367 | * data is setup before we export) |
368 | */ | 368 | */ |
@@ -871,7 +871,7 @@ end: | |||
871 | } | 871 | } |
872 | 872 | ||
873 | /*add xen_pcibk AER handling*/ | 873 | /*add xen_pcibk AER handling*/ |
874 | static struct pci_error_handlers xen_pcibk_error_handler = { | 874 | static const struct pci_error_handlers xen_pcibk_error_handler = { |
875 | .error_detected = xen_pcibk_error_detected, | 875 | .error_detected = xen_pcibk_error_detected, |
876 | .mmio_enabled = xen_pcibk_mmio_enabled, | 876 | .mmio_enabled = xen_pcibk_mmio_enabled, |
877 | .slot_reset = xen_pcibk_slot_reset, | 877 | .slot_reset = xen_pcibk_slot_reset, |