* [PATCH] hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable
@ 2023-10-25 6:59 Philippe Mathieu-Daudé
2023-10-25 20:20 ` Richard Henderson
2023-10-27 11:50 ` Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-25 6:59 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, Alistair Francis, qemu-arm, Niek Linnenbank,
Igor Mitsyanko, Peter Maydell, Edgar E. Iglesias,
Philippe Mathieu-Daudé
Prefer using a well known local first CPU rather than a global one.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/bananapi_m2u.c | 2 +-
hw/arm/exynos4_boards.c | 7 ++++---
hw/arm/orangepi.c | 2 +-
hw/arm/realview.c | 2 +-
hw/arm/xilinx_zynq.c | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/arm/bananapi_m2u.c b/hw/arm/bananapi_m2u.c
index a7c7a9f96d..8f24b18d8c 100644
--- a/hw/arm/bananapi_m2u.c
+++ b/hw/arm/bananapi_m2u.c
@@ -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)
diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
index ef5bcbc212..b0e13eb4f0 100644
--- a/hw/arm/exynos4_boards.c
+++ b/hw/arm/exynos4_boards.c
@@ -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)
@@ -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)
diff --git a/hw/arm/orangepi.c b/hw/arm/orangepi.c
index d0eca54cd9..f3784d45ca 100644
--- a/hw/arm/orangepi.c
+++ b/hw/arm/orangepi.c
@@ -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)
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 8f89526596..132217b2ed 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -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)
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 8dc2ea83a9..dbb9793aa1 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -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)
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable
2023-10-25 6:59 [PATCH] hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable Philippe Mathieu-Daudé
@ 2023-10-25 20:20 ` Richard Henderson
2023-10-27 11:50 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2023-10-25 20:20 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Bennée, Alistair Francis, qemu-arm, Niek Linnenbank,
Igor Mitsyanko, Peter Maydell, Edgar E. Iglesias
On 10/24/23 23:59, Philippe Mathieu-Daudé wrote:
> Prefer using a well known local first CPU rather than a global one.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/arm/bananapi_m2u.c | 2 +-
> hw/arm/exynos4_boards.c | 7 ++++---
> hw/arm/orangepi.c | 2 +-
> hw/arm/realview.c | 2 +-
> hw/arm/xilinx_zynq.c | 2 +-
> 5 files changed, 8 insertions(+), 7 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable
2023-10-25 6:59 [PATCH] hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable Philippe Mathieu-Daudé
2023-10-25 20:20 ` Richard Henderson
@ 2023-10-27 11:50 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2023-10-27 11:50 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Bennée, Alistair Francis, qemu-arm,
Niek Linnenbank, Igor Mitsyanko, Edgar E. Iglesias
On Wed, 25 Oct 2023 at 07:59, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Prefer using a well known local first CPU rather than a global one.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
Applied to target-arm.next, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-27 11:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 6:59 [PATCH] hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable Philippe Mathieu-Daudé
2023-10-25 20:20 ` Richard Henderson
2023-10-27 11:50 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.