From 0a629c827300d514cc1f61806414d214fcf75051 Mon Sep 17 00:00:00 2001 From: Xianglai Li Date: Mon, 3 Mar 2025 14:31:33 +0800 Subject: [PATCH] target/loongarch: Adjust the cpu reset action to a proper position The commit 5a99a10da6cf ("target/loongarch: fix vcpu reset command word issue") fixes the error in the cpu reset ioctl command word delivery process, so that the command word can be delivered correctly, and adds the judgment and processing of the error return value, which exposes another problem that under loongarch, the cpu reset action is earlier than the creation of vcpu. An error occurs when the cpu reset command is sent. Now adjust the order of cpu reset and vcpu create actions to fix this problem Signed-off-by: Xianglai Li Acked-by: Igor Mammedov Signed-off-by: Bibo Mao --- target/loongarch/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index b2961d8605..ac514a15fb 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -641,8 +641,8 @@ static void loongarch_cpu_realizefn(DeviceState *dev, Error **errp) loongarch_cpu_register_gdb_regs_for_features(cs); - cpu_reset(cs); qemu_init_vcpu(cs); + cpu_reset(cs); lacc->parent_realize(dev, errp); } -- 2.30.2