aboutsummaryrefslogtreecommitdiff
path: root/hw/loongarch/virt.c
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2023-08-24 08:50:07 +0800
committerSong Gao <gaosong@loongson.cn>2023-08-24 11:17:59 +0800
commit14f21f673a01cf3efa22a70256947fb9b6bbfdfa (patch)
tree33c5fffff727cbfb8f1cecfabcc4edf9190efda0 /hw/loongarch/virt.c
parenta380c6f11fd9f1ca96f204c4ae26c79e483ede8a (diff)
target/loongarch: cpu: Implement get_arch_id callback
Implement the callback for getting the architecture-dependent CPU ID, the cpu ID is physical id described in ACPI MADT table, this will be used for cpu hotplug. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Song Gao <gaosong@loongson.cn> Message-Id: <20230824005007.2000525-1-maobibo@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
Diffstat (limited to 'hw/loongarch/virt.c')
-rw-r--r--hw/loongarch/virt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index af15bf5aaa..2629128aed 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -810,6 +810,8 @@ static void loongarch_init(MachineState *machine)
cpu = cpu_create(machine->cpu_type);
cpu->cpu_index = i;
machine->possible_cpus->cpus[i].cpu = OBJECT(cpu);
+ lacpu = LOONGARCH_CPU(cpu);
+ lacpu->phy_id = machine->possible_cpus->cpus[i].arch_id;
}
fdt_add_cpu_nodes(lams);