qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/loongarch: Adjust the cpu reset action to a proper position
@ 2025-03-03  6:30 Xianglai Li
  2025-03-03  9:15 ` bibo mao
  0 siblings, 1 reply; 5+ messages in thread
From: Xianglai Li @ 2025-03-03  6:30 UTC (permalink / raw)
  To: qemu-devel

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 <lixianglai@loongson.cn>
---
Bibo Mao <maobibo@loongson.cn>
Huacai Chen <chenhuacai@loongson.cn>
Song Gao <gaosong@loongson.cn>
Xianglai Li <lixianglai@loongson.cn>

 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 3788f895c1..67aa7875b6 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -640,8 +640,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.39.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] target/loongarch: Adjust the cpu reset action to a proper position
@ 2025-03-03  6:31 Xianglai Li
  0 siblings, 0 replies; 5+ messages in thread
From: Xianglai Li @ 2025-03-03  6:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Bibo Mao, Huacai Chen, Song Gao

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 <lixianglai@loongson.cn>
---
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Huacai Chen <chenhuacai@loongson.cn>
Cc: Song Gao <gaosong@loongson.cn>
Cc: Xianglai Li <lixianglai@loongson.cn>

 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 3788f895c1..67aa7875b6 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -640,8 +640,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.39.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-05  1:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03  6:30 [PATCH] target/loongarch: Adjust the cpu reset action to a proper position Xianglai Li
2025-03-03  9:15 ` bibo mao
2025-03-03 13:21   ` Igor Mammedov
2025-03-05  1:48     ` bibo mao
  -- strict thread matches above, loose matches on Subject: below --
2025-03-03  6:31 Xianglai Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).