All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, keir@xen.org, ian.campbell@citrix.com,
	Julien Grall <julien.grall@linaro.org>,
	Stefano.Stabellini@eu.citrix.com
Subject: [PATCH V4 02/32] xen/mm: Align virtual address on PAGE_SIZE in iounmap
Date: Fri, 10 May 2013 16:11:54 +0100	[thread overview]
Message-ID: <1368198723-24639-3-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1368198723-24639-1-git-send-email-julien.grall@linaro.org>

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>
CC: keir@xen.org

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..45e9870 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 int addr = (unsigned int)(void __force *)va;
+
+    vunmap((void *)(addr & PAGE_MASK));
 }
 
 void vm_init(void);
-- 
1.7.10.4

  parent reply	other threads:[~2013-05-10 15:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 15:11 [PATCH V4 00/32] Support multiple ARM platform in Xen Julien Grall
2013-05-10 15:11 ` [PATCH V4 01/32] xen/arm: Extend create_xen_entries prototype to take mapping attribute Julien Grall
2013-05-13 11:01   ` Ian Campbell
2013-05-10 15:11 ` Julien Grall [this message]
2013-05-10 16:16   ` [PATCH V4 02/32] xen/mm: Align virtual address on PAGE_SIZE in iounmap Julien Grall
2013-05-10 16:22   ` Julien Grall
2013-05-13 11:01   ` Ian Campbell
2013-05-13 11:09     ` Jan Beulich
2013-05-13 11:24       ` Ian Campbell
2013-05-10 15:11 ` [PATCH V4 03/32] xen/arm: Introduce ioremap_attr, ioremap_cache, ioremap_nocache, ioremap_wc Julien Grall
2013-05-10 15:24   ` Ian Campbell
2013-05-10 15:11 ` [PATCH V4 04/32] xen/arm: Add helpers ioreadl/iowritel Julien Grall
2013-05-10 15:38   ` Ian Campbell
2013-05-10 16:24   ` Julien Grall
2013-05-10 15:11 ` [PATCH V4 05/32] xen/arm: Create a hierarchical device tree Julien Grall
2013-05-10 15:38   ` Ian Campbell
2013-05-10 15:11 ` [PATCH V4 19/32] xen/arm: Add generic UART to get the device in the " Julien Grall
2013-05-10 15:11 ` [PATCH V4 20/32] xen/arm: Use device tree API in pl011 UART driver Julien Grall
2013-05-10 15:12 ` [PATCH V4 22/32] xen/arm: Allow Xen to run on multiple platform without recompilation Julien Grall
2013-05-10 15:12 ` [PATCH V4 24/32] xen/arm: Add versatile express platform Julien Grall
2013-05-10 15:39   ` Ian Campbell
2013-05-10 15:12 ` [PATCH V4 28/32] xen/arm: Add Exynos 4210 UART support Julien Grall
2013-05-10 15:12 ` [PATCH V4 30/32] xen/arm: Add platform specific code for the exynos5 Julien Grall
2013-05-13 11:21 ` [PATCH V4 00/32] Support multiple ARM platform in Xen Ian Campbell
2013-05-13 12:09   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368198723-24639-3-git-send-email-julien.grall@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=patches@linaro.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.