Commit f139ad829a for qemu.org
commit f139ad829a21407b46beed9d165e84a98b4fa972
Author: Bin Meng <bin.meng@processmission.com>
Date: Sun Aug 16 21:12:40 2026 +0800
hw/arm: kzm: Store boot info in the board state
arm_load_kernel() keeps a pointer to the boot info struct for the
lifetime of the VM, so the struct logically belongs to the machine
rather than to a file scoped static object.
The IMX31KZM struct is already allocated per machine instance, so
move the boot info there.
As in the xlnx-zcu102 and raspi machines, the boot info belongs to
the machine rather than to a static object:
4d1ac883a7 ("hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102")
0f15c6e338 ("hw/arm/raspi: Move arm_boot_info structure to RaspiMachineState")
Signed-off-by: Bin Meng <bin.meng@processmission.com>
Message-id: 20260816131300.51799-11-bin.meng@processmission.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 168ecf35d0..1aa5b49de9 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -54,17 +54,13 @@
typedef struct IMX31KZM {
FslIMX31State soc;
MemoryRegion ram_alias;
+ struct arm_boot_info bootinfo;
} IMX31KZM;
#define KZM_RAM_ADDR (FSL_IMX31_SDRAM0_ADDR)
#define KZM_FPGA_ADDR (FSL_IMX31_CS4_ADDR + 0x1040)
#define KZM_LAN9118_ADDR (FSL_IMX31_CS5_ADDR)
-static struct arm_boot_info kzm_binfo = {
- .loader_start = KZM_RAM_ADDR,
- .board_id = 1722,
-};
-
static void kzm_init(MachineState *machine)
{
IMX31KZM *s = g_new0(IMX31KZM, 1);
@@ -125,10 +121,12 @@ static void kzm_init(MachineState *machine)
14745600, serial_hd(2), DEVICE_NATIVE_ENDIAN);
}
- kzm_binfo.ram_size = machine->ram_size;
+ s->bootinfo.loader_start = KZM_RAM_ADDR;
+ s->bootinfo.board_id = 1722;
+ s->bootinfo.ram_size = machine->ram_size;
if (!qtest_enabled()) {
- arm_load_kernel(&s->soc.cpu, machine, &kzm_binfo);
+ arm_load_kernel(&s->soc.cpu, machine, &s->bootinfo);
}
}