aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/vmap.h
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@linaro.org>2013-05-10 17:22:16 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-05-13 11:59:43 +0100
commit73a6a932d6e927c4608a8726987a3e89545d7bee (patch)
tree39b5e473db34c111a1116314e52a0001b8dc98f2 /xen/include/xen/vmap.h
parent0a6a239a61baaaac1704ccd1594ab3860181b702 (diff)
downloadxen-73a6a932d6e927c4608a8726987a3e89545d7bee.tar.gz
xen-73a6a932d6e927c4608a8726987a3e89545d7bee.tar.bz2
xen-73a6a932d6e927c4608a8726987a3e89545d7bee.zip
xen/mm: Align virtual address on PAGE_SIZE in iounmap
ioremap function can unlikely return an unaligned virtual address if the physical address itself is unaligned on a page size. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> [ ijc -- include asm/page.h to fix build error on x86 ]
Diffstat (limited to 'xen/include/xen/vmap.h')
-rw-r--r--xen/include/xen/vmap.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index 88e5d997a0..b1923dd221 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -2,6 +2,7 @@
#define __XEN_VMAP_H__
#include <xen/types.h>
+#include <asm/page.h>
void *vm_alloc(unsigned int nr, unsigned int align);
void vm_free(const void *);
@@ -15,7 +16,9 @@ void __iomem *ioremap(paddr_t, size_t);
static inline void iounmap(void __iomem *va)
{
- vunmap((void __force *)va);
+ unsigned long addr = (unsigned long)(void __force *)va;
+
+ vunmap((void *)(addr & PAGE_MASK));
}
void vm_init(void);