aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/Makefile1
-rw-r--r--drivers/xen/dbgp.c48
-rw-r--r--drivers/xen/gntalloc.c2
-rw-r--r--drivers/xen/gntdev.c7
-rw-r--r--drivers/xen/grant-table.c6
-rw-r--r--drivers/xen/privcmd.c3
-rw-r--r--drivers/xen/xen-acpi-processor.c1
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c2
-rw-r--r--drivers/xen/xenfs/super.c3
9 files changed, 63 insertions, 10 deletions
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 275abfc615cb..0e8637035457 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -9,6 +9,7 @@ nostackp := $(call cc-option, -fno-stack-protector)
9CFLAGS_features.o := $(nostackp) 9CFLAGS_features.o := $(nostackp)
10 10
11dom0-$(CONFIG_PCI) += pci.o 11dom0-$(CONFIG_PCI) += pci.o
12dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
12dom0-$(CONFIG_ACPI) += acpi.o 13dom0-$(CONFIG_ACPI) += acpi.o
13dom0-$(CONFIG_X86) += pcpu.o 14dom0-$(CONFIG_X86) += pcpu.o
14obj-$(CONFIG_XEN_DOM0) += $(dom0-y) 15obj-$(CONFIG_XEN_DOM0) += $(dom0-y)
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
9static 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
34int xen_dbgp_reset_prep(struct usb_hcd *hcd)
35{
36 return xen_dbgp_op(hcd, PHYSDEVOP_DBGP_RESET_PREPARE);
37}
38
39int 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>
46EXPORT_SYMBOL_GPL(xen_dbgp_reset_prep);
47EXPORT_SYMBOL_GPL(xen_dbgp_external_startup);
48#endif
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
index 934985d14c24..4097987b330e 100644
--- a/drivers/xen/gntalloc.c
+++ b/drivers/xen/gntalloc.c
@@ -535,7 +535,7 @@ static int gntalloc_mmap(struct file *filp, struct vm_area_struct *vma)
535 535
536 vma->vm_private_data = vm_priv; 536 vma->vm_private_data = vm_priv;
537 537
538 vma->vm_flags |= VM_RESERVED | VM_DONTEXPAND; 538 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
539 539
540 vma->vm_ops = &gntalloc_vmops; 540 vma->vm_ops = &gntalloc_vmops;
541 541
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 163b7e985ed0..610bfc6be177 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
@@ -719,7 +720,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
719 720
720 vma->vm_ops = &gntdev_vmops; 721 vma->vm_ops = &gntdev_vmops;
721 722
722 vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND; 723 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
723 724
724 if (use_ptemod) 725 if (use_ptemod)
725 vma->vm_flags |= VM_DONTCOPY; 726 vma->vm_flags |= VM_DONTCOPY;
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 3a567b15600b..b2b0a375b348 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -923,7 +923,8 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
923EXPORT_SYMBOL_GPL(gnttab_map_refs); 923EXPORT_SYMBOL_GPL(gnttab_map_refs);
924 924
925int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, 925int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
926 struct page **pages, unsigned int count, bool clear_pte) 926 struct gnttab_map_grant_ref *kmap_ops,
927 struct page **pages, unsigned int count)
927{ 928{
928 int i, ret; 929 int i, ret;
929 bool lazy = false; 930 bool lazy = false;
@@ -941,7 +942,8 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
941 } 942 }
942 943
943 for (i = 0; i < count; i++) { 944 for (i = 0; i < count; i++) {
944 ret = m2p_remove_override(pages[i], clear_pte); 945 ret = m2p_remove_override(pages[i], kmap_ops ?
946 &kmap_ops[i] : NULL);
945 if (ret) 947 if (ret)
946 return ret; 948 return ret;
947 } 949 }
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index ef6389580b8c..8adb9cc267f9 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -455,7 +455,8 @@ static int privcmd_mmap(struct file *file, struct vm_area_struct *vma)
455{ 455{
456 /* DONTCOPY is essential for Xen because copy_page_range doesn't know 456 /* DONTCOPY is essential for Xen because copy_page_range doesn't know
457 * how to recreate these mappings */ 457 * how to recreate these mappings */
458 vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY | VM_PFNMAP; 458 vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTCOPY |
459 VM_DONTEXPAND | VM_DONTDUMP;
459 vma->vm_ops = &privcmd_vm_ops; 460 vma->vm_ops = &privcmd_vm_ops;
460 vma->vm_private_data = NULL; 461 vma->vm_private_data = NULL;
461 462
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index b590ee067fcd..316df65163cf 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -98,7 +98,6 @@ static int push_cxx_to_hypervisor(struct acpi_processor *_pr)
98 98
99 dst_cx->type = cx->type; 99 dst_cx->type = cx->type;
100 dst_cx->latency = cx->latency; 100 dst_cx->latency = cx->latency;
101 dst_cx->power = cx->power;
102 101
103 dst_cx->dpcnt = 0; 102 dst_cx->dpcnt = 0;
104 set_xen_guest_handle(dst_cx->dp, NULL); 103 set_xen_guest_handle(dst_cx->dp, NULL);
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index e5a0c13e2ad4..961d664e2d2f 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -872,7 +872,7 @@ end:
872} 872}
873 873
874/*add xen_pcibk AER handling*/ 874/*add xen_pcibk AER handling*/
875static struct pci_error_handlers xen_pcibk_error_handler = { 875static const struct pci_error_handlers xen_pcibk_error_handler = {
876 .error_detected = xen_pcibk_error_detected, 876 .error_detected = xen_pcibk_error_detected,
877 .mmio_enabled = xen_pcibk_mmio_enabled, 877 .mmio_enabled = xen_pcibk_mmio_enabled,
878 .slot_reset = xen_pcibk_slot_reset, 878 .slot_reset = xen_pcibk_slot_reset,
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
index a84b53c01436..459b9ac45cf5 100644
--- a/drivers/xen/xenfs/super.c
+++ b/drivers/xen/xenfs/super.c
@@ -30,7 +30,8 @@ static struct inode *xenfs_make_inode(struct super_block *sb, int mode)
30 30
31 if (ret) { 31 if (ret) {
32 ret->i_mode = mode; 32 ret->i_mode = mode;
33 ret->i_uid = ret->i_gid = 0; 33 ret->i_uid = GLOBAL_ROOT_UID;
34 ret->i_gid = GLOBAL_ROOT_GID;
34 ret->i_blocks = 0; 35 ret->i_blocks = 0;
35 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 36 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
36 } 37 }