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

Re: [Xen-devel] [PATCH] vunmap: let vunmap align virtual address by itself




On 19.07.19 12:51, Julien Grall wrote:
Currently vunmap() is called from  from xen/arch/arm/cpuerrata.c with an

s/  from//

address potentially not page aligned. Instead of fixing that in ARM code,

s/ARM/Arm/

we let vunmap() making alignment by itself and stripping other existing
vunmap() calls from prior masking. This makes it consistent with how
{,un}map_domain_page() currently works.

The commit message does not state what could goes wrong if the page is not 
aligned. So how about:

Since commit 9cc0618eb0 "xen/arm: mm: Sanity check any update of Xen page 
tables", the MM code requires the virtual address to be page-aligned. As the 
vunmap() helper is directly used the virtual address passed by its caller, this now 
implies the caller should pass a page-aligned virtual address.

One of the caller in xen/arch/arm/cpuerrata.c may actually pass an unaligned 
address resulting the vunmap() to silently fail and potentially making future 
user of vmap() to fail (the MM code does not allow to replace existing mapping).

In general, it would be better to have vunmap() more resilient to unaligned 
address. So the function is now page-aligning the virtual address.

Note that for multi-pages virtual mapping, the address should still point into 
the first page. Otherwise, vunmap() may only partially remove the mapping.

I'm ok with that.


Why did you remove the following line:
  - strip all existing vunmap() calls from prior masking

Because I already mentioned it in the main body of my message.

address potentially not page aligned. Instead of fixing that in ARM code,
we let vunmap() making alignment by itself and stripping other existing
vunmap() calls from prior masking.

Yet, with your text both notes are needed.

--
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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