qemu/acpi-cpu-Fix-detection-of-present-cpu.patch
Jiabo Feng 7e5f6fca0d QEMU update to version 8.2.0-12:
- 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>
2024-05-10 16:44:24 +08:00

35 lines
1.0 KiB
Diff

From c2eb1176fe06f359a8102bbacb54760c9c1d5aae Mon Sep 17 00:00:00 2001
From: Keqian Zhu <zhukeqian1@huawei.com>
Date: Sun, 28 Apr 2024 12:50:09 +0800
Subject: [PATCH] acpi/cpu: Fix detection of present cpu
When qemu_present_cpu is false. it means cpu object is
null and then calling of qemu_persistent_cpu() will
cause null pointer access.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
hw/acpi/cpu.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index b258396e01..292e1daca2 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -231,11 +231,7 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,
if (qemu_present_cpu(cpu)) {
state->devs[i].is_present = true;
} else {
- if (qemu_persistent_cpu(cpu)) {
- state->devs[i].is_present = true;
- } else {
- state->devs[i].is_present = false;
- }
+ state->devs[i].is_present = false;
}
if (qemu_enabled_cpu(cpu)) {
--
2.27.0