[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/30] spapr: Fix pre-2.10 dummy ICP hack
From: |
David Gibson |
Subject: |
[PULL 17/30] spapr: Fix pre-2.10 dummy ICP hack |
Date: |
Mon, 14 Dec 2020 15:57:54 +1100 |
From: Greg Kurz <groug@kaod.org>
This hack registers dummy VMState entries of ICPs in order to
support migration of old pseries machine types that used to
create all smp.max_cpus possible ICPs at machine init.
Part of the work is to unregister the dummy entries when plugging
an actual vCPU core, and to register them back when unplugging the
core. The code that unregisters the dummy ICPs in spapr_core_plug()
is misplaced: if ppc_set_compat() fails afterwards, the hotplug
operation will be cancelled and the dummy ICPs won't be registered
back since the unplug handler isn't called.
Unregister the dummy ICPs at the end of spapr_core_plug().
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-2-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d51c550288..5fbae8adda 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3782,13 +3782,6 @@ static void spapr_core_plug(HotplugHandler *hotplug_dev,
DeviceState *dev,
core_slot->cpu = OBJECT(dev);
- if (smc->pre_2_10_has_unused_icps) {
- for (i = 0; i < cc->nr_threads; i++) {
- cs = CPU(core->threads[i]);
- pre_2_10_vmstate_unregister_dummy_icp(cs->cpu_index);
- }
- }
-
/*
* Set compatibility mode to match the boot CPU, which was either set
* by the machine reset code or by CAS.
@@ -3802,6 +3795,13 @@ static void spapr_core_plug(HotplugHandler *hotplug_dev,
DeviceState *dev,
}
}
}
+
+ if (smc->pre_2_10_has_unused_icps) {
+ for (i = 0; i < cc->nr_threads; i++) {
+ cs = CPU(core->threads[i]);
+ pre_2_10_vmstate_unregister_dummy_icp(cs->cpu_index);
+ }
+ }
}
static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
--
2.29.2
- [PULL 03/30] spapr: Do PCI device hotplug sanity checks at pre-plug only, (continued)
- [PULL 03/30] spapr: Do PCI device hotplug sanity checks at pre-plug only, David Gibson, 2020/12/13
- [PULL 07/30] spapr: Do TPM proxy hotplug sanity checks at pre-plug, David Gibson, 2020/12/13
- [PULL 10/30] ppc/translate: Fix unordered f64/f128 comparisons, David Gibson, 2020/12/13
- [PULL 12/30] ppc/translate: Delay NaN checking after comparison, David Gibson, 2020/12/13
- [PULL 04/30] spapr: Do NVDIMM/PC-DIMM device hotplug sanity checks at pre-plug only, David Gibson, 2020/12/13
- [PULL 09/30] ppc: Add a missing break for PPC6xx_INPUT_TBEN, David Gibson, 2020/12/13
- [PULL 13/30] ppc/translate: Raise exceptions after setting the cc, David Gibson, 2020/12/13
- [PULL 18/30] spapr: Abort if ppc_set_compat() fails for hot-plugged CPUs, David Gibson, 2020/12/13
- [PULL 19/30] spapr: Simplify error path of spapr_core_plug(), David Gibson, 2020/12/13
- [PULL 14/30] ppc/translate: Rewrite gen_lxvdsx to use gvec primitives, David Gibson, 2020/12/13
- [PULL 17/30] spapr: Fix pre-2.10 dummy ICP hack,
David Gibson <=
- [PULL 15/30] hw/ppc/spapr_tpm_proxy: Fix hexadecimal format string specifier, David Gibson, 2020/12/13
- [PULL 11/30] ppc/translate: Turn the helper macros into functions, David Gibson, 2020/12/13
- [PULL 23/30] MAINTAINERS: Add Greg Kurz as co-maintainer for ppc, David Gibson, 2020/12/13
- [PULL 16/30] xive: Add trace events, David Gibson, 2020/12/13
- [PULL 20/30] spapr: spapr_drc_attach() cannot fail, David Gibson, 2020/12/13
- [PULL 21/30] target/ppc: Remove "compat" property of server class POWER CPUs, David Gibson, 2020/12/13
- [PULL 24/30] ppc/e500: Free irqs array to avoid memleak, David Gibson, 2020/12/13
- [PULL 22/30] hw/ppc: Do not re-read the clock on pre_save if doing savevm, David Gibson, 2020/12/13
- [PULL 29/30] spapr: Pass sPAPR machine state to some RTAS events handling functions, David Gibson, 2020/12/13
- [PULL 27/30] spapr: Pass sPAPR machine state down to spapr_pci_switch_vga(), David Gibson, 2020/12/13