代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From baacc5ed528a5259286622482a01e3e848aed57e Mon Sep 17 00:00:00 2001
From: Keqian Zhu <zhukeqian1@huawei.com>
Date: Mon, 29 Apr 2024 17:14:47 +0800
Subject: [PATCH] kvm/arm: Fix compatibility of cold-plug CPU with SVE
For arm virt machine, besides hotplugged vcpu, the kvm state of
coldplugged CPU is also pre-inited and thus SVE is finalized.
And a flag in ARMCPU state and skip finalize SVE again.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
hw/arm/virt.c | 5 +++++
target/arm/cpu.h | 3 +++
target/arm/kvm64.c | 2 +-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 507b09d96c..dfe4d9e129 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3282,6 +3282,11 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
if (!dev->hotplugged) {
cs->cold_booted = true;
}
+#ifdef CONFIG_KVM
+ if (cs->cpu_index >= ms->smp.cpus) {
+ cpu->kvm_sve_finalized = true;
+ }
+#endif
}
static void virt_cpu_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index c51a0e3467..a5ba7f2a26 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -971,6 +971,9 @@ struct ArchCPU {
/* KVM steal time */
OnOffAuto kvm_steal_time;
+
+ /* KVM SVE has been finalized for this CPU */
+ bool kvm_sve_finalized;
#endif /* CONFIG_KVM */
/* Uniprocessor system with MP extensions */
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index 615e8bbbdf..8f01d485b0 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -647,7 +647,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
return ret;
}
- if (cpu_isar_feature(aa64_sve, cpu) && !DEVICE(cpu)->hotplugged) {
+ if (cpu_isar_feature(aa64_sve, cpu) && !cpu->kvm_sve_finalized) {
ret = kvm_arm_sve_set_vls(cs);
if (ret) {
return ret;
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。