qemu/hw-misc-mos6522-Fix-bad-class-definition-of-the-MOS6.patch
Jiabo Feng 05fcc90d20 QEMU update to version 8.2.0-28:
- hw/misc/mos6522: Fix bad class definition of the MOS6522 device
- target/i386: Fix minor typo in NO_NESTED_DATA_BP feature bit
- cpu: ensure we don't call start_exclusive from cpu_exec
- Avoid unaligned fetch in ladr_match()
- audio/audio.c: remove trailing newline in error_setg
- acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM
- linux-user: Tolerate CONFIG_LSM_MMAP_MIN_ADDR
- accel/tcg: Fix user-only probe_access_internal plugin
- linux-user: Honor elf alignment when placing images
- Reserve address for MSI mapping in the CVM scenario.

Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
(cherry picked from commit 3ab56c27fe6b593be9a24f27b52b2730efa05304)
2025-02-21 17:42:47 +08:00

50 lines
1.9 KiB
Diff

From f0be5a2c99d2f893a27839cd5eb5fa74f3ff5564 Mon Sep 17 00:00:00 2001
From: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
Date: Mon, 18 Nov 2024 21:03:55 -0500
Subject: [PATCH] hw/misc/mos6522: Fix bad class definition of the MOS6522
device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
cheery-pick from c3d7c18b0d616cf7fb3c1f325503e1462307209d
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>
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
---
include/hw/misc/mos6522.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h
index fba45668ab..920871a598 100644
--- a/include/hw/misc/mos6522.h
+++ b/include/hw/misc/mos6522.h
@@ -154,7 +154,7 @@ struct MOS6522State {
OBJECT_DECLARE_TYPE(MOS6522State, MOS6522DeviceClass, MOS6522)
struct MOS6522DeviceClass {
- DeviceClass parent_class;
+ SysBusDeviceClass parent_class;
ResettablePhases parent_phases;
void (*portB_write)(MOS6522State *dev);
--
2.41.0.windows.1