1 Star 0 Fork 131

clockguo/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
arm-virt-Correct-timing-of-pause-all-vcpus-for-hot-p.patch 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
huiyingC 提交于 2023-03-28 20:53 +08:00 . QEMU update to viersion 6.2.0-67(master)
From 41f30679648676d4d62b1ae9026dde77fa9895d5 Mon Sep 17 00:00:00 2001
From: Kunkun Jiang <jiangkunkun@huawei.com>
Date: Tue, 14 Feb 2023 20:39:07 +0800
Subject: [PATCH] arm/virt: Correct timing of pause all vcpus for hot-plugged
CPUs
When dealing with hot-plugging cpus, it may fail when realize cpu.
Such a failure would make paused vcpus unrecoverable. So we only
pause all vcpus when needed. Add removed some unnecessary checks.
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
---
hw/arm/virt.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 7d5b332594..4c876fcf16 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2747,13 +2747,6 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev,
&error_abort);
}
}
-
- /* If we use KVM accel, we should pause all vcpus to
- * allow hot access of vcpu registers.
- */
- if (dev->hotplugged && kvm_enabled()) {
- pause_all_vcpus();
- }
}
static void virt_cpu_plug(HotplugHandler *hotplug_dev,
@@ -2773,6 +2766,10 @@ static void virt_cpu_plug(HotplugHandler *hotplug_dev,
/* For CPU that is cold/hot plugged */
if (ncpu >= ms->smp.cpus) {
+ if (dev->hotplugged) {
+ pause_all_vcpus();
+ }
+
/* Realize GIC related parts of CPU */
assert(vms->gic_version == 3);
gicv3 = ARM_GICV3_COMMON(vms->gic);
@@ -2803,6 +2800,10 @@ static void virt_cpu_plug(HotplugHandler *hotplug_dev,
cpu_hotplug_register_reset(ncpu);
cpu_hotplug_reset_manually(ncpu);
cpu_synchronize_post_reset(cs);
+
+ if (dev->hotplugged) {
+ resume_all_vcpus();
+ }
}
if (dev->hotplugged && kvm_enabled()) {
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/JianguoZhang/qemu.git
git@gitee.com:JianguoZhang/qemu.git
JianguoZhang
qemu
qemu
master

搜索帮助