1 Star 0 Fork 120

卫少坤/qemu_src

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
system-cpus-Fix-resume_all_vcpus-under-vCPU-hotplug-.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-04-10 20:59 . QEMU update to version 8.2.0-6:
From a29922f76c9b5064ddd2e686fa725b96c435e889 Mon Sep 17 00:00:00 2001
From: Keqian Zhu <zhukeqian1@huawei.com>
Date: Sun, 17 Mar 2024 16:37:04 +0800
Subject: [PATCH] system/cpus: Fix resume_all_vcpus() under vCPU hotplug
condition
For vCPU being hotplugged, qemu_init_vcpu() is called. In this
function, we set vcpu state as stopped, and then wait vcpu thread
to be created.
As the vcpu state is stopped, it will inform us it has been created
and then wait on halt_cond. After we has realized vcpu object, we
will resume the vcpu thread.
However, during we wait vcpu thread to be created, the bql is
unlocked, and other thread is allowed to call resume_all_vcpus(),
which will resume the un-realized vcpu.
This fixes the issue by filter out un-realized vcpu during
resume_all_vcpus().
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
system/cpus.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/system/cpus.c b/system/cpus.c
index 7c5369fa9c..f2289e9545 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -618,6 +618,9 @@ void resume_all_vcpus(void)
qemu_clock_enable(QEMU_CLOCK_VIRTUAL, true);
CPU_FOREACH(cpu) {
+ if (!object_property_get_bool(OBJECT(cpu), "realized", &error_abort)) {
+ continue;
+ }
cpu_resume(cpu);
}
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/weishaokun/qemu_src.git
git@gitee.com:weishaokun/qemu_src.git
weishaokun
qemu_src
qemu_src
master

搜索帮助