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

Re: [Xen-devel] [PATCH] arm:cpuerrata: Align a virtual address before unmap



On 7/18/19 3:08 PM, Andrii Anisov wrote:
Hello Julien,

Hi,

On 18.07.19 16:44, Julien Grall wrote:
My suggestion about vunmap() still stands though.

+1 for the vunmap solution.

It was my initial idea.

But, the issue is introduced by change 9cc0618. In particular, by the check in `xen_pt_update()`

     if ( !IS_ALIGNED(virt, PAGE_SIZE) )
     {
        mm_printk("The virtual address is not aligned to the page-size.\n");
         return -EINVAL;
     }

So I assumed you had some specific idea about that check.

I am expecting all the callers to properly align the address.


I'd fix `xen_pt_update()` if you are ok with it.

Please no. The interfaces are already pretty horrible as it mixing address and frame. So this check here is partially closing the gap of passing misaligned virtual address.

If you look at the x86 counter-part, they also assume the address is aligned (see ASSERT in some of the helpers). So I think the proper way to go is aligning the address in vumap.

As Andrew pointed out, this also makes the interface more consistent with how {,un}map_domain_page() currently works.

Cheers,

--
Julien Grall

_______________________________________________
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®.