* [PULL 0/2] loongarch bug fix for 10.0
@ 2025-04-08 6:41 Song Gao
2025-04-08 6:41 ` [PULL 1/2] hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug() Song Gao
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Song Gao @ 2025-04-08 6:41 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha
The following changes since commit dfaecc04c46d298e9ee81bd0ca96d8754f1c27ed:
Merge tag 'pull-riscv-to-apply-20250407-1' of https://github.com/alistair23/qemu into staging (2025-04-07 09:18:33 -0400)
are available in the Git repository at:
https://github.com/gaosong715/qemu.git tags/pull-loongarch-20250408
for you to fetch changes up to fa0dde12db045ddc84f69b1aa0a4c98d176c903d:
hw/loongarch/virt: Replace destination error with error_abort (2025-04-08 14:44:53 +0800)
----------------------------------------------------------------
loongarch bug fix for 10.0
----------------------------------------------------------------
Bibo Mao (2):
hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug()
hw/loongarch/virt: Replace destination error with error_abort
hw/loongarch/virt.c | 43 +++++++++----------------------------------
1 file changed, 9 insertions(+), 34 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PULL 1/2] hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug()
2025-04-08 6:41 [PULL 0/2] loongarch bug fix for 10.0 Song Gao
@ 2025-04-08 6:41 ` Song Gao
2025-04-08 6:41 ` [PULL 2/2] hw/loongarch/virt: Replace destination error with error_abort Song Gao
2025-04-09 8:31 ` [PULL 0/2] loongarch bug fix for 10.0 Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Song Gao @ 2025-04-08 6:41 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, Bibo Mao, Markus Armbruster
From: Bibo Mao <maobibo@loongson.cn>
In function virt_cpu_plug(), Object cpuslot::cpu is set at last
only when there is no any error, otherwise it is problematic that
cpuslot::cpu is set in advance however it returns because of error.
Fixes: ab9935d2991e (hw/loongarch/virt: Implement cpu plug interface)
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20250324030145.3037408-2-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
hw/loongarch/virt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index e25864214f..504f8755a0 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -973,8 +973,6 @@ static void virt_cpu_plug(HotplugHandler *hotplug_dev,
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
Error *err = NULL;
- cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
- cpu_slot->cpu = CPU(dev);
if (lvms->ipi) {
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), dev, &err);
if (err) {
@@ -998,6 +996,8 @@ static void virt_cpu_plug(HotplugHandler *hotplug_dev,
}
}
+ cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
+ cpu_slot->cpu = CPU(dev);
return;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PULL 2/2] hw/loongarch/virt: Replace destination error with error_abort
2025-04-08 6:41 [PULL 0/2] loongarch bug fix for 10.0 Song Gao
2025-04-08 6:41 ` [PULL 1/2] hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug() Song Gao
@ 2025-04-08 6:41 ` Song Gao
2025-04-09 8:31 ` [PULL 0/2] loongarch bug fix for 10.0 Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Song Gao @ 2025-04-08 6:41 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, Bibo Mao, Markus Armbruster
From: Bibo Mao <maobibo@loongson.cn>
In function virt_cpu_plug() and virt_cpu_unplug(), the error is
impossile. Destination error is not propagated and replaced with
error_abort. With this, the logic is simple.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20250324030145.3037408-3-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
hw/loongarch/virt.c | 39 +++++++--------------------------------
1 file changed, 7 insertions(+), 32 deletions(-)
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 504f8755a0..65c9027feb 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -936,29 +936,15 @@ static void virt_cpu_unplug(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
CPUArchId *cpu_slot;
- Error *err = NULL;
LoongArchCPU *cpu = LOONGARCH_CPU(dev);
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
/* Notify ipi and extioi irqchip to remove interrupt routing to CPU */
- hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->ipi), dev, &err);
- if (err) {
- error_propagate(errp, err);
- return;
- }
-
- hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->extioi), dev, &err);
- if (err) {
- error_propagate(errp, err);
- return;
- }
+ hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->ipi), dev, &error_abort);
+ hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->extioi), dev, &error_abort);
/* Notify acpi ged CPU removed */
- hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->acpi_ged), dev, &err);
- if (err) {
- error_propagate(errp, err);
- return;
- }
+ hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->acpi_ged), dev, &error_abort);
cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
cpu_slot->cpu = NULL;
@@ -971,29 +957,18 @@ static void virt_cpu_plug(HotplugHandler *hotplug_dev,
CPUArchId *cpu_slot;
LoongArchCPU *cpu = LOONGARCH_CPU(dev);
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
- Error *err = NULL;
if (lvms->ipi) {
- hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), dev, &err);
- if (err) {
- error_propagate(errp, err);
- return;
- }
+ hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), dev, &error_abort);
}
if (lvms->extioi) {
- hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), dev, &err);
- if (err) {
- error_propagate(errp, err);
- return;
- }
+ hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), dev, &error_abort);
}
if (lvms->acpi_ged) {
- hotplug_handler_plug(HOTPLUG_HANDLER(lvms->acpi_ged), dev, &err);
- if (err) {
- error_propagate(errp, err);
- }
+ hotplug_handler_plug(HOTPLUG_HANDLER(lvms->acpi_ged), dev,
+ &error_abort);
}
cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PULL 0/2] loongarch bug fix for 10.0
2025-04-08 6:41 [PULL 0/2] loongarch bug fix for 10.0 Song Gao
2025-04-08 6:41 ` [PULL 1/2] hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug() Song Gao
2025-04-08 6:41 ` [PULL 2/2] hw/loongarch/virt: Replace destination error with error_abort Song Gao
@ 2025-04-09 8:31 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2025-04-09 8:31 UTC (permalink / raw)
To: Song Gao; +Cc: qemu-devel, stefanha
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-09 12:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 6:41 [PULL 0/2] loongarch bug fix for 10.0 Song Gao
2025-04-08 6:41 ` [PULL 1/2] hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug() Song Gao
2025-04-08 6:41 ` [PULL 2/2] hw/loongarch/virt: Replace destination error with error_abort Song Gao
2025-04-09 8:31 ` [PULL 0/2] loongarch bug fix for 10.0 Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.