Skip to content

Commit

Permalink
hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable
Browse files Browse the repository at this point in the history
Prefer using a well known local first CPU rather than a global one.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20231025065909.57344-1-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
philmd authored and pm215 committed Oct 27, 2023
1 parent bf348bf commit f0109f7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hw/arm/bananapi_m2u.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void bpim2u_init(MachineState *machine)
bpim2u_binfo.loader_start = r40->memmap[AW_R40_DEV_SDRAM];
bpim2u_binfo.ram_size = machine->ram_size;
bpim2u_binfo.psci_conduit = QEMU_PSCI_CONDUIT_SMC;
arm_load_kernel(ARM_CPU(first_cpu), machine, &bpim2u_binfo);
arm_load_kernel(&r40->cpus[0], machine, &bpim2u_binfo);
}

static void bpim2u_machine_init(MachineClass *mc)
Expand Down
7 changes: 4 additions & 3 deletions hw/arm/exynos4_boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ exynos4_boards_init_common(MachineState *machine,

static void nuri_init(MachineState *machine)
{
exynos4_boards_init_common(machine, EXYNOS4_BOARD_NURI);
Exynos4BoardState *s = exynos4_boards_init_common(machine,
EXYNOS4_BOARD_NURI);

arm_load_kernel(ARM_CPU(first_cpu), machine, &exynos4_board_binfo);
arm_load_kernel(s->soc.cpu[0], machine, &exynos4_board_binfo);
}

static void smdkc210_init(MachineState *machine)
Expand All @@ -146,7 +147,7 @@ static void smdkc210_init(MachineState *machine)

lan9215_init(SMDK_LAN9118_BASE_ADDR,
qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)]));
arm_load_kernel(ARM_CPU(first_cpu), machine, &exynos4_board_binfo);
arm_load_kernel(s->soc.cpu[0], machine, &exynos4_board_binfo);
}

static void nuri_class_init(ObjectClass *oc, void *data)
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/orangepi.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static void orangepi_init(MachineState *machine)
orangepi_binfo.loader_start = h3->memmap[AW_H3_DEV_SDRAM];
orangepi_binfo.ram_size = machine->ram_size;
orangepi_binfo.psci_conduit = QEMU_PSCI_CONDUIT_SMC;
arm_load_kernel(ARM_CPU(first_cpu), machine, &orangepi_binfo);
arm_load_kernel(&h3->cpus[0], machine, &orangepi_binfo);
}

static void orangepi_machine_init(MachineClass *mc)
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/realview.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static void realview_init(MachineState *machine,
realview_binfo.ram_size = ram_size;
realview_binfo.board_id = realview_board_id[board_type];
realview_binfo.loader_start = (board_type == BOARD_PB_A8 ? 0x70000000 : 0);
arm_load_kernel(ARM_CPU(first_cpu), machine, &realview_binfo);
arm_load_kernel(cpu, machine, &realview_binfo);
}

static void realview_eb_init(MachineState *machine)
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/xilinx_zynq.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static void zynq_init(MachineState *machine)
zynq_binfo.board_setup_addr = BOARD_SETUP_ADDR;
zynq_binfo.write_board_setup = zynq_write_board_setup;

arm_load_kernel(ARM_CPU(first_cpu), machine, &zynq_binfo);
arm_load_kernel(cpu, machine, &zynq_binfo);
}

static void zynq_machine_class_init(ObjectClass *oc, void *data)
Expand Down

0 comments on commit f0109f7

Please sign in to comment.