[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V4 02/32] 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@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
CC: keir@xxxxxxx

Changes in v5:
    - replace unsigned int by unsigned long

Changes in v4:
    - replace vaddr_t by unsigned int
 xen/include/xen/vmap.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index 88e5d99..daee7f5 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -15,7 +15,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);

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.