memory: Correct access mask generation in access_with_adjusted_size
PATCH 1/1 memory: Correct access mask generation in access_with_adjusted_size
Also consider the requested transaction size when generating the access mask (so that only the requested bytes are returned when those are less than the memory region's minimum access size).
Signed-off-by Francisco Iglesias <[email protected]>
--- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
memory.c +1 -1
@@ -563,7 +563,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr,/* FIXME: support unaligned access? */ access_size =MAX (MIN (size, access_size_max), access_size_min); - access_mask =MAKE_64BIT_MASK (0 , access_size *8 ); + access_mask =MAKE_64BIT_MASK (0 ,MIN (size, access_size) *8 );if (memory_region_big_endian (mr)) {for (i =0 ; i < size; i += access_size) { r |= access_fn(mr, addr + i, value, access_size,
Signature · 1 line
2.11.0