]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen/arm: cpuerrata: Align a virtual address before unmap
authorAndrii Anisov <andrii_anisov@epam.com>
Thu, 18 Jul 2019 13:22:20 +0000 (16:22 +0300)
committerJulien Grall <julien.grall@arm.com>
Mon, 29 Jul 2019 11:39:27 +0000 (12:39 +0100)
After changes introduced by 9cc0618eb0 "xen/arm: mm: Sanity check any
update of Xen page tables" we are able to vmap/vunmap page aligned
addresses only.

So if we add a page address remainder to the mapped virtual address,
we have to mask it out before unmapping.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/cpuerrata.c

index 8904939acab1ebd3f7c4096d7db27ab450ca4b80..6f483b2d8d598c86b5d3ab1c6eab2abed06ed93b 100644 (file)
@@ -75,7 +75,7 @@ static bool copy_hyp_vect_bpi(unsigned int slot, const char *hyp_vec_start,
     clean_dcache_va_range(dst_remapped, VECTOR_TABLE_SIZE);
     invalidate_icache();
 
-    vunmap(dst_remapped);
+    vunmap((void *)((vaddr_t)dst_remapped & PAGE_MASK));
 
     return true;
 }