qemu/arm-virt-Correct-timing-of-pause-all-vcpus-for-hot-p.patch
chenhuiying cb59798846 QEMU update to viersion 6.2.0-67(master)
-bugfix: fix qmp command migrate-set-parameters
-some bugfixs about ARM hot-plugged CPUs
-hw/core/machine:Fix the missing consideration of cluster-id
-test/tcg:Fix target-specific Makefile variable path for user-mode
-tests:add (riscv virt) machine mapping to testenv
-Make a litte improvement in curl and hw/riscv
-qemu support for loongarch
-hw/pvrdma: Protect against buggy or malious guest driver
-hw/audio/intel-hda:fix stream reset
-dsoundaudio:fix crackling audio recordings
-add notify-vm-exit support for i386
-blok-backend: prevent dangling BDS pointers across aio_poll()
-net:Fix uninitialized data usage
-net/eth:Don't consider ESP to be an IPv6 option header
-hw/net/vmxnet3:Log guest-triggerable errors using LOG_GUEST_ERROR

Signed-off-by: FeiXu <xufei30@huawei.com>
2023-03-29 07:29:51 +08:00

59 lines
1.8 KiB
Diff

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