代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 85e8e1ee8560e587845142342f81b218e44cba6a Mon Sep 17 00:00:00 2001
From: Keqian Zhu <zhukeqian1@huawei.com>
Date: Tue, 26 Mar 2024 22:07:33 +0800
Subject: [PATCH] arm/kvm: Set psci smccc filter only with vcpu hotplug
The smccc filter mechanism is supported by newer Linux kernel,
don't try to do it unconditionaly.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
hw/arm/virt.c | 4 +++-
target/arm/kvm.c | 21 ++++++++++++---------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index e60f3431f9..38b5d214a1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2366,8 +2366,10 @@ static void machvirt_init(MachineState *machine)
finalize_gic_version(vms);
if (tcg_enabled() || hvf_enabled() || qtest_enabled() ||
(vms->gic_version < VIRT_GIC_VERSION_3)) {
- machine->smp.max_cpus = smp_cpus;
mc->has_hotpluggable_cpus = false;
+ }
+ if (!mc->has_hotpluggable_cpus) {
+ machine->smp.max_cpus = smp_cpus;
warn_report("cpu hotplug feature has been disabled");
}
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 66caf9e5e7..19783d567f 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -259,6 +259,7 @@ int kvm_arch_get_default_type(MachineState *ms)
int kvm_arch_init(MachineState *ms, KVMState *s)
{
+ MachineClass *mc = MACHINE_GET_CLASS(ms);
int ret = 0;
/* For ARM interrupt delivery is always asynchronous,
@@ -316,15 +317,17 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
* filter in the Host KVM. This is required to support features like
* virtual CPU Hotplug on ARM platforms.
*/
- if (kvm_arm_set_smccc_filter(PSCI_0_2_FN64_CPU_ON,
- KVM_SMCCC_FILTER_FWD_TO_USER)) {
- error_report("CPU On PSCI-to-user-space fwd filter install failed");
- abort();
- }
- if (kvm_arm_set_smccc_filter(PSCI_0_2_FN_CPU_OFF,
- KVM_SMCCC_FILTER_FWD_TO_USER)) {
- error_report("CPU Off PSCI-to-user-space fwd filter install failed");
- abort();
+ if (mc->has_hotpluggable_cpus && ms->smp.max_cpus > ms->smp.cpus) {
+ if (kvm_arm_set_smccc_filter(PSCI_0_2_FN64_CPU_ON,
+ KVM_SMCCC_FILTER_FWD_TO_USER)) {
+ error_report("CPU On PSCI-to-user-space fwd filter install failed");
+ mc->has_hotpluggable_cpus = false;
+ }
+ if (kvm_arm_set_smccc_filter(PSCI_0_2_FN_CPU_OFF,
+ KVM_SMCCC_FILTER_FWD_TO_USER)) {
+ error_report("CPU Off PSCI-to-user-space fwd filter install failed");
+ mc->has_hotpluggable_cpus = false;
+ }
}
kvm_arm_init_debug(s);
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。