- target/i386: Export RFDS bit to guests - target/i386: Add new CPU model SierraForest - target/i386: Introduce Icelake-Server-v7 to enable TSX - hw/isa/vt82c686: Keep track of PIRQ/PINT pins separately - kvm/arm: Fix compatibility of cold-plug CPU with SVE - arm/virt/acpi: Extend cpufreq to support max_cpus - kvm/arm: Fix SVE related logic for vcpu hotplug feature - arm/virt: Don't modify smp.max_cpus when vcpu hotplug disabled - acpi/cpu: Fix detection of present cpu Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
64 lines
1.9 KiB
Diff
64 lines
1.9 KiB
Diff
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
|
|
|