Projects
Eulaceura:Mainline:GA
qemu
_service:obs_scm:kvm-arm-Fix-compatibility-of-c...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:kvm-arm-Fix-compatibility-of-cold-plug-CPU-with-SVE.patch of Package qemu
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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2