]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/misc: Fix the valid access size to the avr-power device
authorThomas Huth <thuth@redhat.com>
Tue, 21 Apr 2026 08:29:35 +0000 (10:29 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 24 Apr 2026 19:27:22 +0000 (21:27 +0200)
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>
hw/misc/avr_power.c

index f42cf4fd9060277c5a46a88102a68d56b05bef19..42be265691108cd46b3dc2d884708503921d813f 100644 (file)
@@ -73,6 +73,9 @@ static const MemoryRegionOps avr_mask_ops = {
     .impl = {
         .max_access_size = 1,
     },
+    .valid = {
+        .max_access_size = 1,
+    },
 };
 
 static void avr_mask_init(Object *dev)