Set .impl min/max_access_size to 4 bytes so the memory subsystem
synthesizes sub-word guest accesses into 32-bit handler calls. The
read/write handlers ignore the size parameter and always operate on full
32-bit register values, so without this QEMU would not extract the
correct byte or halfword from the result.

Reported-by: Pavee Hui <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
 hw/char/exynos4210_uart.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 7240ff7b5c24..8774d4bb43d7 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -506,6 +506,10 @@ static const MemoryRegionOps exynos4210_uart_ops = {
         .max_access_size = 4,
         .unaligned = false
     },
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
 };
 
 static int exynos4210_uart_can_receive(void *opaque)

-- 
2.56.0.rc0.29.g47ce80527c56


Reply via email to