[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/11] hw/mips/loongson3_virt: Propagate %processor_id to init_bo
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 10/11] hw/mips/loongson3_virt: Propagate %processor_id to init_boot_param() |
Date: |
Sun, 12 Jan 2025 22:58:34 +0100 |
Propagate %processor_id from mips_loongson3_virt_init() where
we have a reference to the first vCPU, so use it instead of
the &first_cpu global.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/loongson3_virt.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index 45cd348c14e..59b1619df0c 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -173,7 +173,7 @@ static uint64_t get_cpu_freq_hz(const MIPSCPU *cpu)
return DEF_LOONGSON3_FREQ;
}
-static void init_boot_param(unsigned cpu_count)
+static void init_boot_param(unsigned cpu_count, uint32_t processor_id)
{
static void *p;
struct boot_params *bp;
@@ -184,8 +184,7 @@ static void init_boot_param(unsigned cpu_count)
bp->efi.smbios.vers = cpu_to_le16(1);
init_reset_system(&(bp->reset_system));
p += ROUND_UP(sizeof(struct boot_params), 64);
- init_loongson_params(&(bp->efi.smbios.lp), p, cpu_count,
- MIPS_CPU(first_cpu)->env.CP0_PRid,
+ init_loongson_params(&(bp->efi.smbios.lp), p, cpu_count, processor_id,
loaderparams.cpu_freq, loaderparams.ram_size);
rom_add_blob_fixed("params_rom", bp,
@@ -645,7 +644,7 @@ static void mips_loongson3_virt_init(MachineState *machine)
loaderparams.kernel_entry = load_kernel(&cpus[0]->env);
init_boot_rom();
- init_boot_param(machine->smp.cpus);
+ init_boot_param(machine->smp.cpus, cpus[0]->env.CP0_PRid);
} else {
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
machine->firmware ?: LOONGSON3_BIOSNAME);
--
2.47.1
- [PATCH 05/11] hw/mips/loongson3_bootp: Include missing headers, (continued)
- [PATCH 05/11] hw/mips/loongson3_bootp: Include missing headers, Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 06/11] hw/mips/loongson3: Propagate cpu_count to init_loongson_params(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 07/11] hw/mips/loongson3_virt: Propagate cpu_count to init_boot_param(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 08/11] hw/mips/loongson3_bootp: Propagate processor_id to init_cpu_info(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 09/11] hw/mips/loongson3_virt: Propagate processor_id to init_loongson_params(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 10/11] hw/mips/loongson3_virt: Propagate %processor_id to init_boot_param(),
Philippe Mathieu-Daudé <=
- [PATCH 11/11] hw/mips/loongson3_bootp: Move to common_ss[], Philippe Mathieu-Daudé, 2025/01/12