hw/misc: Fix the valid access size to the avr-power device
PATCH 1/1 hw/misc: Fix the valid access size to the avr-power device
From: Thomas Huth <[email protected]>
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
--- hw/misc/avr_power.c | 3 +++ 1 file changed, 3 insertions(+)
hw/misc/avr_power.c +3 -0
@@ -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)
Signature · 1 line
2.53.0
Quoted 27 lines · Thomas Huth
From: Thomas Huth <[email protected]>
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 <[email protected]>--- hw/misc/avr_power.c | 3 +++ 1 file changed, 3 insertions(+)hw/misc/avr_power.c +0
-0
hw/misc/avr_power.c static const MemoryRegionOps avr_mask_ops = { · line 79
Quoted 7 lines
hw/misc/avr_power.c +3
-0@@ -73,6 +73,9 @@ static const MemoryRegionOps avr_mask_ops = { .impl = { .max_access_size = 1, }, + .valid = { + .max_access_size = 1, + }, };
thanks
-- PMM
Quoted 13 lines · Thomas Huth
From: Thomas Huth <[email protected]>
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)
Quoted 7 lines
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 <[email protected]>--- hw/misc/avr_power.c | 3 +++ 1 file changed, 3 insertions(+)
and queued, thanks!
Quoted 13 lines · Thomas Huth
From: Thomas Huth <[email protected]>
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)
Quoted 4 lines
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 <[email protected]>
This looks like a minor issue, yet it feels like this change is a good candidate for the current stable releases. Please let me know if it isn't.
Thanks,
/mjt
Quoted 15 lines · Michael Tokarev
Quoted 13 lines · Thomas Huth
From: Thomas Huth <[email protected]>
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)
Quoted 7 lines
Quoted 4 lines
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 <[email protected]>This looks like a minor issue, yet it feels like this change is a good candidate for the current stable releases. Please let me know if it isn't.
Yes, this is fine for stable.
-- PMM