Commit 5f0ababb authored by Isaku Yamahata's avatar Isaku Yamahata Committed by Ingo Molnar

xen: replace callers of alloc_vm_area()/free_vm_area() with xen_ prefixed one

Don't use alloc_vm_area()/free_vm_area() directly, instead define
xen_alloc_vm_area()/xen_free_vm_area() and use them.

alloc_vm_area()/free_vm_area() are used to allocate/free area which
are for grant table mapping. Xen/x86 grant table is based on virtual
address so that alloc_vm_area()/free_vm_area() are suitable.
On the other hand Xen/ia64 (and Xen/powerpc) grant table is based on
pseudo physical address (guest physical address) so that allocation
should be done differently.
The original version of xenified Linux/IA64 have its own
allocate_vm_area()/free_vm_area() definitions which don't allocate vm area
contradictory to those names.
Now vanilla Linux already has its definitions so that it's impossible
to have IA64 definitions of allocate_vm_area()/free_vm_area().
Instead introduce xen_allocate_vm_area()/xen_free_vm_area() and use them.
Signed-off-by: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 20e71f2e
...@@ -482,7 +482,7 @@ static int gnttab_map(unsigned int start_idx, unsigned int end_idx) ...@@ -482,7 +482,7 @@ static int gnttab_map(unsigned int start_idx, unsigned int end_idx)
if (shared == NULL) { if (shared == NULL) {
struct vm_struct *area; struct vm_struct *area;
area = alloc_vm_area(PAGE_SIZE * max_nr_grant_frames()); area = xen_alloc_vm_area(PAGE_SIZE * max_nr_grant_frames());
BUG_ON(area == NULL); BUG_ON(area == NULL);
shared = area->addr; shared = area->addr;
} }
......
...@@ -399,7 +399,7 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr) ...@@ -399,7 +399,7 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr)
*vaddr = NULL; *vaddr = NULL;
area = alloc_vm_area(PAGE_SIZE); area = xen_alloc_vm_area(PAGE_SIZE);
if (!area) if (!area)
return -ENOMEM; return -ENOMEM;
...@@ -409,7 +409,7 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr) ...@@ -409,7 +409,7 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr)
BUG(); BUG();
if (op.status != GNTST_okay) { if (op.status != GNTST_okay) {
free_vm_area(area); xen_free_vm_area(area);
xenbus_dev_fatal(dev, op.status, xenbus_dev_fatal(dev, op.status,
"mapping in shared page %d from domain %d", "mapping in shared page %d from domain %d",
gnt_ref, dev->otherend_id); gnt_ref, dev->otherend_id);
...@@ -508,7 +508,7 @@ int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr) ...@@ -508,7 +508,7 @@ int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr)
BUG(); BUG();
if (op.status == GNTST_okay) if (op.status == GNTST_okay)
free_vm_area(area); xen_free_vm_area(area);
else else
xenbus_dev_error(dev, op.status, xenbus_dev_error(dev, op.status,
"unmapping page at handle %d error %d", "unmapping page at handle %d error %d",
......
#ifndef __XEN_GRANT_TABLE_H
#define __XEN_GRANT_TABLE_H
#define xen_alloc_vm_area(size) alloc_vm_area(size)
#define xen_free_vm_area(area) free_vm_area(area)
#endif /* __XEN_GRANT_TABLE_H */
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <asm/xen/hypervisor.h> #include <asm/xen/hypervisor.h>
#include <xen/interface/grant_table.h> #include <xen/interface/grant_table.h>
#include <asm/xen/grant_table.h>
/* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
#define NR_GRANT_FRAMES 4 #define NR_GRANT_FRAMES 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment