diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-12-20 17:01:18 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-12-20 17:01:18 -0500 |
commit | cb85f123cd2393581bcffad335bfc6bcdd58569c (patch) | |
tree | 7b0de48b2a13ca96251c02245ab906f7efa3ac18 /drivers/xen | |
parent | b79d2ff98caee60c07a7598aba3b26acd1655a99 (diff) | |
parent | caca6a03d365883564885f2c1da3e88dcf65d139 (diff) |
Merge commit 'v3.2-rc3' into stable/for-linus-3.3
* commit 'v3.2-rc3': (412 commits)
Linux 3.2-rc3
virtio-pci: make reset operation safer
virtio-mmio: Correct the name of the guest features selector
virtio: add HAS_IOMEM dependency to MMIO platform bus driver
eCryptfs: Extend array bounds for all filename chars
eCryptfs: Flush file in vma close
eCryptfs: Prevent file create race condition
regulator: TPS65910: Fix VDD1/2 voltage selector count
i2c: Make i2cdev_notifier_call static
i2c: Delete ANY_I2C_BUS
i2c: Fix device name for 10-bit slave address
i2c-algo-bit: Generate correct i2c address sequence for 10-bit target
drm: integer overflow in drm_mode_dirtyfb_ioctl()
Revert "of/irq: of_irq_find_parent: check for parent equal to child"
drivers/gpu/vga/vgaarb.c: add missing kfree
drm/radeon/kms/atom: unify i2c gpio table handling
drm/radeon/kms: fix up gpio i2c mask bits for r4xx for real
ttm: Don't return the bo reserved on error path
mount_subtree() pointless use-after-free
iio: fix a leak due to improper use of anon_inode_getfd()
...
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/balloon.c | 4 | ||||
-rw-r--r-- | drivers/xen/gntalloc.c | 4 | ||||
-rw-r--r-- | drivers/xen/gntdev.c | 10 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 11 |
4 files changed, 17 insertions, 12 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index a767884a6c7a..31ab82fda38a 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -501,7 +501,7 @@ EXPORT_SYMBOL_GPL(balloon_set_new_target); | |||
501 | * alloc_xenballooned_pages - get pages that have been ballooned out | 501 | * alloc_xenballooned_pages - get pages that have been ballooned out |
502 | * @nr_pages: Number of pages to get | 502 | * @nr_pages: Number of pages to get |
503 | * @pages: pages returned | 503 | * @pages: pages returned |
504 | * @highmem: highmem or lowmem pages | 504 | * @highmem: allow highmem pages |
505 | * @return 0 on success, error otherwise | 505 | * @return 0 on success, error otherwise |
506 | */ | 506 | */ |
507 | int alloc_xenballooned_pages(int nr_pages, struct page **pages, bool highmem) | 507 | int alloc_xenballooned_pages(int nr_pages, struct page **pages, bool highmem) |
@@ -511,7 +511,7 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages, bool highmem) | |||
511 | mutex_lock(&balloon_mutex); | 511 | mutex_lock(&balloon_mutex); |
512 | while (pgno < nr_pages) { | 512 | while (pgno < nr_pages) { |
513 | page = balloon_retrieve(highmem); | 513 | page = balloon_retrieve(highmem); |
514 | if (page && PageHighMem(page) == highmem) { | 514 | if (page && (highmem || !PageHighMem(page))) { |
515 | pages[pgno++] = page; | 515 | pages[pgno++] = page; |
516 | } else { | 516 | } else { |
517 | enum bp_state st; | 517 | enum bp_state st; |
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c index e8ea56583b4c..e2400c8963fa 100644 --- a/drivers/xen/gntalloc.c +++ b/drivers/xen/gntalloc.c | |||
@@ -141,7 +141,7 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, | |||
141 | /* Grant foreign access to the page. */ | 141 | /* Grant foreign access to the page. */ |
142 | gref->gref_id = gnttab_grant_foreign_access(op->domid, | 142 | gref->gref_id = gnttab_grant_foreign_access(op->domid, |
143 | pfn_to_mfn(page_to_pfn(gref->page)), readonly); | 143 | pfn_to_mfn(page_to_pfn(gref->page)), readonly); |
144 | if (gref->gref_id < 0) { | 144 | if ((int)gref->gref_id < 0) { |
145 | rc = gref->gref_id; | 145 | rc = gref->gref_id; |
146 | goto undo; | 146 | goto undo; |
147 | } | 147 | } |
@@ -290,7 +290,7 @@ static long gntalloc_ioctl_alloc(struct gntalloc_file_private_data *priv, | |||
290 | goto out; | 290 | goto out; |
291 | } | 291 | } |
292 | 292 | ||
293 | gref_ids = kzalloc(sizeof(gref_ids[0]) * op.count, GFP_TEMPORARY); | 293 | gref_ids = kcalloc(op.count, sizeof(gref_ids[0]), GFP_TEMPORARY); |
294 | if (!gref_ids) { | 294 | if (!gref_ids) { |
295 | rc = -ENOMEM; | 295 | rc = -ENOMEM; |
296 | goto out; | 296 | goto out; |
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index a7308559a26a..f52f661f8f82 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c | |||
@@ -114,11 +114,11 @@ static struct grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count) | |||
114 | if (NULL == add) | 114 | if (NULL == add) |
115 | return NULL; | 115 | return NULL; |
116 | 116 | ||
117 | add->grants = kzalloc(sizeof(add->grants[0]) * count, GFP_KERNEL); | 117 | add->grants = kcalloc(count, sizeof(add->grants[0]), GFP_KERNEL); |
118 | add->map_ops = kzalloc(sizeof(add->map_ops[0]) * count, GFP_KERNEL); | 118 | add->map_ops = kcalloc(count, sizeof(add->map_ops[0]), GFP_KERNEL); |
119 | add->unmap_ops = kzalloc(sizeof(add->unmap_ops[0]) * count, GFP_KERNEL); | 119 | add->unmap_ops = kcalloc(count, sizeof(add->unmap_ops[0]), GFP_KERNEL); |
120 | add->kmap_ops = kzalloc(sizeof(add->kmap_ops[0]) * count, GFP_KERNEL); | 120 | add->kmap_ops = kcalloc(count, sizeof(add->kmap_ops[0]), GFP_KERNEL); |
121 | add->pages = kzalloc(sizeof(add->pages[0]) * count, GFP_KERNEL); | 121 | add->pages = kcalloc(count, sizeof(add->pages[0]), GFP_KERNEL); |
122 | if (NULL == add->grants || | 122 | if (NULL == add->grants || |
123 | NULL == add->map_ops || | 123 | NULL == add->map_ops || |
124 | NULL == add->unmap_ops || | 124 | NULL == add->unmap_ops || |
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 81c3ce6b8bbe..1906125eab49 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/vmalloc.h> | 35 | #include <linux/vmalloc.h> |
36 | #include <linux/export.h> | 36 | #include <linux/export.h> |
37 | #include <asm/xen/hypervisor.h> | 37 | #include <asm/xen/hypervisor.h> |
38 | #include <asm/xen/page.h> | ||
38 | #include <xen/interface/xen.h> | 39 | #include <xen/interface/xen.h> |
39 | #include <xen/interface/event_channel.h> | 40 | #include <xen/interface/event_channel.h> |
40 | #include <xen/events.h> | 41 | #include <xen/events.h> |
@@ -436,19 +437,20 @@ EXPORT_SYMBOL_GPL(xenbus_free_evtchn); | |||
436 | int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr) | 437 | int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr) |
437 | { | 438 | { |
438 | struct gnttab_map_grant_ref op = { | 439 | struct gnttab_map_grant_ref op = { |
439 | .flags = GNTMAP_host_map, | 440 | .flags = GNTMAP_host_map | GNTMAP_contains_pte, |
440 | .ref = gnt_ref, | 441 | .ref = gnt_ref, |
441 | .dom = dev->otherend_id, | 442 | .dom = dev->otherend_id, |
442 | }; | 443 | }; |
443 | struct vm_struct *area; | 444 | struct vm_struct *area; |
445 | pte_t *pte; | ||
444 | 446 | ||
445 | *vaddr = NULL; | 447 | *vaddr = NULL; |
446 | 448 | ||
447 | area = alloc_vm_area(PAGE_SIZE); | 449 | area = alloc_vm_area(PAGE_SIZE, &pte); |
448 | if (!area) | 450 | if (!area) |
449 | return -ENOMEM; | 451 | return -ENOMEM; |
450 | 452 | ||
451 | op.host_addr = (unsigned long)area->addr; | 453 | op.host_addr = arbitrary_virt_to_machine(pte).maddr; |
452 | 454 | ||
453 | if (HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1)) | 455 | if (HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1)) |
454 | BUG(); | 456 | BUG(); |
@@ -527,6 +529,7 @@ int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr) | |||
527 | struct gnttab_unmap_grant_ref op = { | 529 | struct gnttab_unmap_grant_ref op = { |
528 | .host_addr = (unsigned long)vaddr, | 530 | .host_addr = (unsigned long)vaddr, |
529 | }; | 531 | }; |
532 | unsigned int level; | ||
530 | 533 | ||
531 | /* It'd be nice if linux/vmalloc.h provided a find_vm_area(void *addr) | 534 | /* It'd be nice if linux/vmalloc.h provided a find_vm_area(void *addr) |
532 | * method so that we don't have to muck with vmalloc internals here. | 535 | * method so that we don't have to muck with vmalloc internals here. |
@@ -548,6 +551,8 @@ int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr) | |||
548 | } | 551 | } |
549 | 552 | ||
550 | op.handle = (grant_handle_t)area->phys_addr; | 553 | op.handle = (grant_handle_t)area->phys_addr; |
554 | op.host_addr = arbitrary_virt_to_machine( | ||
555 | lookup_address((unsigned long)vaddr, &level)).maddr; | ||
551 | 556 | ||
552 | if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1)) | 557 | if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1)) |
553 | BUG(); | 558 | BUG(); |