[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/19] hw/mips/malta: Check CPU index instead of using &first_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 02/19] hw/mips/malta: Check CPU index instead of using &first_cpu |
Date: |
Mon, 13 Jan 2025 20:55:08 +0100 |
Since create_cpu_without_cps() creates the vCPUs iterating
up to the machine SMP count, it knows the first CPU is
created upon the first iteration, at index #0 :)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/malta.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 4e9cccaa347..37be2330eda 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1042,12 +1042,13 @@ static void create_cpu_without_cps(MachineState *ms,
MaltaState *s,
cpu_mips_irq_init_cpu(cpu);
cpu_mips_clock_init(cpu);
qemu_register_reset(main_cpu_reset, cpu);
- }
- cpu = MIPS_CPU(first_cpu);
- env = &cpu->env;
- *i8259_irq = env->irq[2];
- *cbus_irq = env->irq[4];
+ if (i == 0) {
+ env = &cpu->env;
+ *i8259_irq = env->irq[2];
+ *cbus_irq = env->irq[4];
+ }
+ }
}
static void create_cps(MachineState *ms, MaltaState *s,
--
2.47.1
- [PATCH v2 00/19] hw/mips: Remove all uses of &first_cpu, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 01/19] hw/mips/cps: Keep reference of vCPUs in MIPSCPSState, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 02/19] hw/mips/malta: Check CPU index instead of using &first_cpu,
Philippe Mathieu-Daudé <=
- [PATCH v2 03/19] hw/mips/malta: Keep reference of vCPUs in MaltaState, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 04/19] hw/mips/malta: Propagate MaltaState to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 05/19] hw/mips/malta: Propagate MaltaState to bl_setup_gt64120_jump_kernel(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 06/19] hw/mips/boston: Replace bl_gen_write_ulong() -> bl_gen_write_u64(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 07/19] hw/mips/boston: Propagate CPU to gen_firmware(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 08/19] hw/mips/fuloong: Propagate CPU to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 09/19] hw/mips/bootloader: Document public API, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 11/19] hw/mips/bootloader: Propagate CPU to bl_gen_jump_[to, kernel](), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 12/19] hw/mips/bootloader: Propagate CPU env to bl_gen_load_ulong(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 13/19] hw/mips/bootloader: Propagate CPU env to bl_gen_[d]li(), Philippe Mathieu-Daudé, 2025/01/13