[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-6.0 3/9] spapr: Fix pre-2.10 dummy ICP hack
From: |
David Gibson |
Subject: |
Re: [PATCH for-6.0 3/9] spapr: Fix pre-2.10 dummy ICP hack |
Date: |
Mon, 23 Nov 2020 16:03:07 +1100 |
On Sat, Nov 21, 2020 at 12:42:02AM +0100, Greg Kurz wrote:
> 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>
Applied to ppc-for-6.0, thanks.
> ---
>
> The next patch makes this patch a bit useless. I post it
> anyway for the records because it is a programming error.
> ---
> 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 394d28d9e081..f58f77389e8e 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3785,13 +3785,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.
> @@ -3805,6 +3798,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,
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [PATCH for-6.0 0/9] spapr: Perform hotplug sanity checks at pre-plug, Greg Kurz, 2020/11/20
- [PATCH for-6.0 1/9] spapr: Do PCI device hotplug sanity checks at pre-plug only, Greg Kurz, 2020/11/20
- [PATCH for-6.0 2/9] spapr: Do NVDIMM/PC-DIMM device hotplug sanity checks at pre-plug only, Greg Kurz, 2020/11/20
- [PATCH for-6.0 3/9] spapr: Fix pre-2.10 dummy ICP hack, Greg Kurz, 2020/11/20
- Re: [PATCH for-6.0 3/9] spapr: Fix pre-2.10 dummy ICP hack,
David Gibson <=
- [PATCH for-6.0 6/9] spapr: Make PHB placement functions and spapr_pre_plug_phb() return status, Greg Kurz, 2020/11/20
- [PATCH for-6.0 5/9] spapr: Simplify error path of spapr_core_plug(), Greg Kurz, 2020/11/20
- [PATCH for-6.0 7/9] spapr: Do PHB hoplug sanity check at pre-plug, Greg Kurz, 2020/11/20
- [PATCH for-6.0 4/9] spapr: Set compat mode in spapr_reset_vcpu(), Greg Kurz, 2020/11/20