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

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



Hi,

On 7/18/19 2:43 PM, Andrew Cooper wrote:
On 18/07/2019 14:38, Andrew Cooper wrote:
On 18/07/2019 14:22, Andrii Anisov wrote:
From: Andrii Anisov <andrii_anisov@xxxxxxxx>

After changes introduced by 9cc0618 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@xxxxxxxx>
---
  xen/arch/arm/cpuerrata.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 8904939..6f483b2 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -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));
This really ought to be vunmap() performing the rounding, which makes it
consistent with how {,un}map_domain_page() currently works.

However (from inspection), there is a real bug in this code

Actually ignore me.  I'm wrong, and clearly can't read code.

My suggestion about vunmap() still stands though.

+1 for the vunmap solution.

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