代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 343b61303152b06f9e1ba6d09a405faeaa3fcc98 Mon Sep 17 00:00:00 2001
From: Keqian Zhu <zhukeqian1@huawei.com>
Date: Tue, 26 Mar 2024 22:12:58 +0800
Subject: [PATCH] intc/gicv3: Fixes for vcpu hotplug
1. Some types of machine don't support possible_cpus
callback.
2. The cpu_update_notifier is register only when machine
support vcpu hotplug, so do notifier_remove() unconditi-
onally is wrong.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
cpu-common.c | 4 ++++
hw/intc/arm_gicv3_common.c | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/cpu-common.c b/cpu-common.c
index da52e45760..54e63b3f77 100644
--- a/cpu-common.c
+++ b/cpu-common.c
@@ -113,6 +113,10 @@ CPUState *qemu_get_possible_cpu(int index)
MachineState *ms = MACHINE(qdev_get_machine());
const CPUArchIdList *possible_cpus = ms->possible_cpus;
+ if (possible_cpus == NULL) {
+ return qemu_get_cpu(index);
+ }
+
assert((index >= 0) && (index < possible_cpus->len));
return CPU(possible_cpus->cpus[index].cpu);
diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
index d051024a30..5667d9f40b 100644
--- a/hw/intc/arm_gicv3_common.c
+++ b/hw/intc/arm_gicv3_common.c
@@ -25,6 +25,7 @@
#include "qapi/error.h"
#include "qemu/module.h"
#include "qemu/error-report.h"
+#include "hw/boards.h"
#include "hw/core/cpu.h"
#include "hw/intc/arm_gicv3_common.h"
#include "hw/qdev-properties.h"
@@ -446,7 +447,7 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
s->cpu = g_new0(GICv3CPUState, s->num_cpu);
for (i = 0; i < s->num_cpu; i++) {
- CPUState *cpu = qemu_get_possible_cpu(i);
+ CPUState *cpu = qemu_get_possible_cpu(i) ? : qemu_get_cpu(i);
uint64_t cpu_affid;
if (qemu_enabled_cpu(cpu)) {
@@ -506,8 +507,12 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
static void arm_gicv3_finalize(Object *obj)
{
GICv3State *s = ARM_GICV3_COMMON(obj);
+ Object *ms = qdev_get_machine();
+ MachineClass *mc = MACHINE_GET_CLASS(ms);
- notifier_remove(&s->cpu_update_notifier);
+ if (mc->has_hotpluggable_cpus) {
+ notifier_remove(&s->cpu_update_notifier);
+ }
g_free(s->redist_region_count);
}
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。