@samitouri / QOSamiQemu / commits / c0306d2b8f

hw/misc: Fix the valid access size to the avr-power device

Accessing the device with in non-single byte mode currently causes QEMU to abort: $ echo "writew 0x800064 0x4142" | \ ./qemu-system-avr -M mega2560 -display none -qtest stdio -accel qtest [I 0.000000] OPENED [R +0.001784] writew 0x800064 0x4142 qemu-system-avr: ../../devel/qemu/hw/misc/avr_power.c:58: avr_mask_write: Assertion `offset == 0' failed. Aborted (core dumped) Set the valid max access size to 1 to fix the problem. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3393 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260421082935.85995-1-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Thomas Huth committed Apr 21, 2026 at 10:29 UTC c0306d2b8f45a708f7ab45c846bb24851d6e17f2
1 file changed +3
hw/misc/avr_power.c
+3
@@ -73,6 +73,9 @@ static const MemoryRegionOps avr_mask_ops = {
73 .impl = {
74 .max_access_size = 1,
75 },
76 + .valid = {
77 + .max_access_size = 1,
78 + },
79 };
80
81 static void avr_mask_init(Object *dev)