1 Star 0 Fork 123

roy/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
arm-virt-Fix-adjudgement-of-core_id-for-vcpu-hotplug.patch 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-04-10 20:59 . QEMU update to version 8.2.0-6:
From 00a78edf572783c18a1d4945758371c0f175e321 Mon Sep 17 00:00:00 2001
From: Keqian Zhu <zhukeqian1@huawei.com>
Date: Tue, 26 Mar 2024 15:41:14 +0800
Subject: [PATCH] arm/virt: Fix adjudgement of core_id for vcpu hotplugged
The core_id should between 0 and ms->smp.cores - 1.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
hw/arm/virt.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 934b0412ef..e60f3431f9 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3170,8 +3170,6 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
ARMCPU *cpu = ARM_CPU(dev);
CPUState *cs = CPU(dev);
CPUArchId *cpu_slot;
- int32_t min_cpuid = 0;
- int32_t max_cpuid;
if (dev->hotplugged && !vms->acpi_dev) {
error_setg(errp, "GED acpi device does not exists");
@@ -3196,15 +3194,9 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
return;
}
- max_cpuid = ms->possible_cpus->len - 1;
- if (!dev->hotplugged) {
- min_cpuid = vms->acpi_dev ? ms->smp.cpus : 0;
- max_cpuid = vms->acpi_dev ? max_cpuid : ms->smp.cpus - 1;
- }
-
- if ((cpu->core_id < min_cpuid) || (cpu->core_id > max_cpuid)) {
- error_setg(errp, "Invalid core-id %d specified, correct range %d:%d",
- cpu->core_id, min_cpuid, max_cpuid);
+ if ((cpu->core_id < 0) || (cpu->core_id >= ms->smp.cores)) {
+ error_setg(errp, "Invalid core-id %d specified, correct range 0:%u",
+ cpu->core_id, ms->smp.cores - 1);
return;
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/roygiteee/qemu.git
git@gitee.com:roygiteee/qemu.git
roygiteee
qemu
qemu
master

搜索帮助