* [PATCH 1/8] hw/ppc/pnv_psi: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:22 ` Bin Meng
2026-11-30 6:08 ` [PATCH 2/8] hw/ppc/ppc4xx_devs: " Oscar Alejandro Sánchez Lucero
` (7 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface. Set phases.hold directly on
TYPE_PNV_PSI, and chain the parent hold phase via
resettable_class_set_parent_phases() in TYPE_PNV9_PSI.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/pnv_psi.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 39ec448..fbe8eb1 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -32,6 +32,7 @@
#include "hw/ppc/pnv.h"
#include "hw/ppc/pnv_xscom.h"
#include "hw/core/qdev-properties.h"
+#include "hw/core/resettable.h"
#include "hw/ppc/pnv_psi.h"
#include <libfdt.h>
@@ -446,9 +447,9 @@ static const MemoryRegionOps pnv_psi_xscom_ops = {
}
};
-static void pnv_psi_reset(DeviceState *dev)
+static void pnv_psi_reset_hold(Object *obj, ResetType type)
{
- PnvPsi *psi = PNV_PSI(dev);
+ PnvPsi *psi = PNV_PSI(obj);
memset(psi->regs, 0x0, sizeof(psi->regs));
@@ -839,11 +840,15 @@ static void pnv_psi_power9_set_irq(void *opaque, int irq, int state)
qemu_set_irq(psi->qirqs[irq], state);
}
-static void pnv_psi_power9_reset(DeviceState *dev)
+static ResettablePhases pnv_psi_power9_parent_phases;
+
+static void pnv_psi_power9_reset_hold(Object *obj, ResetType type)
{
- Pnv9Psi *psi = PNV9_PSI(dev);
+ Pnv9Psi *psi = PNV9_PSI(obj);
- pnv_psi_reset(dev);
+ if (pnv_psi_power9_parent_phases.hold) {
+ pnv_psi_power9_parent_phases.hold(obj, type);
+ }
if (memory_region_is_mapped(&psi->source.esb_mmio)) {
memory_region_del_subregion(get_system_memory(), &psi->source.esb_mmio);
@@ -899,9 +904,12 @@ static void pnv_psi_power9_class_init(ObjectClass *klass, const void *data)
XiveNotifierClass *xfc = XIVE_NOTIFIER_CLASS(klass);
static const char compat[] = "ibm,power9-psihb-x\0ibm,psihb-x";
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
+
dc->desc = "PowerNV PSI Controller POWER9";
dc->realize = pnv_psi_power9_realize;
- device_class_set_legacy_reset(dc, pnv_psi_power9_reset);
+ resettable_class_set_parent_phases(rc, NULL, pnv_psi_power9_reset_hold,
+ NULL, &pnv_psi_power9_parent_phases);
ppc->xscom_pcba = PNV9_XSCOM_PSIHB_BASE;
ppc->xscom_size = PNV9_XSCOM_PSIHB_SIZE;
@@ -983,9 +991,11 @@ static void pnv_psi_class_init(ObjectClass *klass, const void *data)
xdc->dt_xscom = pnv_psi_dt_xscom;
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
+
dc->desc = "PowerNV PSI Controller";
device_class_set_props(dc, pnv_psi_properties);
- device_class_set_legacy_reset(dc, pnv_psi_reset);
+ rc->phases.hold = pnv_psi_reset_hold;
dc->user_creatable = false;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 1/8] hw/ppc/pnv_psi: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 1/8] hw/ppc/pnv_psi: Convert " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:22 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:22 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:11 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface. Set phases.hold directly on
> TYPE_PNV_PSI, and chain the parent hold phase via
> resettable_class_set_parent_phases() in TYPE_PNV9_PSI.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/pnv_psi.c | 24 +++++++++++++++++-------
> 1 file changed, 17 insertions(+), 7 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/8] hw/ppc/ppc4xx_devs: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
2026-11-30 6:08 ` [PATCH 1/8] hw/ppc/pnv_psi: Convert " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:23 ` Bin Meng
2026-11-30 6:08 ` [PATCH 3/8] hw/ppc/ppc4xx_sdram: " Oscar Alejandro Sánchez Lucero
` (6 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface by setting phases.hold directly
on the PPC4xx MAL, PLB, and EBC DCR device models.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/ppc4xx_devs.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c
index ae1ac4f..4543dfd 100644
--- a/hw/ppc/ppc4xx_devs.c
+++ b/hw/ppc/ppc4xx_devs.c
@@ -26,6 +26,7 @@
#include "target/ppc/cpu.h"
#include "hw/ppc/ppc4xx.h"
#include "hw/core/qdev-properties.h"
+#include "hw/core/resettable.h"
#include "qapi/error.h"
/*****************************************************************************/
@@ -49,9 +50,9 @@ enum {
MAL0_RCBS1 = 0x1E1,
};
-static void ppc4xx_mal_reset(DeviceState *dev)
+static void ppc4xx_mal_reset_hold(Object *obj, ResetType type)
{
- Ppc4xxMalState *mal = PPC4xx_MAL(dev);
+ Ppc4xxMalState *mal = PPC4xx_MAL(obj);
mal->cfg = 0x0007C000;
mal->esr = 0x00000000;
@@ -127,7 +128,7 @@ static void dcr_write_mal(void *opaque, int dcrn, uint32_t val)
switch (dcrn) {
case MAL0_CFG:
if (val & 0x80000000) {
- ppc4xx_mal_reset(DEVICE(mal));
+ ppc4xx_mal_reset_hold(OBJECT(mal), RESET_TYPE_COLD);
}
mal->cfg = val & 0x00FFC087;
break;
@@ -240,8 +241,10 @@ static void ppc4xx_mal_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ ResettableClass *rc = RESETTABLE_CLASS(oc);
+
dc->realize = ppc4xx_mal_realize;
- device_class_set_legacy_reset(dc, ppc4xx_mal_reset);
+ rc->phases.hold = ppc4xx_mal_reset_hold;
/* Reason: only works as function of a ppc4xx SoC */
dc->user_creatable = false;
device_class_set_props(dc, ppc4xx_mal_properties);
@@ -304,9 +307,9 @@ static void dcr_write_plb(void *opaque, int dcrn, uint32_t val)
}
}
-static void ppc405_plb_reset(DeviceState *dev)
+static void ppc405_plb_reset_hold(Object *obj, ResetType type)
{
- Ppc4xxPlbState *plb = PPC4xx_PLB(dev);
+ Ppc4xxPlbState *plb = PPC4xx_PLB(obj);
plb->acr = 0x00000000;
plb->bear = 0x00000000;
@@ -330,8 +333,10 @@ static void ppc405_plb_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ ResettableClass *rc = RESETTABLE_CLASS(oc);
+
dc->realize = ppc405_plb_realize;
- device_class_set_legacy_reset(dc, ppc405_plb_reset);
+ rc->phases.hold = ppc405_plb_reset_hold;
/* Reason: only works as function of a ppc4xx SoC */
dc->user_creatable = false;
}
@@ -486,9 +491,9 @@ static void dcr_write_ebc(void *opaque, int dcrn, uint32_t val)
}
}
-static void ppc405_ebc_reset(DeviceState *dev)
+static void ppc405_ebc_reset_hold(Object *obj, ResetType type)
{
- Ppc4xxEbcState *ebc = PPC4xx_EBC(dev);
+ Ppc4xxEbcState *ebc = PPC4xx_EBC(obj);
int i;
ebc->addr = 0x00000000;
@@ -516,8 +521,10 @@ static void ppc405_ebc_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ ResettableClass *rc = RESETTABLE_CLASS(oc);
+
dc->realize = ppc405_ebc_realize;
- device_class_set_legacy_reset(dc, ppc405_ebc_reset);
+ rc->phases.hold = ppc405_ebc_reset_hold;
/* Reason: only works as function of a ppc4xx SoC */
dc->user_creatable = false;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 2/8] hw/ppc/ppc4xx_devs: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 2/8] hw/ppc/ppc4xx_devs: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:23 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:23 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:11 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface by setting phases.hold directly
> on the PPC4xx MAL, PLB, and EBC DCR device models.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/ppc4xx_devs.c | 27 +++++++++++++++++----------
> 1 file changed, 17 insertions(+), 10 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/8] hw/ppc/ppc4xx_sdram: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
2026-11-30 6:08 ` [PATCH 1/8] hw/ppc/pnv_psi: Convert " Oscar Alejandro Sánchez Lucero
2026-11-30 6:08 ` [PATCH 2/8] hw/ppc/ppc4xx_devs: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:24 ` Bin Meng
2026-11-30 6:08 ` [PATCH 4/8] hw/ppc/ppce500_spin: " Oscar Alejandro Sánchez Lucero
` (5 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface by setting phases.hold directly
on the PPC4xx DDR and DDR2 SDRAM controller models.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/ppc4xx_sdram.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/ppc4xx_sdram.c b/hw/ppc/ppc4xx_sdram.c
index b2c8f96..59015ee 100644
--- a/hw/ppc/ppc4xx_sdram.c
+++ b/hw/ppc/ppc4xx_sdram.c
@@ -37,6 +37,7 @@
#include "system/address-spaces.h" /* get_system_memory() */
#include "hw/core/irq.h"
#include "hw/core/qdev-properties.h"
+#include "hw/core/resettable.h"
#include "hw/ppc/ppc4xx.h"
#include "trace.h"
@@ -364,9 +365,9 @@ static void sdram_ddr_dcr_write(void *opaque, int dcrn, uint32_t val)
}
}
-static void ppc4xx_sdram_ddr_reset(DeviceState *dev)
+static void ppc4xx_sdram_ddr_reset_hold(Object *obj, ResetType type)
{
- Ppc4xxSdramDdrState *s = PPC4xx_SDRAM_DDR(dev);
+ Ppc4xxSdramDdrState *s = PPC4xx_SDRAM_DDR(obj);
s->addr = 0;
s->bear = 0;
@@ -435,8 +436,10 @@ static void ppc4xx_sdram_ddr_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ ResettableClass *rc = RESETTABLE_CLASS(oc);
+
dc->realize = ppc4xx_sdram_ddr_realize;
- device_class_set_legacy_reset(dc, ppc4xx_sdram_ddr_reset);
+ rc->phases.hold = ppc4xx_sdram_ddr_reset_hold;
/* Reason: only works as function of a ppc4xx SoC */
dc->user_creatable = false;
device_class_set_props(dc, ppc4xx_sdram_ddr_props);
@@ -636,9 +639,9 @@ static void sdram_ddr2_dcr_write(void *opaque, int dcrn, uint32_t val)
}
}
-static void ppc4xx_sdram_ddr2_reset(DeviceState *dev)
+static void ppc4xx_sdram_ddr2_reset_hold(Object *obj, ResetType type)
{
- Ppc4xxSdramDdr2State *s = PPC4xx_SDRAM_DDR2(dev);
+ Ppc4xxSdramDdr2State *s = PPC4xx_SDRAM_DDR2(obj);
s->addr = 0;
s->mcopt2 = 0;
@@ -719,8 +722,10 @@ static void ppc4xx_sdram_ddr2_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ ResettableClass *rc = RESETTABLE_CLASS(oc);
+
dc->realize = ppc4xx_sdram_ddr2_realize;
- device_class_set_legacy_reset(dc, ppc4xx_sdram_ddr2_reset);
+ rc->phases.hold = ppc4xx_sdram_ddr2_reset_hold;
/* Reason: only works as function of a ppc4xx SoC */
dc->user_creatable = false;
device_class_set_props(dc, ppc4xx_sdram_ddr2_props);
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 3/8] hw/ppc/ppc4xx_sdram: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 3/8] hw/ppc/ppc4xx_sdram: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:24 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:24 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:11 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface by setting phases.hold directly
> on the PPC4xx DDR and DDR2 SDRAM controller models.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/ppc4xx_sdram.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/8] hw/ppc/ppce500_spin: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
` (2 preceding siblings ...)
2026-11-30 6:08 ` [PATCH 3/8] hw/ppc/ppc4xx_sdram: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:25 ` Bin Meng
2026-11-30 6:08 ` [PATCH 5/8] hw/ppc/spapr_cpu_core: " Oscar Alejandro Sánchez Lucero
` (4 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface by setting phases.hold directly,
as TYPE_SYS_BUS_DEVICE does not implement a parent reset method.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/ppce500_spin.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
index 85bdcac..6f25b9d 100644
--- a/hw/ppc/ppce500_spin.c
+++ b/hw/ppc/ppce500_spin.c
@@ -31,6 +31,7 @@
#include "qemu/module.h"
#include "qemu/units.h"
#include "hw/core/hw-error.h"
+#include "hw/core/resettable.h"
#include "hw/core/sysbus.h"
#include "system/hw_accel.h"
#include "hw/ppc/ppc.h"
@@ -57,9 +58,9 @@ struct SpinState {
SpinInfo spin[MAX_CPUS];
};
-static void spin_reset(DeviceState *dev)
+static void spin_reset_hold(Object *obj, ResetType type)
{
- SpinState *s = E500_SPIN(dev);
+ SpinState *s = E500_SPIN(obj);
int i;
for (i = 0; i < MAX_CPUS; i++) {
@@ -176,9 +177,9 @@ static void ppce500_spin_initfn(Object *obj)
static void ppce500_spin_class_init(ObjectClass *klass, const void *data)
{
- DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
- device_class_set_legacy_reset(dc, spin_reset);
+ rc->phases.hold = spin_reset_hold;
}
static const TypeInfo ppce500_spin_info = {
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 4/8] hw/ppc/ppce500_spin: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 4/8] hw/ppc/ppce500_spin: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:25 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:25 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:12 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface by setting phases.hold directly,
> as TYPE_SYS_BUS_DEVICE does not implement a parent reset method.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/ppce500_spin.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 5/8] hw/ppc/spapr_cpu_core: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
` (3 preceding siblings ...)
2026-11-30 6:08 ` [PATCH 4/8] hw/ppc/ppce500_spin: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:25 ` Bin Meng
2026-11-30 6:08 ` [PATCH 6/8] hw/ppc/spapr_iommu: " Oscar Alejandro Sánchez Lucero
` (3 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface by setting phases.hold directly,
as TYPE_CPU_CORE does not implement a parent reset method.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/spapr_cpu_core.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 9a93519..9096e8d 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -11,6 +11,7 @@
#include "hw/cpu/core.h"
#include "hw/ppc/spapr_cpu_core.h"
#include "hw/core/qdev-properties.h"
+#include "hw/core/resettable.h"
#include "migration/vmstate.h"
#include "target/ppc/cpu.h"
#include "hw/ppc/spapr.h"
@@ -212,10 +213,10 @@ static void spapr_unrealize_vcpu(PowerPCCPU *cpu, SpaprCpuCore *sc)
/*
* Called when CPUs are hot-plugged.
*/
-static void spapr_cpu_core_reset(DeviceState *dev)
+static void spapr_cpu_core_reset_hold(Object *obj, ResetType type)
{
- CPUCore *cc = CPU_CORE(dev);
- SpaprCpuCore *sc = SPAPR_CPU_CORE(dev);
+ CPUCore *cc = CPU_CORE(obj);
+ SpaprCpuCore *sc = SPAPR_CPU_CORE(obj);
int i;
for (i = 0; i < cc->nr_threads; i++) {
@@ -228,7 +229,7 @@ static void spapr_cpu_core_reset(DeviceState *dev)
*/
static void spapr_cpu_core_reset_handler(void *opaque)
{
- spapr_cpu_core_reset(opaque);
+ spapr_cpu_core_reset_hold(OBJECT(opaque), RESET_TYPE_COLD);
}
static void spapr_delete_vcpu(PowerPCCPU *cpu)
@@ -378,9 +379,11 @@ static void spapr_cpu_core_class_init(ObjectClass *oc, const void *data)
DeviceClass *dc = DEVICE_CLASS(oc);
SpaprCpuCoreClass *scc = SPAPR_CPU_CORE_CLASS(oc);
+ ResettableClass *rc = RESETTABLE_CLASS(oc);
+
dc->realize = spapr_cpu_core_realize;
dc->unrealize = spapr_cpu_core_unrealize;
- device_class_set_legacy_reset(dc, spapr_cpu_core_reset);
+ rc->phases.hold = spapr_cpu_core_reset_hold;
device_class_set_props(dc, spapr_cpu_core_properties);
scc->cpu_type = data;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 5/8] hw/ppc/spapr_cpu_core: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 5/8] hw/ppc/spapr_cpu_core: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:25 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:25 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:12 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface by setting phases.hold directly,
> as TYPE_CPU_CORE does not implement a parent reset method.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/spapr_cpu_core.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/8] hw/ppc/spapr_iommu: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
` (4 preceding siblings ...)
2026-11-30 6:08 ` [PATCH 5/8] hw/ppc/spapr_cpu_core: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:26 ` Bin Meng
2026-11-30 6:08 ` [PATCH 7/8] hw/ppc/spapr_pci: " Oscar Alejandro Sánchez Lucero
` (2 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface by setting phases.hold directly,
as TYPE_DEVICE does not implement a parent reset method.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/spapr_iommu.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 5470602..211dd53 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -21,6 +21,7 @@
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "hw/core/resettable.h"
#include "system/kvm.h"
#include "system/qtest.h"
#include "exec/target_page.h"
@@ -445,9 +446,9 @@ MemoryRegion *spapr_tce_get_iommu(SpaprTceTable *tcet)
return &tcet->root;
}
-static void spapr_tce_reset(DeviceState *dev)
+static void spapr_tce_reset_hold(Object *obj, ResetType type)
{
- SpaprTceTable *tcet = SPAPR_TCE_TABLE(dev);
+ SpaprTceTable *tcet = SPAPR_TCE_TABLE(obj);
size_t table_size = tcet->nb_table * sizeof(uint64_t);
if (tcet->nb_table) {
@@ -679,8 +680,9 @@ int spapr_tcet_dma_dt(void *fdt, int node_off, const char *propname,
static void spapr_tce_table_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
dc->realize = spapr_tce_table_realize;
- device_class_set_legacy_reset(dc, spapr_tce_reset);
+ rc->phases.hold = spapr_tce_reset_hold;
dc->unrealize = spapr_tce_table_unrealize;
/* Reason: This is just an internal device for handling the hypercalls */
dc->user_creatable = false;
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 6/8] hw/ppc/spapr_iommu: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 6/8] hw/ppc/spapr_iommu: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:26 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:26 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:11 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface by setting phases.hold directly,
> as TYPE_DEVICE does not implement a parent reset method.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/spapr_iommu.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 7/8] hw/ppc/spapr_pci: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
` (5 preceding siblings ...)
2026-11-30 6:08 ` [PATCH 6/8] hw/ppc/spapr_iommu: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:26 ` Bin Meng
2026-11-30 6:08 ` [PATCH 8/8] hw/ppc/spapr_vio: " Oscar Alejandro Sánchez Lucero
2026-11-30 15:14 ` [PATCH 0/8] hw/ppc: Convert remaining PPC devices " BALATON Zoltan
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface by setting phases.hold directly,
as TYPE_PCI_HOST_BRIDGE does not implement a parent reset method.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/spapr_pci.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index ea323fa..837253d 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -26,6 +26,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "hw/core/irq.h"
+#include "hw/core/resettable.h"
#include "hw/core/sysbus.h"
#include "migration/vmstate.h"
#include "hw/pci/pci.h"
@@ -2006,17 +2007,17 @@ void spapr_phb_dma_reset(SpaprPhbState *sphb)
tcet->def_win = true;
}
-static void spapr_phb_reset(DeviceState *qdev)
+static void spapr_phb_reset_hold(Object *obj, ResetType type)
{
- SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(qdev);
+ SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(obj);
spapr_phb_dma_reset(sphb);
/* Reset the IOMMU state */
- object_child_foreach(OBJECT(qdev), spapr_phb_children_reset, NULL);
+ object_child_foreach(obj, spapr_phb_children_reset, NULL);
- if (spapr_phb_eeh_available(SPAPR_PCI_HOST_BRIDGE(qdev))) {
- spapr_phb_vfio_reset(qdev);
+ if (spapr_phb_eeh_available(sphb)) {
+ spapr_phb_vfio_reset(DEVICE(obj));
}
g_hash_table_remove_all(sphb->msi);
@@ -2152,12 +2153,13 @@ static void spapr_phb_class_init(ObjectClass *klass, const void *data)
PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
HotplugHandlerClass *hp = HOTPLUG_HANDLER_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
hc->root_bus_path = spapr_phb_root_bus_path;
dc->realize = spapr_phb_realize;
dc->unrealize = spapr_phb_unrealize;
device_class_set_props(dc, spapr_phb_properties);
- device_class_set_legacy_reset(dc, spapr_phb_reset);
+ rc->phases.hold = spapr_phb_reset_hold;
dc->vmsd = &vmstate_spapr_pci;
/* Supported by TYPE_SPAPR_MACHINE */
dc->user_creatable = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 7/8] hw/ppc/spapr_pci: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 7/8] hw/ppc/spapr_pci: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:26 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:26 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:11 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface by setting phases.hold directly,
> as TYPE_PCI_HOST_BRIDGE does not implement a parent reset method.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/spapr_pci.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 8/8] hw/ppc/spapr_vio: Convert to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
` (6 preceding siblings ...)
2026-11-30 6:08 ` [PATCH 7/8] hw/ppc/spapr_pci: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 6:08 ` Oscar Alejandro Sánchez Lucero
2026-12-01 12:26 ` Bin Meng
2026-11-30 15:14 ` [PATCH 0/8] hw/ppc: Convert remaining PPC devices " BALATON Zoltan
8 siblings, 1 reply; 20+ messages in thread
From: Oscar Alejandro Sánchez Lucero @ 2026-11-30 6:08 UTC (permalink / raw)
To: qemu-devel
Cc: Nicholas Piggin, Aditya Gupta, Glenn Miles, Harsh Prateek Bora,
qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Oscar Alejandro Sánchez Lucero
Replace the deprecated device_class_set_legacy_reset() with the
three-phase ResettableClass interface by setting phases.hold directly,
as TYPE_DEVICE does not implement a parent reset method.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/ppc/spapr_vio.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index 3f05081..ffcff1c 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -26,6 +26,7 @@
#include "qemu/log.h"
#include "hw/core/loader.h"
#include "elf.h"
+#include "hw/core/resettable.h"
#include "hw/core/sysbus.h"
#include "system/kvm.h"
#include "system/device_tree.h"
@@ -402,9 +403,9 @@ static SpaprVioDevice *reg_conflict(SpaprVioDevice *dev)
return 0;
}
-static void spapr_vio_busdev_reset(DeviceState *qdev)
+static void spapr_vio_busdev_reset_hold(Object *obj, ResetType type)
{
- SpaprVioDevice *dev = VIO_SPAPR_DEVICE(qdev);
+ SpaprVioDevice *dev = VIO_SPAPR_DEVICE(obj);
SpaprVioDeviceClass *pc = VIO_SPAPR_DEVICE_GET_CLASS(dev);
/* Shut down the request queue and TCEs if necessary */
@@ -625,8 +626,9 @@ const VMStateDescription vmstate_spapr_vio = {
static void vio_spapr_device_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *k = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
k->realize = spapr_vio_busdev_realize;
- device_class_set_legacy_reset(k, spapr_vio_busdev_reset);
+ rc->phases.hold = spapr_vio_busdev_reset_hold;
k->bus_type = TYPE_SPAPR_VIO_BUS;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 8/8] hw/ppc/spapr_vio: Convert to Resettable interface
2026-11-30 6:08 ` [PATCH 8/8] hw/ppc/spapr_vio: " Oscar Alejandro Sánchez Lucero
@ 2026-12-01 12:26 ` Bin Meng
0 siblings, 0 replies; 20+ messages in thread
From: Bin Meng @ 2026-12-01 12:26 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal
On Mon, Nov 30, 2026 at 2:11 PM Oscar Alejandro Sánchez Lucero
<aleszlucero@gmail.com> wrote:
>
> Replace the deprecated device_class_set_legacy_reset() with the
> three-phase ResettableClass interface by setting phases.hold directly,
> as TYPE_DEVICE does not implement a parent reset method.
>
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> hw/ppc/spapr_vio.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface
2026-11-30 6:08 [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface Oscar Alejandro Sánchez Lucero
` (7 preceding siblings ...)
2026-11-30 6:08 ` [PATCH 8/8] hw/ppc/spapr_vio: " Oscar Alejandro Sánchez Lucero
@ 2026-11-30 15:14 ` BALATON Zoltan
2026-11-30 15:27 ` Alejandro Lucero
8 siblings, 1 reply; 20+ messages in thread
From: BALATON Zoltan @ 2026-11-30 15:14 UTC (permalink / raw)
To: Oscar Alejandro Sánchez Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Peter Maydell
[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]
On Mon, 30 Nov 2026, Oscar Alejandro Sánchez Lucero wrote:
> This series converts the remaining PowerPC device models in hw/ppc/
> (pnv_psi, ppc4xx_devs, ppc4xx_sdram, ppce500_spin, spapr_cpu_core,
> spapr_iommu, spapr_pci, and spapr_vio) from the deprecated
> device_class_set_legacy_reset() to the three-phase ResettableClass
> interface.
How is this different than what do_legacy_reset does calling a single
reset function at hold phase? While device_class_set_legacy_reset is
called legacy it does not mean it's deprecated for simple devices which
does not need multi-phase reset. Is there anything that this conversion is
needed for that cannot be done in do_legacy_reset keeping
device_class_set_legacy_reset as a convenience function for devices that
don't need multi-phase reset and avoid all this churn? If you're bothered
by the name it could be renamed to device_class_set_simple_reset or
device_class_set_reset_hold but that probably isn't worth the churn
either.
Regards,
BALATON Zoltan
> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> ---
> Oscar Alejandro Sánchez Lucero (8):
> hw/ppc/pnv_psi: Convert to Resettable interface
> hw/ppc/ppc4xx_devs: Convert to Resettable interface
> hw/ppc/ppc4xx_sdram: Convert to Resettable interface
> hw/ppc/ppce500_spin: Convert to Resettable interface
> hw/ppc/spapr_cpu_core: Convert to Resettable interface
> hw/ppc/spapr_iommu: Convert to Resettable interface
> hw/ppc/spapr_pci: Convert to Resettable interface
> hw/ppc/spapr_vio: Convert to Resettable interface
>
> hw/ppc/pnv_psi.c | 24 +++++++++++++++++-------
> hw/ppc/ppc4xx_devs.c | 27 +++++++++++++++++----------
> hw/ppc/ppc4xx_sdram.c | 17 +++++++++++------
> hw/ppc/ppce500_spin.c | 9 +++++----
> hw/ppc/spapr_cpu_core.c | 13 ++++++++-----
> hw/ppc/spapr_iommu.c | 8 +++++---
> hw/ppc/spapr_pci.c | 14 ++++++++------
> hw/ppc/spapr_vio.c | 8 +++++---
> 8 files changed, 76 insertions(+), 44 deletions(-)
> ---
> base-commit: 9751c62358073580cbf330a4df22077a7c6a407c
> change-id: 20261130-ppc-resettable-d073d385443e
>
> Best regards,
> --
> Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
>
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface
2026-11-30 15:14 ` [PATCH 0/8] hw/ppc: Convert remaining PPC devices " BALATON Zoltan
@ 2026-11-30 15:27 ` Alejandro Lucero
2026-11-30 16:14 ` BALATON Zoltan
0 siblings, 1 reply; 20+ messages in thread
From: Alejandro Lucero @ 2026-11-30 15:27 UTC (permalink / raw)
To: BALATON Zoltan
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Peter Maydell
Hi Zoltan,
In docs/devel/reset.rst ("Converting devices to Resettable") and the
doc comment in include/hw/core/qdev.h, device_class_set_legacy_reset()
is explicitly marked as deprecated and intended only as a temporary
compatibility wrapper while migrating existing devices to
ResettableClass.
The goal of converting the remaining devices is to eventually drop
legacy_reset and do_legacy_reset() from DeviceClass once no callers
remain in the tree, leaving a single consistent reset mechanism across
all devices.
Regards,
Alejandro
El lun, 30 nov 2026 a la(s) 9:14 a.m., BALATON Zoltan
(balaton@eik.bme.hu) escribió:
>
> On Mon, 30 Nov 2026, Oscar Alejandro Sánchez Lucero wrote:
> > This series converts the remaining PowerPC device models in hw/ppc/
> > (pnv_psi, ppc4xx_devs, ppc4xx_sdram, ppce500_spin, spapr_cpu_core,
> > spapr_iommu, spapr_pci, and spapr_vio) from the deprecated
> > device_class_set_legacy_reset() to the three-phase ResettableClass
> > interface.
>
> How is this different than what do_legacy_reset does calling a single
> reset function at hold phase? While device_class_set_legacy_reset is
> called legacy it does not mean it's deprecated for simple devices which
> does not need multi-phase reset. Is there anything that this conversion is
> needed for that cannot be done in do_legacy_reset keeping
> device_class_set_legacy_reset as a convenience function for devices that
> don't need multi-phase reset and avoid all this churn? If you're bothered
> by the name it could be renamed to device_class_set_simple_reset or
> device_class_set_reset_hold but that probably isn't worth the churn
> either.
>
> Regards,
> BALATON Zoltan
>
> > Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> > ---
> > Oscar Alejandro Sánchez Lucero (8):
> > hw/ppc/pnv_psi: Convert to Resettable interface
> > hw/ppc/ppc4xx_devs: Convert to Resettable interface
> > hw/ppc/ppc4xx_sdram: Convert to Resettable interface
> > hw/ppc/ppce500_spin: Convert to Resettable interface
> > hw/ppc/spapr_cpu_core: Convert to Resettable interface
> > hw/ppc/spapr_iommu: Convert to Resettable interface
> > hw/ppc/spapr_pci: Convert to Resettable interface
> > hw/ppc/spapr_vio: Convert to Resettable interface
> >
> > hw/ppc/pnv_psi.c | 24 +++++++++++++++++-------
> > hw/ppc/ppc4xx_devs.c | 27 +++++++++++++++++----------
> > hw/ppc/ppc4xx_sdram.c | 17 +++++++++++------
> > hw/ppc/ppce500_spin.c | 9 +++++----
> > hw/ppc/spapr_cpu_core.c | 13 ++++++++-----
> > hw/ppc/spapr_iommu.c | 8 +++++---
> > hw/ppc/spapr_pci.c | 14 ++++++++------
> > hw/ppc/spapr_vio.c | 8 +++++---
> > 8 files changed, 76 insertions(+), 44 deletions(-)
> > ---
> > base-commit: 9751c62358073580cbf330a4df22077a7c6a407c
> > change-id: 20261130-ppc-resettable-d073d385443e
> >
> > Best regards,
> > --
> > Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
> >
> >
> >
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH 0/8] hw/ppc: Convert remaining PPC devices to Resettable interface
2026-11-30 15:27 ` Alejandro Lucero
@ 2026-11-30 16:14 ` BALATON Zoltan
0 siblings, 0 replies; 20+ messages in thread
From: BALATON Zoltan @ 2026-11-30 16:14 UTC (permalink / raw)
To: Alejandro Lucero
Cc: qemu-devel, Nicholas Piggin, Aditya Gupta, Glenn Miles,
Harsh Prateek Bora, qemu-ppc, Bernhard Beschow, Amit Machhiwal,
Peter Maydell
[-- Attachment #1: Type: text/plain, Size: 4124 bytes --]
On Mon, 30 Nov 2026, Alejandro Lucero wrote:
> Hi Zoltan,
>
> In docs/devel/reset.rst ("Converting devices to Resettable") and the
Thanks for clarifying. I don't see such section or mention of this in
reset.rst in master. Are we looking at the same version?
> doc comment in include/hw/core/qdev.h, device_class_set_legacy_reset()
> is explicitly marked as deprecated and intended only as a temporary
> compatibility wrapper while migrating existing devices to
> ResettableClass.
There's indeed a comment but revising the comment is always an option too
if we change our minds.
> The goal of converting the remaining devices is to eventually drop
> legacy_reset and do_legacy_reset() from DeviceClass once no callers
> remain in the tree, leaving a single consistent reset mechanism across
> all devices.
My concern is that there are a lot of simple devices that don't need to
care about multi-phase reset and this brings unneeded complexity to them.
It would be simpler if there was a simple function to set the reset
function of a simple device without having to know about Resettable unless
necessary. All in all this conversion introduces more lines than it
removes so I'm not sure it's an improvement. We could consider converting
the DeviceReset functions to ResettableHoldPhase type and and have a
device_class_set_reset_hold convenience function to get rid of DeviceReset
legacy_reset in DeviceClass but keeping Resettable hidden from simple
devices. But maybe that's not much less lines than open coding it so if
nobody else cares I can accept this change but I don't like the additional
complexity it brings.
Regards,
BALATON Zoltan
> Regards,
> Alejandro
>
> El lun, 30 nov 2026 a la(s) 9:14 a.m., BALATON Zoltan
> (balaton@eik.bme.hu) escribió:
>>
>> On Mon, 30 Nov 2026, Oscar Alejandro Sánchez Lucero wrote:
>>> This series converts the remaining PowerPC device models in hw/ppc/
>>> (pnv_psi, ppc4xx_devs, ppc4xx_sdram, ppce500_spin, spapr_cpu_core,
>>> spapr_iommu, spapr_pci, and spapr_vio) from the deprecated
>>> device_class_set_legacy_reset() to the three-phase ResettableClass
>>> interface.
>>
>> How is this different than what do_legacy_reset does calling a single
>> reset function at hold phase? While device_class_set_legacy_reset is
>> called legacy it does not mean it's deprecated for simple devices which
>> does not need multi-phase reset. Is there anything that this conversion is
>> needed for that cannot be done in do_legacy_reset keeping
>> device_class_set_legacy_reset as a convenience function for devices that
>> don't need multi-phase reset and avoid all this churn? If you're bothered
>> by the name it could be renamed to device_class_set_simple_reset or
>> device_class_set_reset_hold but that probably isn't worth the churn
>> either.
>>
>> Regards,
>> BALATON Zoltan
>>
>>> Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
>>> ---
>>> Oscar Alejandro Sánchez Lucero (8):
>>> hw/ppc/pnv_psi: Convert to Resettable interface
>>> hw/ppc/ppc4xx_devs: Convert to Resettable interface
>>> hw/ppc/ppc4xx_sdram: Convert to Resettable interface
>>> hw/ppc/ppce500_spin: Convert to Resettable interface
>>> hw/ppc/spapr_cpu_core: Convert to Resettable interface
>>> hw/ppc/spapr_iommu: Convert to Resettable interface
>>> hw/ppc/spapr_pci: Convert to Resettable interface
>>> hw/ppc/spapr_vio: Convert to Resettable interface
>>>
>>> hw/ppc/pnv_psi.c | 24 +++++++++++++++++-------
>>> hw/ppc/ppc4xx_devs.c | 27 +++++++++++++++++----------
>>> hw/ppc/ppc4xx_sdram.c | 17 +++++++++++------
>>> hw/ppc/ppce500_spin.c | 9 +++++----
>>> hw/ppc/spapr_cpu_core.c | 13 ++++++++-----
>>> hw/ppc/spapr_iommu.c | 8 +++++---
>>> hw/ppc/spapr_pci.c | 14 ++++++++------
>>> hw/ppc/spapr_vio.c | 8 +++++---
>>> 8 files changed, 76 insertions(+), 44 deletions(-)
>>> ---
>>> base-commit: 9751c62358073580cbf330a4df22077a7c6a407c
>>> change-id: 20261130-ppc-resettable-d073d385443e
>>>
>>> Best regards,
>>> --
>>> Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
>>>
>>>
>>>
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread