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

Re: [Xen-devel] [PATCH V3 10/41] xen/mm: Align virtual address on PAGE_SIZE in iounmap



>>> On 10.05.13 at 04:17, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
> 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>

If you used "unsigned long" instead of "vaddr_t" (I don't think this
would build on x86 without doing so, as vaddr-t appear to be ARM
specific):

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

> --- 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);
> +    vaddr_t addr = (vaddr_t)(void __force *)va;
> +
> +    vunmap((void *)(addr & PAGE_MASK));
>  }
>  
>  void vm_init(void);



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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