qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Harsh Prateek Bora <harshpb@linux.ibm.com>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Cc: npiggin@gmail.com, danielhb413@gmail.com
Subject: Re: [PATCH v4 13/13] ppc/spapr: remove deprecated machine pseries-2.12
Date: Tue, 15 Oct 2024 09:31:16 +0200	[thread overview]
Message-ID: <4b773f41-c5c7-45fb-8a6d-e7c2a46dbccb@kaod.org> (raw)
In-Reply-To: <20241014122729.1136809-14-harshpb@linux.ibm.com>

On 10/14/24 14:27, Harsh Prateek Bora wrote:
> Commit 0cac0f1b964 marked pseries-2.12 machines as deprecated
> with reasons mentioned in its commit log.
> Removing pseries-2.12 specific code with this patch.
> 
> While at it, also remove pre-3.0-migration hacks introduced for backward
> compatibility which are now turned useless.
> 
> Suggested-by: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
> ---
>   docs/about/deprecated.rst       |  8 --------
>   include/hw/ppc/spapr_cpu_core.h |  1 -
>   target/ppc/cpu.h                |  4 ----
>   hw/ppc/spapr.c                  | 25 -------------------------
>   hw/ppc/spapr_cpu_core.c         | 12 +++---------
>   target/ppc/cpu_init.c           |  3 +--
>   target/ppc/machine.c            | 18 +-----------------
>   7 files changed, 5 insertions(+), 66 deletions(-)
> 
> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
> index 48b230b0a0..3b312a5de2 100644
> --- a/docs/about/deprecated.rst
> +++ b/docs/about/deprecated.rst
> @@ -243,14 +243,6 @@ These old machine types are quite neglected nowadays and thus might have
>   various pitfalls with regards to live migration. Use a newer machine type
>   instead.
>   
> -``pseries-2.1`` up to ``pseries-2.12`` (since 9.0)
> -''''''''''''''''''''''''''''''''''''''''''''''''''
> -
> -Older pseries machines before version 3.0 have undergone many changes
> -to correct issues, mostly regarding migration compatibility. These are
> -no longer maintained and removing them will make the code easier to
> -read and maintain. Use versions 3.0 and above as a replacement.
> -
>   PPC 405 ``ref405ep`` machine (since 9.1)
>   ''''''''''''''''''''''''''''''''''''''''
>   
> diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_core.h
> index 69a52e39b8..68f7083483 100644
> --- a/include/hw/ppc/spapr_cpu_core.h
> +++ b/include/hw/ppc/spapr_cpu_core.h
> @@ -28,7 +28,6 @@ struct SpaprCpuCore {
>       /*< public >*/
>       PowerPCCPU **threads;
>       int node_id;
> -    bool pre_3_0_migration; /* older machine don't know about SpaprCpuState */
>   };
>   
>   struct SpaprCpuCoreClass {
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index 74a0ab768d..506c8c825c 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -1454,10 +1454,6 @@ struct ArchCPU {
>       /* Those resources are used only during code translation */
>       /* opcode handlers */
>       opc_handler_t *opcodes[PPC_CPU_OPCODES_LEN];
> -
> -    /* Fields related to migration compatibility hacks */
> -    bool pre_3_0_migration;
> -    int32_t mig_slb_nr;
>   };
>   
>   /**
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index aba0ad26f1..5c02037c56 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -5015,31 +5015,6 @@ static void spapr_machine_3_0_class_options(MachineClass *mc)
>   
>   DEFINE_SPAPR_MACHINE(3, 0);
>   
> -/*
> - * pseries-2.12
> - */
> -static void spapr_machine_2_12_class_options(MachineClass *mc)
> -{
> -    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
> -    static GlobalProperty compat[] = {
> -        { TYPE_POWERPC_CPU, "pre-3.0-migration", "on" },
> -        { TYPE_SPAPR_CPU_CORE, "pre-3.0-migration", "on" },
> -    };
> -
> -    spapr_machine_3_0_class_options(mc);
> -    compat_props_add(mc->compat_props, hw_compat_2_12, hw_compat_2_12_len);
> -    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
> -
> -    /* We depend on kvm_enabled() to choose a default value for the
> -     * hpt-max-page-size capability. Of course we can't do it here
> -     * because this is too early and the HW accelerator isn't initialized
> -     * yet. Postpone this to machine init (see default_caps_with_cpu()).
> -     */
> -    smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] = 0;
> -}
> -
> -DEFINE_SPAPR_MACHINE(2, 12);
> -
>   static void spapr_machine_register_types(void)
>   {
>       type_register_static(&spapr_machine_info);
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 4642245168..1a84345f36 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -197,9 +197,7 @@ static void spapr_unrealize_vcpu(PowerPCCPU *cpu, SpaprCpuCore *sc)
>   {
>       CPUPPCState *env = &cpu->env;
>   
> -    if (!sc->pre_3_0_migration) {
> -        vmstate_unregister(NULL, &vmstate_spapr_cpu_state, cpu->machine_data);
> -    }
> +    vmstate_unregister(NULL, &vmstate_spapr_cpu_state, cpu->machine_data);
>       spapr_irq_cpu_intc_destroy(SPAPR_MACHINE(qdev_get_machine()), cpu);
>       cpu_ppc_tb_free(env);
>       qdev_unrealize(DEVICE(cpu));
> @@ -285,10 +283,8 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
>           return false;
>       }
>   
> -    if (!sc->pre_3_0_migration) {
> -        vmstate_register(NULL, cs->cpu_index, &vmstate_spapr_cpu_state,
> -                         cpu->machine_data);
> -    }
> +    vmstate_register(NULL, cs->cpu_index, &vmstate_spapr_cpu_state,
> +                     cpu->machine_data);
>       return true;
>   }
>   
> @@ -366,8 +362,6 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)
>   
>   static Property spapr_cpu_core_properties[] = {
>       DEFINE_PROP_INT32("node-id", SpaprCpuCore, node_id, CPU_UNSET_NUMA_NODE_ID),
> -    DEFINE_PROP_BOOL("pre-3.0-migration", SpaprCpuCore, pre_3_0_migration,
> -                     false),
>       DEFINE_PROP_END_OF_LIST()
>   };
>   
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 39c19e6674..011e53d961 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -7452,8 +7452,7 @@ static void ppc_disas_set_info(CPUState *cs, disassemble_info *info)
>   }
>   
>   static Property ppc_cpu_properties[] = {
> -    DEFINE_PROP_BOOL("pre-3.0-migration", PowerPCCPU, pre_3_0_migration,
> -                     false),
> +    /* add default property here */
>       DEFINE_PROP_END_OF_LIST(),

In case you resping, please remove ppc_cpu_properties[].

Since this is minor,


Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.



>   };
>   
> diff --git a/target/ppc/machine.c b/target/ppc/machine.c
> index 47495b68b1..717bf93e88 100644
> --- a/target/ppc/machine.c
> +++ b/target/ppc/machine.c
> @@ -118,15 +118,6 @@ static const VMStateInfo vmstate_info_vsr = {
>   #define VMSTATE_VSR_ARRAY(_f, _s, _n)                             \
>       VMSTATE_VSR_ARRAY_V(_f, _s, _n, 0)
>   
> -#if defined(TARGET_PPC64)
> -static bool cpu_pre_3_0_migration(void *opaque, int version_id)
> -{
> -    PowerPCCPU *cpu = opaque;
> -
> -    return cpu->pre_3_0_migration;
> -}
> -#endif
> -
>   static int cpu_pre_save(void *opaque)
>   {
>       PowerPCCPU *cpu = opaque;
> @@ -154,12 +145,6 @@ static int cpu_pre_save(void *opaque)
>           env->spr[SPR_IBAT4U + 2 * i + 1] = env->IBAT[1][i + 4];
>       }
>   
> -    if (cpu->pre_3_0_migration) {
> -        if (cpu->hash64_opts) {
> -            cpu->mig_slb_nr = cpu->hash64_opts->slb_size;
> -        }
> -    }
> -
>       /* Used to retain migration compatibility for pre 6.0 for 601 machines. */
>       env->hflags_compat_nmsr = 0;
>   
> @@ -503,12 +488,11 @@ static int slb_post_load(void *opaque, int version_id)
>   
>   static const VMStateDescription vmstate_slb = {
>       .name = "cpu/slb",
> -    .version_id = 1,
> +    .version_id = 2,
>       .minimum_version_id = 1,
>       .needed = slb_needed,
>       .post_load = slb_post_load,
>       .fields = (const VMStateField[]) {
> -        VMSTATE_INT32_TEST(mig_slb_nr, PowerPCCPU, cpu_pre_3_0_migration),
>           VMSTATE_SLB_ARRAY(env.slb, PowerPCCPU, MAX_SLB_ENTRIES),
>           VMSTATE_END_OF_LIST()
>       }



      reply	other threads:[~2024-10-15  7:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 12:27 [PATCH v4 00/13] ppc/spapr: remove deprecated machines specific code Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 01/13] ppc/spapr: remove deprecated machine pseries-2.1 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 02/13] ppc/spapr: remove deprecated machine pseries-2.2 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 03/13] ppc/spapr: remove deprecated machine pseries-2.3 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 04/13] ppc/spapr: remove deprecated machine pseries-2.4 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 05/13] ppc/spapr: remove deprecated machine pseries-2.5 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 06/13] ppc/spapr: remove deprecated machine pseries-2.6 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 07/13] ppc/spapr: remove deprecated machine pseries-2.7 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 08/13] ppc/spapr: remove deprecated machine pseries-2.8 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 09/13] ppc/spapr: remove deprecated machine pseries-2.9 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 10/13] ppc/spapr: remove deprecated machine pseries-2.10 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 11/13] ppc/spapr: remove deprecated machine pseries-2.11 Harsh Prateek Bora
2024-10-14 12:27 ` [PATCH v4 12/13] ppc/spapr: remove deprecated machine pseries-2.12-sxxm Harsh Prateek Bora
2024-10-15  7:30   ` Cédric Le Goater
2024-10-14 12:27 ` [PATCH v4 13/13] ppc/spapr: remove deprecated machine pseries-2.12 Harsh Prateek Bora
2024-10-15  7:31   ` Cédric Le Goater [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b773f41-c5c7-45fb-8a6d-e7c2a46dbccb@kaod.org \
    --to=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=harshpb@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).