Skip to contentSkip to conversation

ppc/spapr: remove deprecated machines specific code

PATCH Superseded Harsh Prateek Bora 3 participants 25 messages Oct 7, 2024 – May 2, 2025

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover ppc/spapr: remove deprecated machines specific code

As per Qemu's deprecation policy [1], and the legacy pseries machines being marked as deprecated in earlier commits, this patchset aims at removing the respective code for machines which are now deprecated.

[1] https://www.qemu.org/docs/master/about/deprecated.html

v3: Addressed review comments from Cedric on v2 patchset
Removed some more pre-2.10 migration hacks in patch 9/14 Removed pseries-2.12 and pseries-3.10 also as due for removal.

v2: <[email protected]>
v1: <[email protected]>

Harsh Prateek Bora (14):
ppc/spapr: remove deprecated machine pseries-2.1 ppc/spapr: remove deprecated machine pseries-2.2 ppc/spapr: remove deprecated machine pseries-2.3 ppc/spapr: remove deprecated machine pseries-2.4 ppc/spapr: remove deprecated machine pseries-2.5 ppc/spapr: remove deprecated machine pseries-2.6 ppc/spapr: remove deprecated machine pseries-2.7 ppc/spapr: remove deprecated machine pseries-2.8 ppc/spapr: remove deprecated machine pseries-2.9 ppc/spapr: remove deprecated machine pseries-2.10 ppc/spapr: remove deprecated machine pseries-2.11 ppc/spapr: remove deprecated machine pseries-2.12-sxxm ppc/spapr: remove deprecated machine pseries-2.12 ppc/spapr: remove deprecated machine pseries-3.0

 docs/about/deprecated.rst       |   8 -
 include/hw/pci-host/spapr.h     |   5 -
 include/hw/ppc/spapr.h          |   4 -
 include/hw/ppc/spapr_cpu_core.h |   1 -
 include/hw/ppc/spapr_irq.h      |   1 -
 target/ppc/cpu.h                |  10 -
 hw/intc/xics.c                  |  16 --
 hw/ppc/spapr.c                  | 412 +-------------------------------
 hw/ppc/spapr_cpu_core.c         |  12 +-
 hw/ppc/spapr_events.c           |   8 -
 hw/ppc/spapr_irq.c              |  16 +-
 hw/ppc/spapr_pci.c              | 124 +---------
 hw/ppc/spapr_vio.c              |   9 -
 migration/savevm.c              |  19 --
 target/ppc/cpu_init.c           |   6 +-
 target/ppc/machine.c            |  70 +-----
 16 files changed, 23 insertions(+), 698 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH v3 1/14 ppc/spapr: remove deprecated machine pseries-2.1

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.1 specific code with this patch for now.

---
 hw/ppc/spapr.c | 11 -----------
 1 file changed, 11 deletions(-)
hw/ppc/spapr.c +0 -11
index 2c10a70a48..e9518ff8b3 100644
@@ -5381,17 +5381,6 @@ static void spapr_machine_2_2_class_options(MachineClass *mc)
 }
 DEFINE_SPAPR_MACHINE(2, 2);
 
-/*
- * pseries-2.1
- */
-
-static void spapr_machine_2_1_class_options(MachineClass *mc)
-{
-    spapr_machine_2_2_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len);
-}
-DEFINE_SPAPR_MACHINE(2, 1);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
#2 lore raw

Re: [PATCH v3 01/14] ppc/spapr: remove deprecated machine pseries-2.1

Hi Harsh,

Quoted 17 lines · Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.1 specific code with this patch for now.

---
  hw/ppc/spapr.c | 11 -----------
  1 file changed, 11 deletions(-)
hw/ppc/spapr.c +0 -0
index 2c10a70a48..e9518ff8b3 100644
@@ -5381,17 +5381,6 @@ static void spapr_machine_2_2_class_options(MachineClass *mc)
  }

hw/ppc/spapr.c static void spapr_machine_2_2_class_options(MachineClass *mc) · line 5391

Quoted 10 lines
hw/ppc/spapr.c +0 -8
  DEFINE_SPAPR_MACHINE(2, 2);
 
-/*
- * pseries-2.1
- */
-
-static void spapr_machine_2_1_class_options(MachineClass *mc)
-{
-    spapr_machine_2_2_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len);

Why not remove hw_compat_2_1[] and hw_compat_2_1_len in the same patch?

Quoted 6 lines
hw/ppc/spapr.c +0 -3
-}
-DEFINE_SPAPR_MACHINE(2, 1);
-
  static void spapr_machine_register_types(void)
  {
      type_register_static(&spapr_machine_info);
#3 lore raw

Re: [PATCH v3 01/14] ppc/spapr: remove deprecated machine pseries-2.1

Hi Philippe,

Quoted 25 lines · Philippe Mathieu-Daudé

Hi Harsh,

Quoted 22 lines · Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.1 specific code with this patch for now.

---
  hw/ppc/spapr.c | 11 -----------

  1 file changed, 11 deletions(-)
hw/ppc/spapr.c +0 -3
index 2c10a70a48..e9518ff8b3 100644
@@ -5381,17 +5381,6 @@ static void 
 spapr_machine_2_2_class_options(MachineClass *mc)
   }
   DEFINE_SPAPR_MACHINE(2, 2);
-/*
- * pseries-2.1
- */
Quoted 9 lines

hw/ppc/spapr.c static void spapr_machine_2_2_class_options(MachineClass *mc)

Quoted 6 lines
hw/ppc/spapr.c +0 -5
-
-static void spapr_machine_2_1_class_options(MachineClass *mc)
-{
-    spapr_machine_2_2_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_1, 
 hw_compat_2_1_len);

Why not remove hw_compat_2_1[] and hw_compat_2_1_len in the same patch?

Nice catch, somehow I missed it. Probably because I saw hw_compat_2_4 onwards are still shared by other machines. I shall remove the ones for which spapr remains the only consumer.

Thanks
Harsh

Quoted 7 lines
Quoted 6 lines
hw/ppc/spapr.c +0 -3
-}
-DEFINE_SPAPR_MACHINE(2, 1);
-
   static void spapr_machine_register_types(void)
   {

      type_register_static(&spapr_machine_info);

#4 lore raw

PATCH v3 2/14 ppc/spapr: remove deprecated machine pseries-2.2

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.2 specific code with this patch for now.

---
 hw/ppc/spapr.c | 17 -----------------
 1 file changed, 17 deletions(-)
hw/ppc/spapr.c +0 -17
index e9518ff8b3..34d655d0b3 100644
@@ -5364,23 +5364,6 @@ static void spapr_machine_2_3_class_options(MachineClass *mc)
 }
 DEFINE_SPAPR_MACHINE(2, 3);
 
-/*
- * pseries-2.2
- */
-
-static void spapr_machine_2_2_class_options(MachineClass *mc)
-{
-    static GlobalProperty compat[] = {
-        { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem_win_size", "0x20000000" },
-    };
-
-    spapr_machine_2_3_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_2, hw_compat_2_2_len);
-    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-    mc->default_machine_opts = "modern-hotplug-events=off,suppress-vmdesc=on";
-}
-DEFINE_SPAPR_MACHINE(2, 2);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
#5 lore raw

PATCH v3 3/14 ppc/spapr: remove deprecated machine pseries-2.3

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.3 specific code with this patch for now.

While at it, also remove the dynamic-reconfiguration option which was introduced to disable it by default for legacy machines until pseries-2.3.

---
 include/hw/pci-host/spapr.h |  1 -
 hw/ppc/spapr.c              | 15 ---------------
 hw/ppc/spapr_pci.c          | 35 -----------------------------------
 3 files changed, 51 deletions(-)
include/hw/pci-host/spapr.h +0 -1
index 3778aac27b..79187e80fd 100644
@@ -53,7 +53,6 @@ struct SpaprPhbState {
     uint32_t index;
     uint64_t buid;
     char *dtbusname;
-    bool dr_enabled;
 
     MemoryRegion memspace, iospace;
     hwaddr mem_win_addr, mem_win_size, mem64_win_addr, mem64_win_size;
hw/ppc/spapr.c +0 -15
index 34d655d0b3..599a59910c 100644
@@ -5349,21 +5349,6 @@ static void spapr_machine_2_4_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(2, 4);
 
-/*
- * pseries-2.3
- */
-
-static void spapr_machine_2_3_class_options(MachineClass *mc)
-{
-    static GlobalProperty compat[] = {
-        { "spapr-pci-host-bridge", "dynamic-reconfiguration", "off" },
-    };
-    spapr_machine_2_4_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_3, hw_compat_2_3_len);
-    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-}
-DEFINE_SPAPR_MACHINE(2, 3);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
hw/ppc/spapr_pci.c +0 -35
index 5c0024bef9..8f1964ce52 100644
@@ -1237,10 +1237,6 @@ static void add_drcs(SpaprPhbState *phb, PCIBus *bus)
     int i;
     uint8_t chassis;
 
-    if (!phb->dr_enabled) {
-        return;
-    }
-
     chassis = chassis_from_bus(bus);
 
     if (pci_bus_is_root(bus)) {
@@ -1260,10 +1256,6 @@ static void remove_drcs(SpaprPhbState *phb, PCIBus *bus)
     int i;
     uint8_t chassis;
 
-    if (!phb->dr_enabled) {
-        return;
-    }
-
     chassis = chassis_from_bus(bus);
 
     for (i = PCI_SLOT_MAX * PCI_FUNC_MAX - 1; i >= 0; i--) {
@@ -1548,17 +1540,6 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler,
     PCIBus *bus = PCI_BUS(qdev_get_parent_bus(DEVICE(pdev)));
     uint32_t slotnr = PCI_SLOT(pdev->devfn);
 
-    if (!phb->dr_enabled) {
-        /* if this is a hotplug operation initiated by the user
-         * we need to let them know it's not enabled
-         */
-        if (plugged_dev->hotplugged) {
-            error_setg(errp, "Bus '%s' does not support hotplugging",
-                       phb->parent_obj.bus->qbus.name);
-            return;
-        }
-    }
-
     if (IS_PCI_BRIDGE(plugged_dev)) {
         if (!bridge_has_valid_chassis_nr(OBJECT(plugged_dev), errp)) {
             return;
@@ -1591,14 +1572,6 @@ static void spapr_pci_plug(HotplugHandler *plug_handler,
     SpaprDrc *drc = drc_from_dev(phb, pdev);
     uint32_t slotnr = PCI_SLOT(pdev->devfn);
 
-    /*
-     * If DR is disabled we don't need to do anything in the case of
-     * hotplug or coldplug callbacks.
-     */
-    if (!phb->dr_enabled) {
-        return;
-    }
-
     g_assert(drc);
 
     if (IS_PCI_BRIDGE(plugged_dev)) {
@@ -1673,12 +1646,6 @@ static void spapr_pci_unplug_request(HotplugHandler *plug_handler,
     PCIDevice *pdev = PCI_DEVICE(plugged_dev);
     SpaprDrc *drc = drc_from_dev(phb, pdev);
 
-    if (!phb->dr_enabled) {
-        error_setg(errp, "Bus '%s' does not support hotplugging",
-                   phb->parent_obj.bus->qbus.name);
-        return;
-    }
-
     g_assert(drc);
     g_assert(drc->dev == plugged_dev);
 
@@ -2089,8 +2056,6 @@ static Property spapr_phb_properties[] = {
                        SPAPR_PCI_MEM64_WIN_SIZE),
     DEFINE_PROP_UINT64("io_win_size", SpaprPhbState, io_win_size,
                        SPAPR_PCI_IO_WIN_SIZE),
-    DEFINE_PROP_BOOL("dynamic-reconfiguration", SpaprPhbState, dr_enabled,
-                     true),
     /* Default DMA window is 0..1GB */
     DEFINE_PROP_UINT64("dma_win_addr", SpaprPhbState, dma_win_addr, 0),
     DEFINE_PROP_UINT64("dma_win_size", SpaprPhbState, dma_win_size, 0x40000000),
Signature · 1 line
2.45.2
Reviewed-by on v3 3/14
#6 lore raw

Re: [PATCH v3 03/14] ppc/spapr: remove deprecated machine pseries-2.3

Quoted 9 lines · Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.3 specific code with this patch for now.

While at it, also remove the dynamic-reconfiguration option which was introduced to disable it by default for legacy machines until pseries-2.3.

Thanks,

C.

Quoted 125 lines
---
  include/hw/pci-host/spapr.h |  1 -
  hw/ppc/spapr.c              | 15 ---------------
  hw/ppc/spapr_pci.c          | 35 -----------------------------------
  3 files changed, 51 deletions(-)
include/hw/pci-host/spapr.h +0 -1
index 3778aac27b..79187e80fd 100644
@@ -53,7 +53,6 @@ struct SpaprPhbState {
      uint32_t index;
      uint64_t buid;
      char *dtbusname;
-    bool dr_enabled;
 
      MemoryRegion memspace, iospace;
      hwaddr mem_win_addr, mem_win_size, mem64_win_addr, mem64_win_size;
hw/ppc/spapr.c +0 -15
index 34d655d0b3..599a59910c 100644
@@ -5349,21 +5349,6 @@ static void spapr_machine_2_4_class_options(MachineClass *mc)
 
  DEFINE_SPAPR_MACHINE(2, 4);
 
-/*
- * pseries-2.3
- */
-
-static void spapr_machine_2_3_class_options(MachineClass *mc)
-{
-    static GlobalProperty compat[] = {
-        { "spapr-pci-host-bridge", "dynamic-reconfiguration", "off" },
-    };
-    spapr_machine_2_4_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_3, hw_compat_2_3_len);
-    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-}
-DEFINE_SPAPR_MACHINE(2, 3);
-
  static void spapr_machine_register_types(void)
  {
      type_register_static(&spapr_machine_info);
hw/ppc/spapr_pci.c +0 -35
index 5c0024bef9..8f1964ce52 100644
@@ -1237,10 +1237,6 @@ static void add_drcs(SpaprPhbState *phb, PCIBus *bus)
      int i;
      uint8_t chassis;
 
-    if (!phb->dr_enabled) {
-        return;
-    }
-
      chassis = chassis_from_bus(bus);
 
      if (pci_bus_is_root(bus)) {
@@ -1260,10 +1256,6 @@ static void remove_drcs(SpaprPhbState *phb, PCIBus *bus)
      int i;
      uint8_t chassis;
 
-    if (!phb->dr_enabled) {
-        return;
-    }
-
      chassis = chassis_from_bus(bus);
 
      for (i = PCI_SLOT_MAX * PCI_FUNC_MAX - 1; i >= 0; i--) {
@@ -1548,17 +1540,6 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler,
      PCIBus *bus = PCI_BUS(qdev_get_parent_bus(DEVICE(pdev)));
      uint32_t slotnr = PCI_SLOT(pdev->devfn);
 
-    if (!phb->dr_enabled) {
-        /* if this is a hotplug operation initiated by the user
-         * we need to let them know it's not enabled
-         */
-        if (plugged_dev->hotplugged) {
-            error_setg(errp, "Bus '%s' does not support hotplugging",
-                       phb->parent_obj.bus->qbus.name);
-            return;
-        }
-    }
-
      if (IS_PCI_BRIDGE(plugged_dev)) {
          if (!bridge_has_valid_chassis_nr(OBJECT(plugged_dev), errp)) {
              return;
@@ -1591,14 +1572,6 @@ static void spapr_pci_plug(HotplugHandler *plug_handler,
      SpaprDrc *drc = drc_from_dev(phb, pdev);
      uint32_t slotnr = PCI_SLOT(pdev->devfn);
 
-    /*
-     * If DR is disabled we don't need to do anything in the case of
-     * hotplug or coldplug callbacks.
-     */
-    if (!phb->dr_enabled) {
-        return;
-    }
-
      g_assert(drc);
 
      if (IS_PCI_BRIDGE(plugged_dev)) {
@@ -1673,12 +1646,6 @@ static void spapr_pci_unplug_request(HotplugHandler *plug_handler,
      PCIDevice *pdev = PCI_DEVICE(plugged_dev);
      SpaprDrc *drc = drc_from_dev(phb, pdev);
 
-    if (!phb->dr_enabled) {
-        error_setg(errp, "Bus '%s' does not support hotplugging",
-                   phb->parent_obj.bus->qbus.name);
-        return;
-    }
-
      g_assert(drc);
      g_assert(drc->dev == plugged_dev);
 
@@ -2089,8 +2056,6 @@ static Property spapr_phb_properties[] = {
                         SPAPR_PCI_MEM64_WIN_SIZE),
      DEFINE_PROP_UINT64("io_win_size", SpaprPhbState, io_win_size,
                         SPAPR_PCI_IO_WIN_SIZE),
-    DEFINE_PROP_BOOL("dynamic-reconfiguration", SpaprPhbState, dr_enabled,
-                     true),
      /* Default DMA window is 0..1GB */
      DEFINE_PROP_UINT64("dma_win_addr", SpaprPhbState, dma_win_addr, 0),
      DEFINE_PROP_UINT64("dma_win_size", SpaprPhbState, dma_win_size, 0x40000000),
#7 lore raw

PATCH v3 4/14 ppc/spapr: remove deprecated machine pseries-2.4

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.4 specific code with this patch for now.

While at it, also remove SpaprMachineClass::dr_lmb_enabled which is now turned useless.

---
 include/hw/ppc/spapr.h |  1 -
 hw/ppc/spapr.c         | 38 ++++----------------------------------
 2 files changed, 4 insertions(+), 35 deletions(-)
include/hw/ppc/spapr.h +0 -1
index f6de3e9972..1821ef96c7 100644
@@ -141,7 +141,6 @@ struct SpaprMachineClass {
     MachineClass parent_class;
 
     /*< public >*/
-    bool dr_lmb_enabled;       /* enable dynamic-reconfig/hotplug of LMBs */
     bool dr_phb_enabled;       /* enable dynamic-reconfig/hotplug of PHBs */
     bool update_dt_enabled;    /* enable KVMPPC_H_UPDATE_DT */
     bool use_ohci_by_default;  /* use USB-OHCI instead of XHCI */
hw/ppc/spapr.c +4 -34
index 599a59910c..4d7705c89f 100644
@@ -682,7 +682,6 @@ static int spapr_dt_dynamic_reconfiguration_memory(SpaprMachineState *spapr,
 static int spapr_dt_memory(SpaprMachineState *spapr, void *fdt)
 {
     MachineState *machine = MACHINE(spapr);
-    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
     hwaddr mem_start, node_size;
     int i, nb_nodes = machine->numa_state->num_nodes;
     NodeInfo *nodes = machine->numa_state->nodes;
@@ -724,7 +723,6 @@ static int spapr_dt_memory(SpaprMachineState *spapr, void *fdt)
     if (spapr_ovec_test(spapr->ov5_cas, OV5_DRCONF_MEMORY)) {
         int ret;
 
-        g_assert(smc->dr_lmb_enabled);
         ret = spapr_dt_dynamic_reconfiguration_memory(spapr, fdt);
         if (ret) {
             return ret;
@@ -1307,9 +1305,7 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
     spapr_dt_cpus(fdt, spapr);
 
     /* ibm,drc-indexes and friends */
-    if (smc->dr_lmb_enabled) {
-        root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_LMB;
-    }
+    root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_LMB;
     if (smc->dr_phb_enabled) {
         root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_PHB;
     }
@@ -2929,10 +2925,8 @@ static void spapr_machine_init(MachineState *machine)
     spapr->ov5 = spapr_ovec_new();
     spapr->ov5_cas = spapr_ovec_new();
 
-    if (smc->dr_lmb_enabled) {
-        spapr_ovec_set(spapr->ov5, OV5_DRCONF_MEMORY);
-        spapr_validate_node_memory(machine, &error_fatal);
-    }
+    spapr_ovec_set(spapr->ov5, OV5_DRCONF_MEMORY);
+    spapr_validate_node_memory(machine, &error_fatal);
 
     spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY);
 
@@ -3016,9 +3010,7 @@ static void spapr_machine_init(MachineState *machine)
         machine_memory_devices_init(machine, device_mem_base, device_mem_size);
     }
 
-    if (smc->dr_lmb_enabled) {
-        spapr_create_lmb_dr_connectors(spapr);
-    }
+    spapr_create_lmb_dr_connectors(spapr);
 
     if (mc->nvdimm_supported) {
         spapr_create_nvdimm_dr_connectors(spapr);
@@ -3662,7 +3654,6 @@ static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev)
 static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
                                   Error **errp)
 {
-    const SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(hotplug_dev);
     SpaprMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
     bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
     PCDIMMDevice *dimm = PC_DIMM(dev);
@@ -3671,11 +3662,6 @@ static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
     Object *memdev;
     hwaddr pagesize;
 
-    if (!smc->dr_lmb_enabled) {
-        error_setg(errp, "Memory hotplug not supported for this machine");
-        return;
-    }
-
     size = memory_device_get_region_size(MEMORY_DEVICE(dimm), &local_err);
     if (local_err) {
         error_propagate(errp, local_err);
@@ -4713,7 +4699,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
     hc->unplug_request = spapr_machine_device_unplug_request;
     hc->unplug = spapr_machine_device_unplug;
 
-    smc->dr_lmb_enabled = true;
     smc->update_dt_enabled = true;
     mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power10_v2.0");
     mc->has_hotpluggable_cpus = true;
@@ -5334,21 +5319,6 @@ static void spapr_machine_2_5_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(2, 5);
 
-/*
- * pseries-2.4
- */
-
-static void spapr_machine_2_4_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
-    spapr_machine_2_5_class_options(mc);
-    smc->dr_lmb_enabled = false;
-    compat_props_add(mc->compat_props, hw_compat_2_4, hw_compat_2_4_len);
-}
-
-DEFINE_SPAPR_MACHINE(2, 4);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
Reviewed-by on v3 4/14
#8 lore raw

Re: [PATCH v3 04/14] ppc/spapr: remove deprecated machine pseries-2.4

Quoted 9 lines · Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.4 specific code with this patch for now.

While at it, also remove SpaprMachineClass::dr_lmb_enabled which is now turned useless.

Thanks,

C.

Quoted 122 lines
---
  include/hw/ppc/spapr.h |  1 -
  hw/ppc/spapr.c         | 38 ++++----------------------------------
  2 files changed, 4 insertions(+), 35 deletions(-)
include/hw/ppc/spapr.h +0 -1
index f6de3e9972..1821ef96c7 100644
@@ -141,7 +141,6 @@ struct SpaprMachineClass {
      MachineClass parent_class;
 
      /*< public >*/
-    bool dr_lmb_enabled;       /* enable dynamic-reconfig/hotplug of LMBs */
      bool dr_phb_enabled;       /* enable dynamic-reconfig/hotplug of PHBs */
      bool update_dt_enabled;    /* enable KVMPPC_H_UPDATE_DT */
      bool use_ohci_by_default;  /* use USB-OHCI instead of XHCI */
hw/ppc/spapr.c +4 -34
index 599a59910c..4d7705c89f 100644
@@ -682,7 +682,6 @@ static int spapr_dt_dynamic_reconfiguration_memory(SpaprMachineState *spapr,
  static int spapr_dt_memory(SpaprMachineState *spapr, void *fdt)
  {
      MachineState *machine = MACHINE(spapr);
-    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
      hwaddr mem_start, node_size;
      int i, nb_nodes = machine->numa_state->num_nodes;
      NodeInfo *nodes = machine->numa_state->nodes;
@@ -724,7 +723,6 @@ static int spapr_dt_memory(SpaprMachineState *spapr, void *fdt)
      if (spapr_ovec_test(spapr->ov5_cas, OV5_DRCONF_MEMORY)) {
          int ret;
 
-        g_assert(smc->dr_lmb_enabled);
          ret = spapr_dt_dynamic_reconfiguration_memory(spapr, fdt);
          if (ret) {
              return ret;
@@ -1307,9 +1305,7 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
      spapr_dt_cpus(fdt, spapr);
 
      /* ibm,drc-indexes and friends */
-    if (smc->dr_lmb_enabled) {
-        root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_LMB;
-    }
+    root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_LMB;
      if (smc->dr_phb_enabled) {
          root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_PHB;
      }
@@ -2929,10 +2925,8 @@ static void spapr_machine_init(MachineState *machine)
      spapr->ov5 = spapr_ovec_new();
      spapr->ov5_cas = spapr_ovec_new();
 
-    if (smc->dr_lmb_enabled) {
-        spapr_ovec_set(spapr->ov5, OV5_DRCONF_MEMORY);
-        spapr_validate_node_memory(machine, &error_fatal);
-    }
+    spapr_ovec_set(spapr->ov5, OV5_DRCONF_MEMORY);
+    spapr_validate_node_memory(machine, &error_fatal);
 
      spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY);
 
@@ -3016,9 +3010,7 @@ static void spapr_machine_init(MachineState *machine)
          machine_memory_devices_init(machine, device_mem_base, device_mem_size);
      }
 
-    if (smc->dr_lmb_enabled) {
-        spapr_create_lmb_dr_connectors(spapr);
-    }
+    spapr_create_lmb_dr_connectors(spapr);
 
      if (mc->nvdimm_supported) {
          spapr_create_nvdimm_dr_connectors(spapr);
@@ -3662,7 +3654,6 @@ static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev)
  static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
                                    Error **errp)
  {
-    const SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(hotplug_dev);
      SpaprMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
      bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
      PCDIMMDevice *dimm = PC_DIMM(dev);
@@ -3671,11 +3662,6 @@ static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
      Object *memdev;
      hwaddr pagesize;
 
-    if (!smc->dr_lmb_enabled) {
-        error_setg(errp, "Memory hotplug not supported for this machine");
-        return;
-    }
-
      size = memory_device_get_region_size(MEMORY_DEVICE(dimm), &local_err);
      if (local_err) {
          error_propagate(errp, local_err);
@@ -4713,7 +4699,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
      hc->unplug_request = spapr_machine_device_unplug_request;
      hc->unplug = spapr_machine_device_unplug;
 
-    smc->dr_lmb_enabled = true;
      smc->update_dt_enabled = true;
      mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power10_v2.0");
      mc->has_hotpluggable_cpus = true;
@@ -5334,21 +5319,6 @@ static void spapr_machine_2_5_class_options(MachineClass *mc)
 
  DEFINE_SPAPR_MACHINE(2, 5);
 
-/*
- * pseries-2.4
- */
-
-static void spapr_machine_2_4_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
-    spapr_machine_2_5_class_options(mc);
-    smc->dr_lmb_enabled = false;
-    compat_props_add(mc->compat_props, hw_compat_2_4, hw_compat_2_4_len);
-}
-
-DEFINE_SPAPR_MACHINE(2, 4);
-
  static void spapr_machine_register_types(void)
  {
      type_register_static(&spapr_machine_info);
#9 lore raw

PATCH v3 5/14 ppc/spapr: remove deprecated machine pseries-2.5

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.5 specific code with this patch for now.

Also drop sPAPRMachineClass::use_ohci_by_default which is now useless.

---
 include/hw/ppc/spapr.h |  1 -
 hw/ppc/spapr.c         | 25 +------------------------
 2 files changed, 1 insertion(+), 25 deletions(-)
include/hw/ppc/spapr.h +0 -1
index 1821ef96c7..6e9e62386c 100644
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
     /*< public >*/
     bool dr_phb_enabled;       /* enable dynamic-reconfig/hotplug of PHBs */
     bool update_dt_enabled;    /* enable KVMPPC_H_UPDATE_DT */
-    bool use_ohci_by_default;  /* use USB-OHCI instead of XHCI */
     bool pre_2_10_has_unused_icps;
     bool legacy_irq_allocation;
     uint32_t nr_xirqs;
hw/ppc/spapr.c +1 -24
index 4d7705c89f..f63843d107 100644
@@ -3070,11 +3070,7 @@ static void spapr_machine_init(MachineState *machine)
     }
 
     if (machine->usb) {
-        if (smc->use_ohci_by_default) {
-            pci_create_simple(phb->bus, -1, "pci-ohci");
-        } else {
-            pci_create_simple(phb->bus, -1, "nec-usb-xhci");
-        }
+        pci_create_simple(phb->bus, -1, "nec-usb-xhci");
 
         if (has_vga) {
             USBBus *usb_bus;
@@ -5300,25 +5296,6 @@ static void spapr_machine_2_6_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(2, 6);
 
-/*
- * pseries-2.5
- */
-
-static void spapr_machine_2_5_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-    static GlobalProperty compat[] = {
-        { "spapr-vlan", "use-rx-buffer-pools", "off" },
-    };
-
-    spapr_machine_2_6_class_options(mc);
-    smc->use_ohci_by_default = true;
-    compat_props_add(mc->compat_props, hw_compat_2_5, hw_compat_2_5_len);
-    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_SPAPR_MACHINE(2, 5);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
Reviewed-by on v3 5/14
#10 lore raw

Re: [PATCH v3 05/14] ppc/spapr: remove deprecated machine pseries-2.5

Quoted 8 lines · Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.5 specific code with this patch for now.

Also drop sPAPRMachineClass::use_ohci_by_default which is now useless.

Thanks,

C.

Quoted 60 lines
---
  include/hw/ppc/spapr.h |  1 -
  hw/ppc/spapr.c         | 25 +------------------------
  2 files changed, 1 insertion(+), 25 deletions(-)
include/hw/ppc/spapr.h +0 -1
index 1821ef96c7..6e9e62386c 100644
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
      /*< public >*/
      bool dr_phb_enabled;       /* enable dynamic-reconfig/hotplug of PHBs */
      bool update_dt_enabled;    /* enable KVMPPC_H_UPDATE_DT */
-    bool use_ohci_by_default;  /* use USB-OHCI instead of XHCI */
      bool pre_2_10_has_unused_icps;
      bool legacy_irq_allocation;
      uint32_t nr_xirqs;
hw/ppc/spapr.c +1 -24
index 4d7705c89f..f63843d107 100644
@@ -3070,11 +3070,7 @@ static void spapr_machine_init(MachineState *machine)
      }
 
      if (machine->usb) {
-        if (smc->use_ohci_by_default) {
-            pci_create_simple(phb->bus, -1, "pci-ohci");
-        } else {
-            pci_create_simple(phb->bus, -1, "nec-usb-xhci");
-        }
+        pci_create_simple(phb->bus, -1, "nec-usb-xhci");
 
          if (has_vga) {
              USBBus *usb_bus;
@@ -5300,25 +5296,6 @@ static void spapr_machine_2_6_class_options(MachineClass *mc)
 
  DEFINE_SPAPR_MACHINE(2, 6);
 
-/*
- * pseries-2.5
- */
-
-static void spapr_machine_2_5_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-    static GlobalProperty compat[] = {
-        { "spapr-vlan", "use-rx-buffer-pools", "off" },
-    };
-
-    spapr_machine_2_6_class_options(mc);
-    smc->use_ohci_by_default = true;
-    compat_props_add(mc->compat_props, hw_compat_2_5, hw_compat_2_5_len);
-    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_SPAPR_MACHINE(2, 5);
-
  static void spapr_machine_register_types(void)
  {
      type_register_static(&spapr_machine_info);
#11 lore raw

PATCH v3 6/14 ppc/spapr: remove deprecated machine pseries-2.6

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.6 specific code with this patch for now.

---
 hw/ppc/spapr.c | 18 ------------------
 1 file changed, 18 deletions(-)
hw/ppc/spapr.c +0 -18
index f63843d107..a9c988b8f6 100644
@@ -5278,24 +5278,6 @@ static void spapr_machine_2_7_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(2, 7);
 
-/*
- * pseries-2.6
- */
-
-static void spapr_machine_2_6_class_options(MachineClass *mc)
-{
-    static GlobalProperty compat[] = {
-        { TYPE_SPAPR_PCI_HOST_BRIDGE, "ddw", "off" },
-    };
-
-    spapr_machine_2_7_class_options(mc);
-    mc->has_hotpluggable_cpus = false;
-    compat_props_add(mc->compat_props, hw_compat_2_6, hw_compat_2_6_len);
-    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_SPAPR_MACHINE(2, 6);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
#12 lore raw

PATCH v3 7/14 ppc/spapr: remove deprecated machine pseries-2.7

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.7 specific code with this patch for now.

While at it, also remove pre-2.8-migration and pci/mmio hacks introduced for backward compatibility.

---
 include/hw/pci-host/spapr.h |  4 --
 target/ppc/cpu.h            |  5 ---
 hw/ppc/spapr.c              | 75 -------------------------------------
 hw/ppc/spapr_pci.c          | 57 ++++------------------------
 target/ppc/cpu_init.c       |  1 -
 target/ppc/machine.c        | 52 -------------------------
 6 files changed, 7 insertions(+), 187 deletions(-)
include/hw/pci-host/spapr.h +0 -4
index 79187e80fd..0db87f1281 100644
@@ -83,10 +83,6 @@ struct SpaprPhbState {
     bool pcie_ecs; /* Allow access to PCIe extended config space? */
 
     /* Fields for migration compatibility hacks */
-    bool pre_2_8_migration;
-    uint32_t mig_liobn;
-    hwaddr mig_mem_win_addr, mig_mem_win_size;
-    hwaddr mig_io_win_addr, mig_io_win_size;
     bool pre_5_1_assoc;
 };
 
target/ppc/cpu.h +0 -5
index 321ed2da75..cab4a46fc1 100644
@@ -1456,11 +1456,6 @@ struct ArchCPU {
     opc_handler_t *opcodes[PPC_CPU_OPCODES_LEN];
 
     /* Fields related to migration compatibility hacks */
-    bool pre_2_8_migration;
-    target_ulong mig_msr_mask;
-    uint64_t mig_insns_flags;
-    uint64_t mig_insns_flags2;
-    uint32_t mig_nb_BATs;
     bool pre_2_10_migration;
     bool pre_3_0_migration;
     int32_t mig_slb_nr;
hw/ppc/spapr.c +0 -75

81 lines not on this page · raw message

hw/ppc/spapr_pci.c +7 -50

89 lines not on this page · raw message

target/ppc/cpu_init.c +0 -1
index 23881d09e9..7768392986 100644
@@ -7452,7 +7452,6 @@ static void ppc_disas_set_info(CPUState *cs, disassemble_info *info)
 }
 
 static Property ppc_cpu_properties[] = {
-    DEFINE_PROP_BOOL("pre-2.8-migration", PowerPCCPU, pre_2_8_migration, false),
     DEFINE_PROP_BOOL("pre-2.10-migration", PowerPCCPU, pre_2_10_migration,
                      false),
     DEFINE_PROP_BOOL("pre-3.0-migration", PowerPCCPU, pre_3_0_migration,
target/ppc/machine.c +0 -52

76 lines not on this page · raw message

Signature · 1 line
2.45.2
#13 lore raw

PATCH v3 8/14 ppc/spapr: remove deprecated machine pseries-2.8

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.8 specific code with this patch for now.

---
 hw/ppc/spapr.c | 18 ------------------
 1 file changed, 18 deletions(-)
hw/ppc/spapr.c +0 -18
index c89ab89b97..93decfcbeb 100644
@@ -5185,24 +5185,6 @@ static void spapr_machine_2_9_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(2, 9);
 
-/*
- * pseries-2.8
- */
-
-static void spapr_machine_2_8_class_options(MachineClass *mc)
-{
-    static GlobalProperty compat[] = {
-        { TYPE_SPAPR_PCI_HOST_BRIDGE, "pcie-extended-configuration-space", "off" },
-    };
-
-    spapr_machine_2_9_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_8, hw_compat_2_8_len);
-    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-    mc->numa_mem_align_shift = 23;
-}
-
-DEFINE_SPAPR_MACHINE(2, 8);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
#14 lore raw

PATCH v3 9/14 ppc/spapr: remove deprecated machine pseries-2.9

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.9 specific code with this patch for now.

While at it, also remove the pre-2.10 migration hacks which now become obsolete.

---
 include/hw/ppc/spapr.h |   1 -
 target/ppc/cpu.h       |   1 -
 hw/intc/xics.c         |  16 -------
 hw/ppc/spapr.c         | 104 -----------------------------------------
 migration/savevm.c     |  19 --------
 target/ppc/cpu_init.c  |   2 -
 target/ppc/machine.c   |   2 +-
 7 files changed, 1 insertion(+), 144 deletions(-)
include/hw/ppc/spapr.h +0 -1
index 6e9e62386c..af4aa1cb0f 100644
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
     /*< public >*/
     bool dr_phb_enabled;       /* enable dynamic-reconfig/hotplug of PHBs */
     bool update_dt_enabled;    /* enable KVMPPC_H_UPDATE_DT */
-    bool pre_2_10_has_unused_icps;
     bool legacy_irq_allocation;
     uint32_t nr_xirqs;
     bool broken_host_serial_model; /* present real host info to the guest */
target/ppc/cpu.h +0 -1
index cab4a46fc1..74a0ab768d 100644
@@ -1456,7 +1456,6 @@ struct ArchCPU {
     opc_handler_t *opcodes[PPC_CPU_OPCODES_LEN];
 
     /* Fields related to migration compatibility hacks */
-    bool pre_2_10_migration;
     bool pre_3_0_migration;
     int32_t mig_slb_nr;
 };
hw/intc/xics.c +0 -16
index 6f4d5271ea..e893363dc9 100644
@@ -335,22 +335,6 @@ static void icp_realize(DeviceState *dev, Error **errp)
             return;
         }
     }
-    /*
-     * The way that pre_2_10_icp is handling is really, really hacky.
-     * We used to have here this call:
-     *
-     * vmstate_register(NULL, icp->cs->cpu_index, &vmstate_icp_server, icp);
-     *
-     * But we were doing:
-     *     pre_2_10_vmstate_register_dummy_icp()
-     *     this vmstate_register()
-     *     pre_2_10_vmstate_unregister_dummy_icp()
-     *
-     * So for a short amount of time we had to vmstate entries with
-     * the same name.  This fixes it.
-     */
-    vmstate_replace_hack_for_ppc(NULL, icp->cs->cpu_index,
-                                 &vmstate_icp_server, icp);
 }
 
 static void icp_unrealize(DeviceState *dev)
hw/ppc/spapr.c +0 -104

149 lines not on this page · raw message

migration/savevm.c +0 -19
index 7e1e27182a..839a34402b 100644
@@ -860,25 +860,6 @@ static void vmstate_check(const VMStateDescription *vmsd)
     }
 }
 
-/*
- * See comment in hw/intc/xics.c:icp_realize()
- *
- * This function can be removed when
- * pre_2_10_vmstate_register_dummy_icp() is removed.
- */
-int vmstate_replace_hack_for_ppc(VMStateIf *obj, int instance_id,
-                                 const VMStateDescription *vmsd,
-                                 void *opaque)
-{
-    SaveStateEntry *se = find_se(vmsd->name, instance_id);
-
-    if (se) {
-        savevm_state_handler_remove(se);
-        g_free(se->compat);
-        g_free(se);
-    }
-    return vmstate_register(obj, instance_id, vmsd, opaque);
-}
 
 int vmstate_register_with_alias_id(VMStateIf *obj, uint32_t instance_id,
                                    const VMStateDescription *vmsd,
target/ppc/cpu_init.c +0 -2
index 7768392986..39c19e6674 100644
@@ -7452,8 +7452,6 @@ static void ppc_disas_set_info(CPUState *cs, disassemble_info *info)
 }
 
 static Property ppc_cpu_properties[] = {
-    DEFINE_PROP_BOOL("pre-2.10-migration", PowerPCCPU, pre_2_10_migration,
-                     false),
     DEFINE_PROP_BOOL("pre-3.0-migration", PowerPCCPU, pre_3_0_migration,
                      false),
     DEFINE_PROP_END_OF_LIST(),
target/ppc/machine.c +1 -1
index 21bed7c7c8..47495b68b1 100644
@@ -630,7 +630,7 @@ static bool compat_needed(void *opaque)
     PowerPCCPU *cpu = opaque;
 
     assert(!(cpu->compat_pvr && !cpu->vhyp));
-    return !cpu->pre_2_10_migration && cpu->compat_pvr != 0;
+    return cpu->compat_pvr != 0;
 }
 
 static const VMStateDescription vmstate_compat = {
Signature · 1 line
2.45.2
#15 lore raw

PATCH v3 10/14 ppc/spapr: remove deprecated machine pseries-2.10

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.10 specific code with this patch for now.

---
 hw/ppc/spapr.c | 12 ------------
 1 file changed, 12 deletions(-)
hw/ppc/spapr.c +0 -12
index 14a1314af6..4c76d2841c 100644
@@ -5069,18 +5069,6 @@ static void spapr_machine_2_11_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(2, 11);
 
-/*
- * pseries-2.10
- */
-
-static void spapr_machine_2_10_class_options(MachineClass *mc)
-{
-    spapr_machine_2_11_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_2_10, hw_compat_2_10_len);
-}
-
-DEFINE_SPAPR_MACHINE(2, 10);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
#16 lore raw

PATCH v3 11/14 ppc/spapr: remove deprecated machine pseries-2.11

In reply to Harsh Prateek Bora

Commit 1392617d3576 intended to tag pseries-2.1 - 2.11 machines as deprecated with reasons mentioned in its commit log. Removing pseries-2.11 specific code with this patch.

---
 hw/ppc/spapr.c | 15 ---------------
 1 file changed, 15 deletions(-)
hw/ppc/spapr.c +0 -15
index 4c76d2841c..faf88a177b 100644
@@ -5054,21 +5054,6 @@ static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE_TAGGED(2, 12, sxxm);
 
-/*
- * pseries-2.11
- */
-
-static void spapr_machine_2_11_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
-    spapr_machine_2_12_class_options(mc);
-    smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON;
-    compat_props_add(mc->compat_props, hw_compat_2_11, hw_compat_2_11_len);
-}
-
-DEFINE_SPAPR_MACHINE(2, 11);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
#17 lore raw

PATCH v3 12/14 ppc/spapr: remove deprecated machine pseries-2.12-sxxm

In reply to Harsh Prateek Bora

Commit 0cac0f1b964 marked pseries-2.12 machines as deprecated with reasons mentioned in its commit log.
Removing pseries-2.12-sxxm specific code with this patch.

---
 hw/ppc/spapr.c | 12 ------------
 1 file changed, 12 deletions(-)
hw/ppc/spapr.c +0 -12
index faf88a177b..9089134d07 100644
@@ -5042,18 +5042,6 @@ static void spapr_machine_2_12_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(2, 12);
 
-static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
-    spapr_machine_2_12_class_options(mc);
-    smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
-    smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
-    smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
-}
-
-DEFINE_SPAPR_MACHINE_TAGGED(2, 12, sxxm);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
Signature · 1 line
2.45.2
#18 lore raw

Re: [PATCH v3 12/14] ppc/spapr: remove deprecated machine pseries-2.12-sxxm

Quoted 19 lines · Harsh Prateek Bora

Commit 0cac0f1b964 marked pseries-2.12 machines as deprecated with reasons mentioned in its commit log.
Removing pseries-2.12-sxxm specific code with this patch.

---
  hw/ppc/spapr.c | 12 ------------
  1 file changed, 12 deletions(-)
hw/ppc/spapr.c +0 -1
index faf88a177b..9089134d07 100644
@@ -5042,18 +5042,6 @@ static void spapr_machine_2_12_class_options(MachineClass *mc)
 
  DEFINE_SPAPR_MACHINE(2, 12);
 
-static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc)

hw/ppc/spapr.c static void spapr_machine_2_12_class_options(MachineClass *mc) · line 5055

Quoted 10 lines
hw/ppc/spapr.c +0 -10
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
-    spapr_machine_2_12_class_options(mc);
-    smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
-    smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
-    smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
-}
-
-DEFINE_SPAPR_MACHINE_TAGGED(2, 12, sxxm);

I think macro DEFINE_SPAPR_MACHINE_TAGGED can be remove now.

Thanks,

C.

Quoted 4 lines
hw/ppc/spapr.c +0 -1
-
  static void spapr_machine_register_types(void)
  {
      type_register_static(&spapr_machine_info);
#19 lore raw

PATCH v3 13/14 ppc/spapr: remove deprecated machine pseries-2.12

In reply to Harsh Prateek Bora

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.

---
 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            | 16 ----------------
 7 files changed, 4 insertions(+), 65 deletions(-)
docs/about/deprecated.rst +0 -8
index 48b230b0a0..3b312a5de2 100644
@@ -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)
 ''''''''''''''''''''''''''''''''''''''''
 
include/hw/ppc/spapr_cpu_core.h +0 -1
index 69a52e39b8..68f7083483 100644
@@ -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 {
target/ppc/cpu.h +0 -4
index 74a0ab768d..506c8c825c 100644
@@ -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;
 };
 
 /**
hw/ppc/spapr.c +0 -25
index 9089134d07..f15467049a 100644
@@ -5017,31 +5017,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);
hw/ppc/spapr_cpu_core.c +3 -9
index 4642245168..1a84345f36 100644
@@ -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()
 };
 
target/ppc/cpu_init.c +1 -2
index 39c19e6674..011e53d961 100644
@@ -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(),
 };
 
target/ppc/machine.c +0 -16
index 47495b68b1..2738f429c9 100644
@@ -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;
 
@@ -508,7 +493,6 @@ static const VMStateDescription vmstate_slb = {
     .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()
     }
Signature · 1 line
2.45.2
#20 lore raw

Re: [PATCH v3 13/14] ppc/spapr: remove deprecated machine pseries-2.12

Quoted 186 lines · Harsh Prateek Bora

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.

---
  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            | 16 ----------------
  7 files changed, 4 insertions(+), 65 deletions(-)
docs/about/deprecated.rst +0 -8
index 48b230b0a0..3b312a5de2 100644
@@ -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)
  ''''''''''''''''''''''''''''''''''''''''
 
include/hw/ppc/spapr_cpu_core.h +0 -1
index 69a52e39b8..68f7083483 100644
@@ -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 {
target/ppc/cpu.h +0 -4
index 74a0ab768d..506c8c825c 100644
@@ -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;
  };
 
  /**
hw/ppc/spapr.c +0 -25
index 9089134d07..f15467049a 100644
@@ -5017,31 +5017,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);
hw/ppc/spapr_cpu_core.c +3 -9
index 4642245168..1a84345f36 100644
@@ -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()
  };
 
target/ppc/cpu_init.c +1 -2
index 39c19e6674..011e53d961 100644
@@ -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(),
  };
 
target/ppc/machine.c +0 -15
index 47495b68b1..2738f429c9 100644
@@ -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;
 

target/ppc/machine.c static const VMStateDescription vmstate_slb = { · line 498

Quoted 7 lines
target/ppc/machine.c +0 -1
@@ -508,7 +493,6 @@ static const VMStateDescription vmstate_slb = {
      .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()
      }

you should update the vmstate version too.

Thanks,

C.

#21 lore raw

PATCH v3 14/14 ppc/spapr: remove deprecated machine pseries-3.0

In reply to Harsh Prateek Bora

As per Qemu's deprecation policy [1], and the mailing list discussion that happened on [2], pseries-3.0 is more than 6 years old since release and therefore due for deletion as already deprecated for >3 years.

[1] https://www.qemu.org/docs/master/about/deprecated.html
[2] https://lore.kernel.org/qemu-devel/[email protected]/

While at it, also remove related legacy irq hacks which are now obsolete.

---
 include/hw/ppc/spapr.h     |  1 -
 include/hw/ppc/spapr_irq.h |  1 -
 hw/ppc/spapr.c             | 27 +--------------------------
 hw/ppc/spapr_events.c      |  8 --------
 hw/ppc/spapr_irq.c         | 16 +---------------
 hw/ppc/spapr_pci.c         | 32 ++++----------------------------
 hw/ppc/spapr_vio.c         |  9 ---------
 7 files changed, 6 insertions(+), 88 deletions(-)
include/hw/ppc/spapr.h +0 -1
index af4aa1cb0f..bac3f8561b 100644
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
     /*< public >*/
     bool dr_phb_enabled;       /* enable dynamic-reconfig/hotplug of PHBs */
     bool update_dt_enabled;    /* enable KVMPPC_H_UPDATE_DT */
-    bool legacy_irq_allocation;
     uint32_t nr_xirqs;
     bool broken_host_serial_model; /* present real host info to the guest */
     bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
include/hw/ppc/spapr_irq.h +0 -1
index cb9a85f657..5ddd1107c3 100644
@@ -100,7 +100,6 @@ typedef struct SpaprIrq {
 } SpaprIrq;
 
 extern SpaprIrq spapr_irq_xics;
-extern SpaprIrq spapr_irq_xics_legacy;
 extern SpaprIrq spapr_irq_xive;
 extern SpaprIrq spapr_irq_dual;
 
hw/ppc/spapr.c +1 -26
index f15467049a..8fa75ec541 100644
@@ -3312,9 +3312,7 @@ static char *spapr_get_ic_mode(Object *obj, Error **errp)
 {
     SpaprMachineState *spapr = SPAPR_MACHINE(obj);
 
-    if (spapr->irq == &spapr_irq_xics_legacy) {
-        return g_strdup("legacy");
-    } else if (spapr->irq == &spapr_irq_xics) {
+    if (spapr->irq == &spapr_irq_xics) {
         return g_strdup("xics");
     } else if (spapr->irq == &spapr_irq_xive) {
         return g_strdup("xive");
@@ -3328,11 +3326,6 @@ static void spapr_set_ic_mode(Object *obj, const char *value, Error **errp)
 {
     SpaprMachineState *spapr = SPAPR_MACHINE(obj);
 
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        error_setg(errp, "This machine only uses the legacy XICS backend, don't pass ic-mode");
-        return;
-    }
-
     /* The legacy IRQ backend can not be set */
     if (strcmp(value, "xics") == 0) {
         spapr->irq = &spapr_irq_xics;
@@ -4999,24 +4992,6 @@ static void spapr_machine_3_1_class_options(MachineClass *mc)
 
 DEFINE_SPAPR_MACHINE(3, 1);
 
-/*
- * pseries-3.0
- */
-
-static void spapr_machine_3_0_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
-    spapr_machine_3_1_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_3_0, hw_compat_3_0_len);
-
-    smc->legacy_irq_allocation = true;
-    smc->nr_xirqs = 0x400;
-    smc->irq = &spapr_irq_xics_legacy;
-}
-
-DEFINE_SPAPR_MACHINE(3, 0);
-
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
hw/ppc/spapr_events.c +0 -8
index 4dbf8e2e2e..12ae5bf57c 100644
@@ -1043,10 +1043,6 @@ void spapr_events_init(SpaprMachineState *spapr)
 {
     int epow_irq = SPAPR_IRQ_EPOW;
 
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        epow_irq = spapr_irq_findone(spapr, &error_fatal);
-    }
-
     spapr_irq_claim(spapr, epow_irq, false, &error_fatal);
 
     QTAILQ_INIT(&spapr->pending_events);
@@ -1067,10 +1063,6 @@ void spapr_events_init(SpaprMachineState *spapr)
     if (spapr->use_hotplug_event_source) {
         int hp_irq = SPAPR_IRQ_HOTPLUG;
 
-        if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-            hp_irq = spapr_irq_findone(spapr, &error_fatal);
-        }
-
         spapr_irq_claim(spapr, hp_irq, false, &error_fatal);
 
         spapr_event_sources_register(spapr->event_sources, EVENT_CLASS_HOT_PLUG,
hw/ppc/spapr_irq.c +1 -15
index aebd7eaabb..cb153651c3 100644
@@ -33,11 +33,6 @@ static const TypeInfo spapr_intc_info = {
 
 static void spapr_irq_msi_init(SpaprMachineState *spapr)
 {
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        /* Legacy mode doesn't use this allocator */
-        return;
-    }
-
     spapr->irq_map_nr = spapr_irq_nr_msis(spapr);
     spapr->irq_map = bitmap_new(spapr->irq_map_nr);
 }
@@ -286,11 +281,7 @@ uint32_t spapr_irq_nr_msis(SpaprMachineState *spapr)
 {
     SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
 
-    if (smc->legacy_irq_allocation) {
-        return smc->nr_xirqs;
-    } else {
-        return SPAPR_XIRQ_BASE + smc->nr_xirqs - SPAPR_IRQ_MSI;
-    }
+    return SPAPR_XIRQ_BASE + smc->nr_xirqs - SPAPR_IRQ_MSI;
 }
 
 void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
@@ -588,11 +579,6 @@ int spapr_irq_find(SpaprMachineState *spapr, int num, bool align, Error **errp)
     return first + ics->offset;
 }
 
-SpaprIrq spapr_irq_xics_legacy = {
-    .xics        = true,
-    .xive        = false,
-};
-
 static void spapr_irq_register_types(void)
 {
     type_register_static(&spapr_intc_info);
hw/ppc/spapr_pci.c +4 -28
index 7e24084673..c2bf89b2fd 100644
@@ -269,7 +269,6 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
                                 target_ulong args, uint32_t nret,
                                 target_ulong rets)
 {
-    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
     uint32_t config_addr = rtas_ld(args, 0);
     uint64_t buid = rtas_ldq(args, 1);
     unsigned int func = rtas_ld(args, 3);
@@ -374,13 +373,8 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
     }
 
     /* Allocate MSIs */
-    if (smc->legacy_irq_allocation) {
-        irq = spapr_irq_find(spapr, req_num, ret_intr_type == RTAS_TYPE_MSI,
-                             &err);
-    } else {
-        irq = spapr_irq_msi_alloc(spapr, req_num,
-                                  ret_intr_type == RTAS_TYPE_MSI, &err);
-    }
+    irq = spapr_irq_msi_alloc(spapr, req_num,
+                              ret_intr_type == RTAS_TYPE_MSI, &err);
     if (err) {
         error_reportf_err(err, "Can't allocate MSIs for device %x: ",
                           config_addr);
@@ -394,9 +388,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
             if (i) {
                 spapr_irq_free(spapr, irq, i);
             }
-            if (!smc->legacy_irq_allocation) {
-                spapr_irq_msi_free(spapr, irq, req_num);
-            }
+            spapr_irq_msi_free(spapr, irq, req_num);
             error_reportf_err(err, "Can't allocate MSIs for device %x: ",
                               config_addr);
             rtas_st(rets, 0, RTAS_OUT_HW_ERROR);
@@ -1776,12 +1768,9 @@ static void spapr_phb_unrealize(DeviceState *dev)
 static void spapr_phb_destroy_msi(gpointer opaque)
 {
     SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
-    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
     SpaprPciMsi *msi = opaque;
 
-    if (!smc->legacy_irq_allocation) {
-        spapr_irq_msi_free(spapr, msi->first_irq, msi->num);
-    }
+    spapr_irq_msi_free(spapr, msi->first_irq, msi->num);
     spapr_irq_free(spapr, msi->first_irq, msi->num);
     g_free(msi);
 }
@@ -1795,7 +1784,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
     SpaprMachineState *spapr =
         (SpaprMachineState *) object_dynamic_cast(qdev_get_machine(),
                                                   TYPE_SPAPR_MACHINE);
-    SpaprMachineClass *smc = spapr ? SPAPR_MACHINE_GET_CLASS(spapr) : NULL;
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
     SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(sbd);
     PCIHostState *phb = PCI_HOST_BRIDGE(sbd);
@@ -1943,18 +1931,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
     for (i = 0; i < PCI_NUM_PINS; i++) {
         int irq = SPAPR_IRQ_PCI_LSI + sphb->index * PCI_NUM_PINS + i;
 
-        if (smc->legacy_irq_allocation) {
-            irq = spapr_irq_findone(spapr, errp);
-            if (irq < 0) {
-                error_prepend(errp, "can't allocate LSIs: ");
-                /*
-                 * Older machines will never support PHB hotplug, ie, this is an
-                 * init only path and QEMU will terminate. No need to rollback.
-                 */
-                return;
-            }
-        }
-
         if (spapr_irq_claim(spapr, irq, true, errp) < 0) {
             error_prepend(errp, "can't allocate LSIs: ");
             goto unrealize;
hw/ppc/spapr_vio.c +0 -9
index 6a5a7f57c7..c9ce796f63 100644
@@ -507,15 +507,6 @@ static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
 
     dev->irq = spapr_vio_reg_to_irq(dev->reg);
 
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        int irq = spapr_irq_findone(spapr, errp);
-
-        if (irq < 0) {
-            return;
-        }
-        dev->irq = irq;
-    }
-
     if (spapr_irq_claim(spapr, dev->irq, false, errp) < 0) {
         return;
     }
Signature · 1 line
2.45.2
#22 lore raw

Re: [PATCH v3 14/14] ppc/spapr: remove deprecated machine pseries-3.0

Quoted 11 lines · Harsh Prateek Bora

As per Qemu's deprecation policy [1], and the mailing list discussion that happened on [2], pseries-3.0 is more than 6 years old since release and therefore due for deletion as already deprecated for >3 years.

[1] https://www.qemu.org/docs/master/about/deprecated.html
[2] https://lore.kernel.org/qemu-devel/[email protected]/

While at it, also remove related legacy irq hacks which are now obsolete.

I induced you in error. This version has not been deprecated yet.

We will have to wait a little longer (2 cycles) to remove it when the automatic deprecation process starts. See c9fd2d9a48ee. You can resend when the 10.1 cycle starts, around april 2025.

Thanks,

C.

Quoted 253 lines
---
  include/hw/ppc/spapr.h     |  1 -
  include/hw/ppc/spapr_irq.h |  1 -
  hw/ppc/spapr.c             | 27 +--------------------------
  hw/ppc/spapr_events.c      |  8 --------
  hw/ppc/spapr_irq.c         | 16 +---------------
  hw/ppc/spapr_pci.c         | 32 ++++----------------------------
  hw/ppc/spapr_vio.c         |  9 ---------
  7 files changed, 6 insertions(+), 88 deletions(-)
include/hw/ppc/spapr.h +0 -1
index af4aa1cb0f..bac3f8561b 100644
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
      /*< public >*/
      bool dr_phb_enabled;       /* enable dynamic-reconfig/hotplug of PHBs */
      bool update_dt_enabled;    /* enable KVMPPC_H_UPDATE_DT */
-    bool legacy_irq_allocation;
      uint32_t nr_xirqs;
      bool broken_host_serial_model; /* present real host info to the guest */
      bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
include/hw/ppc/spapr_irq.h +0 -1
index cb9a85f657..5ddd1107c3 100644
@@ -100,7 +100,6 @@ typedef struct SpaprIrq {
  } SpaprIrq;
 
  extern SpaprIrq spapr_irq_xics;
-extern SpaprIrq spapr_irq_xics_legacy;
  extern SpaprIrq spapr_irq_xive;
  extern SpaprIrq spapr_irq_dual;
 
hw/ppc/spapr.c +1 -26
index f15467049a..8fa75ec541 100644
@@ -3312,9 +3312,7 @@ static char *spapr_get_ic_mode(Object *obj, Error **errp)
  {
      SpaprMachineState *spapr = SPAPR_MACHINE(obj);
 
-    if (spapr->irq == &spapr_irq_xics_legacy) {
-        return g_strdup("legacy");
-    } else if (spapr->irq == &spapr_irq_xics) {
+    if (spapr->irq == &spapr_irq_xics) {
          return g_strdup("xics");
      } else if (spapr->irq == &spapr_irq_xive) {
          return g_strdup("xive");
@@ -3328,11 +3326,6 @@ static void spapr_set_ic_mode(Object *obj, const char *value, Error **errp)
  {
      SpaprMachineState *spapr = SPAPR_MACHINE(obj);
 
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        error_setg(errp, "This machine only uses the legacy XICS backend, don't pass ic-mode");
-        return;
-    }
-
      /* The legacy IRQ backend can not be set */
      if (strcmp(value, "xics") == 0) {
          spapr->irq = &spapr_irq_xics;
@@ -4999,24 +4992,6 @@ static void spapr_machine_3_1_class_options(MachineClass *mc)
 
  DEFINE_SPAPR_MACHINE(3, 1);
 
-/*
- * pseries-3.0
- */
-
-static void spapr_machine_3_0_class_options(MachineClass *mc)
-{
-    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
-    spapr_machine_3_1_class_options(mc);
-    compat_props_add(mc->compat_props, hw_compat_3_0, hw_compat_3_0_len);
-
-    smc->legacy_irq_allocation = true;
-    smc->nr_xirqs = 0x400;
-    smc->irq = &spapr_irq_xics_legacy;
-}
-
-DEFINE_SPAPR_MACHINE(3, 0);
-
  static void spapr_machine_register_types(void)
  {
      type_register_static(&spapr_machine_info);
hw/ppc/spapr_events.c +0 -8
index 4dbf8e2e2e..12ae5bf57c 100644
@@ -1043,10 +1043,6 @@ void spapr_events_init(SpaprMachineState *spapr)
  {
      int epow_irq = SPAPR_IRQ_EPOW;
 
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        epow_irq = spapr_irq_findone(spapr, &error_fatal);
-    }
-
      spapr_irq_claim(spapr, epow_irq, false, &error_fatal);
 
      QTAILQ_INIT(&spapr->pending_events);
@@ -1067,10 +1063,6 @@ void spapr_events_init(SpaprMachineState *spapr)
      if (spapr->use_hotplug_event_source) {
          int hp_irq = SPAPR_IRQ_HOTPLUG;
 
-        if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-            hp_irq = spapr_irq_findone(spapr, &error_fatal);
-        }
-
          spapr_irq_claim(spapr, hp_irq, false, &error_fatal);
 
          spapr_event_sources_register(spapr->event_sources, EVENT_CLASS_HOT_PLUG,
hw/ppc/spapr_irq.c +1 -15
index aebd7eaabb..cb153651c3 100644
@@ -33,11 +33,6 @@ static const TypeInfo spapr_intc_info = {
 
  static void spapr_irq_msi_init(SpaprMachineState *spapr)
  {
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        /* Legacy mode doesn't use this allocator */
-        return;
-    }
-
      spapr->irq_map_nr = spapr_irq_nr_msis(spapr);
      spapr->irq_map = bitmap_new(spapr->irq_map_nr);
  }
@@ -286,11 +281,7 @@ uint32_t spapr_irq_nr_msis(SpaprMachineState *spapr)
  {
      SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
 
-    if (smc->legacy_irq_allocation) {
-        return smc->nr_xirqs;
-    } else {
-        return SPAPR_XIRQ_BASE + smc->nr_xirqs - SPAPR_IRQ_MSI;
-    }
+    return SPAPR_XIRQ_BASE + smc->nr_xirqs - SPAPR_IRQ_MSI;
  }
 
  void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
@@ -588,11 +579,6 @@ int spapr_irq_find(SpaprMachineState *spapr, int num, bool align, Error **errp)
      return first + ics->offset;
  }
 
-SpaprIrq spapr_irq_xics_legacy = {
-    .xics        = true,
-    .xive        = false,
-};
-
  static void spapr_irq_register_types(void)
  {
      type_register_static(&spapr_intc_info);
hw/ppc/spapr_pci.c +4 -28
index 7e24084673..c2bf89b2fd 100644
@@ -269,7 +269,6 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
                                  target_ulong args, uint32_t nret,
                                  target_ulong rets)
  {
-    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
      uint32_t config_addr = rtas_ld(args, 0);
      uint64_t buid = rtas_ldq(args, 1);
      unsigned int func = rtas_ld(args, 3);
@@ -374,13 +373,8 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
      }
 
      /* Allocate MSIs */
-    if (smc->legacy_irq_allocation) {
-        irq = spapr_irq_find(spapr, req_num, ret_intr_type == RTAS_TYPE_MSI,
-                             &err);
-    } else {
-        irq = spapr_irq_msi_alloc(spapr, req_num,
-                                  ret_intr_type == RTAS_TYPE_MSI, &err);
-    }
+    irq = spapr_irq_msi_alloc(spapr, req_num,
+                              ret_intr_type == RTAS_TYPE_MSI, &err);
      if (err) {
          error_reportf_err(err, "Can't allocate MSIs for device %x: ",
                            config_addr);
@@ -394,9 +388,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
              if (i) {
                  spapr_irq_free(spapr, irq, i);
              }
-            if (!smc->legacy_irq_allocation) {
-                spapr_irq_msi_free(spapr, irq, req_num);
-            }
+            spapr_irq_msi_free(spapr, irq, req_num);
              error_reportf_err(err, "Can't allocate MSIs for device %x: ",
                                config_addr);
              rtas_st(rets, 0, RTAS_OUT_HW_ERROR);
@@ -1776,12 +1768,9 @@ static void spapr_phb_unrealize(DeviceState *dev)
  static void spapr_phb_destroy_msi(gpointer opaque)
  {
      SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
-    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
      SpaprPciMsi *msi = opaque;
 
-    if (!smc->legacy_irq_allocation) {
-        spapr_irq_msi_free(spapr, msi->first_irq, msi->num);
-    }
+    spapr_irq_msi_free(spapr, msi->first_irq, msi->num);
      spapr_irq_free(spapr, msi->first_irq, msi->num);
      g_free(msi);
  }
@@ -1795,7 +1784,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
      SpaprMachineState *spapr =
          (SpaprMachineState *) object_dynamic_cast(qdev_get_machine(),
                                                    TYPE_SPAPR_MACHINE);
-    SpaprMachineClass *smc = spapr ? SPAPR_MACHINE_GET_CLASS(spapr) : NULL;
      SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
      SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(sbd);
      PCIHostState *phb = PCI_HOST_BRIDGE(sbd);
@@ -1943,18 +1931,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
      for (i = 0; i < PCI_NUM_PINS; i++) {
          int irq = SPAPR_IRQ_PCI_LSI + sphb->index * PCI_NUM_PINS + i;
 
-        if (smc->legacy_irq_allocation) {
-            irq = spapr_irq_findone(spapr, errp);
-            if (irq < 0) {
-                error_prepend(errp, "can't allocate LSIs: ");
-                /*
-                 * Older machines will never support PHB hotplug, ie, this is an
-                 * init only path and QEMU will terminate. No need to rollback.
-                 */
-                return;
-            }
-        }
-
          if (spapr_irq_claim(spapr, irq, true, errp) < 0) {
              error_prepend(errp, "can't allocate LSIs: ");
              goto unrealize;
hw/ppc/spapr_vio.c +0 -9
index 6a5a7f57c7..c9ce796f63 100644
@@ -507,15 +507,6 @@ static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
 
      dev->irq = spapr_vio_reg_to_irq(dev->reg);
 
-    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-        int irq = spapr_irq_findone(spapr, errp);
-
-        if (irq < 0) {
-            return;
-        }
-        dev->irq = irq;
-    }
-
      if (spapr_irq_claim(spapr, dev->irq, false, errp) < 0) {
          return;
      }
#23 lore raw

Re: [PATCH v3 14/14] ppc/spapr: remove deprecated machine pseries-3.0

Hello Harsh,

Quoted 10 lines · Cédric Le Goater
Quoted 9 lines · Harsh Prateek Bora

As per Qemu's deprecation policy [1], and the mailing list discussion that happened on [2], pseries-3.0 is more than 6 years old since release and therefore due for deletion as already deprecated for >3 years.

[1] https://www.qemu.org/docs/master/about/deprecated.html
[2] https://lore.kernel.org/qemu-devel/[email protected]/

While at it, also remove related legacy irq hacks which are now obsolete.

Quoted 8 lines
Quoted 2 lines

I induced you in error. This version has not been deprecated yet.

We will have to wait a little longer (2 cycles) to remove it when the automatic deprecation process starts. See c9fd2d9a48ee. You can resend when the 10.1 cycle starts, around april 2025.

Machines pseries-3.0, 3.1 and 4.0 can now be removed.

Thanks,

C.

$ QEMU_DELETE_MACHINES=1 ./install/bin/qemu-system-ppc64 -machine ? | grep pseries
pseries-10.0         pSeries Logical Partition (PAPR compliant)
pseries              pSeries Logical Partition (PAPR compliant) (alias of pseries-10.1)
pseries-10.1         pSeries Logical Partition (PAPR compliant) (default)
pseries-4.1          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-4.2          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-5.0          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-5.1          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-5.2          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-6.0          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-6.1          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-6.2          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-7.0          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-7.1          pSeries Logical Partition (PAPR compliant)
pseries-7.2          pSeries Logical Partition (PAPR compliant)
pseries-8.0          pSeries Logical Partition (PAPR compliant)
pseries-8.1          pSeries Logical Partition (PAPR compliant)
pseries-8.2          pSeries Logical Partition (PAPR compliant)
pseries-9.0          pSeries Logical Partition (PAPR compliant)
pseries-9.1          pSeries Logical Partition (PAPR compliant)
pseries-9.2          pSeries Logical Partition (PAPR compliant)
#24 lore raw

Re: [PATCH v3 14/14] ppc/spapr: remove deprecated machine pseries-3.0

Hi Cedric,

Quoted 16 lines · Cédric Le Goater

Hello Harsh,

Quoted 13 lines · Cédric Le Goater
Quoted 11 lines · Harsh Prateek Bora

As per Qemu's deprecation policy [1], and the mailing list discussion that happened on [2], pseries-3.0 is more than 6 years old since release and therefore due for deletion as already deprecated for >3 years.

[1] https://www.qemu.org/docs/master/about/deprecated.html
[2] https://lore.kernel.org/qemu-devel/[email protected]/

While at it, also remove related legacy irq hacks which are now obsolete.

Quoted 7 lines
Quoted 5 lines

I induced you in error. This version has not been deprecated yet.

We will have to wait a little longer (2 cycles) to remove it when the automatic deprecation process starts. See c9fd2d9a48ee. You can resend when the 10.1 cycle starts, around april 2025.

Machines pseries-3.0, 3.1 and 4.0 can now be removed.

Sure, will look into it.

Thanks
Harsh

Quoted 27 lines

Thanks,

C.

$ QEMU_DELETE_MACHINES=1 ./install/bin/qemu-system-ppc64 -machine ? | grep pseries
pseries-10.0         pSeries Logical Partition (PAPR compliant)
pseries              pSeries Logical Partition (PAPR compliant) (alias of pseries-10.1)
pseries-10.1         pSeries Logical Partition (PAPR compliant) (default)
pseries-4.1          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-4.2          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-5.0          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-5.1          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-5.2          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-6.0          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-6.1          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-6.2          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-7.0          pSeries Logical Partition (PAPR compliant) (deprecated)
pseries-7.1          pSeries Logical Partition (PAPR compliant)
pseries-7.2          pSeries Logical Partition (PAPR compliant)
pseries-8.0          pSeries Logical Partition (PAPR compliant)
pseries-8.1          pSeries Logical Partition (PAPR compliant)
pseries-8.2          pSeries Logical Partition (PAPR compliant)
pseries-9.0          pSeries Logical Partition (PAPR compliant)
pseries-9.1          pSeries Logical Partition (PAPR compliant)
pseries-9.2          pSeries Logical Partition (PAPR compliant)