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/xenbus/xenbus_client.c | |
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/xenbus/xenbus_client.c')
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 11 |
1 files changed, 8 insertions, 3 deletions
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(); |