[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/11] hw/mips/loongson3_virt: Invert vCPU creation order to r
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 02/11] hw/mips/loongson3_virt: Invert vCPU creation order to remove &first_cpu |
Date: |
Thu, 16 Jan 2025 00:29:42 +0100 |
Create vCPUs from the last one to the first one.
No need to use the &first_cpu global since we already
have it referenced.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/loongson3_virt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index 47d112981a2..488eba495cd 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -494,7 +494,6 @@ static void mips_loongson3_virt_init(MachineState *machine)
long bios_size;
MIPSCPU *cpu;
Clock *cpuclk;
- CPUMIPSState *env;
DeviceState *liointc;
DeviceState *ipi = NULL;
char *filename;
@@ -569,7 +568,7 @@ static void mips_loongson3_virt_init(MachineState *machine)
cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
clock_set_hz(cpuclk, DEF_LOONGSON3_FREQ);
- for (i = 0; i < machine->smp.cpus; i++) {
+ for (i = machine->smp.cpus - 1; i >= 0; --i) {
int node = i / LOONGSON3_CORE_PER_NODE;
int core = i % LOONGSON3_CORE_PER_NODE;
int ip;
@@ -609,7 +608,6 @@ static void mips_loongson3_virt_init(MachineState *machine)
pin, cpu->env.irq[ip + 2]);
}
}
- env = &MIPS_CPU(first_cpu)->env;
/* Allocate RAM/BIOS, 0x00000000~0x10000000 is alias of
0x80000000~0x90000000 */
memory_region_init_rom(bios, NULL, "loongson3.bios",
@@ -640,7 +638,7 @@ static void mips_loongson3_virt_init(MachineState *machine)
loaderparams.kernel_filename = kernel_filename;
loaderparams.kernel_cmdline = kernel_cmdline;
loaderparams.initrd_filename = initrd_filename;
- loaderparams.kernel_entry = load_kernel(env);
+ loaderparams.kernel_entry = load_kernel(&cpu->env);
init_boot_rom();
init_boot_param();
--
2.47.1
- [PATCH v2 00/11] hw/mips/loongson3: Remove uses of &first_cpu global, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 02/11] hw/mips/loongson3_virt: Invert vCPU creation order to remove &first_cpu,
Philippe Mathieu-Daudé <=
- [PATCH v2 01/11] hw/mips/loongson3_virt: Factor generic_cpu_reset() out, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 03/11] hw/mips/loongson3_virt: Have fw_conf_init() access local loaderparams, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 04/11] hw/mips/loongson3_virt: Pass CPU argument to get_cpu_freq_hz(), Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 05/11] hw/mips/loongson3_bootp: Include missing headers, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 08/11] hw/mips/loongson3_bootp: Propagate processor_id to init_cpu_info(), Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 07/11] hw/mips/loongson3_virt: Propagate cpu_count to init_boot_param(), Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 06/11] hw/mips/loongson3: Propagate cpu_count to init_loongson_params(), Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 11/11] hw/mips/loongson3_bootp: Move to common_ss[], Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 10/11] hw/mips/loongson3_virt: Propagate %processor_id to init_boot_param(), Philippe Mathieu-Daudé, 2025/01/15
- [PATCH v2 09/11] hw/mips/loongson3_virt: Propagate processor_id to init_loongson_params(), Philippe Mathieu-Daudé, 2025/01/15