]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/misc/mos6522: Fix bad class definition of the MOS6522 device
authorThomas Huth <thuth@redhat.com>
Thu, 14 Nov 2024 10:46:53 +0000 (11:46 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 18 Nov 2024 16:28:53 +0000 (19:28 +0300)
commit2f52258ed70c550f8a027f6411156ea583615814
tree050dcf63eb7ed466df5d7051362dbda4d81068ba
parent52558d49d6926a22fe2a0bf986a9c7cff6283ff2
hw/misc/mos6522: Fix bad class definition of the MOS6522 device

When compiling QEMU with --enable-cfi, the "q800" m68k machine
currently crashes very early, when the q800_machine_init() function
tries to wire the interrupts of the "via1" device.
This happens because TYPE_MOS6522_Q800_VIA1 is supposed to be a
proper SysBus device, but its parent (TYPE_MOS6522) has a mistake
in its class definition where it is only derived from DeviceClass,
and not from SysBusDeviceClass, so we end up in funny memory access
issues here. Using the right class hierarchy for the MOS6522 device
fixes the problem.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2675
Signed-off-by: Thomas Huth <thuth@redhat.com>
Fixes: 51f233ec92 ("misc: introduce new mos6522 VIA device")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-ID: <20241114104653.963812-1-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit c3d7c18b0d616cf7fb3c1f325503e1462307209d)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
include/hw/misc/mos6522.h