* [PULL 00/10] ppc-for-11.0 queue
@ 2026-01-12 10:34 Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 01/10] target/ppc/kvm : Use macro names instead of hardcoded constants as return values Harsh Prateek Bora
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel
The following changes since commit b254e486242466dad881fc2bbfa215f1b67cd30f:
Merge tag 'pull-riscv-to-apply-20260109' of https://github.com/alistair23/qemu into staging (2026-01-10 10:31:57 +1100)
are available in the Git repository at:
https://gitlab.com/harshpb/qemu.git tags/pull-ppc-for-11.0-20260112
for you to fetch changes up to f4e34d0fd56c25dd0c90722ed80a83a175160a6c:
tests/functional: Add a OS level migration test for pseries (2026-01-12 15:34:04 +0530)
----------------------------------------------------------------
First PPC PR for 11.0
- Snapshot support for several ppc devices
- Migration fix and OS level migration test for pseries
- Minor code cleanups
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEa4EM1tK+EPOIPSFCRUTplPnWj7sFAmlky2YACgkQRUTplPnW
j7vXUg/8Dx/nsygeDspmhlmvqEWjyXm3fjIGnyCtSZWSkDkhh1x+uc0khFLuG8in
1Ep2D4qkGDBrdv079WzDKJDhgH21gTApA92xUsJFof2LLgN+MZOgi2Im6wR+Prtr
EddB7jJ062fDDyMQWBdg+9jkl0+xuj+JE5JXPbXV0Fqu+t3rVJvn7c1b3uRXRrC9
hgiss0xgTpXdVGnVjsQYLr3+iJ5Qcd7+6UhtRzTgv7S02IJRjpVoHSayBnKmzG9r
eLqQMykyqU8drmQUruTk1nM2PRbaGTuRO+Swcld7SgqxOxxYIXD72f89B94kZKqM
qZKv/C03EP30wS7/zJMwWsIEuXKM/oUwXl4i5C5eRUIa637VjcFEhuj0fCd8qxmz
mUp6tVTYaGESpWUJA9TLZOkvLO9c4gumbTWa5valYeRWCLdXFQZgDg0wrwu7SL5M
vdzKdnTMozkkKIY0W2Gk5j6E6aHpcGvNxREGrtI1BEUGKtGVzPjMHZmYDormSLIz
lvgZj7JEncjkGv6uIYKMv1tT7Cbo2YxoGRWbx59PWpK9Ekl8307BMi2OtPYqZm7N
CKS0lK+OM8CUP7Ao4nwxzH+T6X+C88Ivjt31sS25ixdUK6+Wy8tCEK2XCwA8gxjH
QuBMDYMoAWgZ+mQITNy+HrqM1TBI8a4PiF9DjX2xj3sdyBd67F8=
=2zBL
-----END PGP SIGNATURE-----
----------------------------------------------------------------
Caleb Schlossin (7):
hw/ppc: Add VMSTATE information for LPC model
hw/ppc: Add pnv_spi vmstate support
hw/ppc: Add pnv_i2c vmstate support
hw/ppc: pnv_adu.c added vmstate support
hw/ppc: pnv_core.c add vmstate support
hw/ppc: pnv_chiptod.c add vmstate support
hw/ppc: Add VMSTATE information to PnvPsi
Fabiano Rosas (2):
target/ppc: Fix env->quiesced migration
tests/functional: Add a OS level migration test for pseries
Gautam Menghani (1):
target/ppc/kvm : Use macro names instead of hardcoded constants as return values
include/hw/ppc/pnv_chiptod.h | 2 ++
target/ppc/cpu.h | 1 +
hw/ppc/pnv_adu.c | 12 +++++++
hw/ppc/pnv_chiptod.c | 38 ++++++++++++++++++++
hw/ppc/pnv_core.c | 22 ++++++++++++
hw/ppc/pnv_i2c.c | 11 ++++++
hw/ppc/pnv_lpc.c | 41 +++++++++++++++++++++
hw/ppc/pnv_psi.c | 36 +++++++++++++++++--
hw/ppc/spapr.c | 6 ++++
hw/ssi/pnv_spi.c | 27 ++++++++++++++
target/ppc/cpu_init.c | 7 ++++
target/ppc/kvm.c | 18 +++++-----
target/ppc/machine.c | 62 ++++++++++++++++++++++++++++++++
tests/functional/ppc64/test_migration.py | 12 +++++++
tests/functional/ppc64/test_pseries.py | 35 ++++++++++++++++++
15 files changed, 319 insertions(+), 11 deletions(-)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PULL 01/10] target/ppc/kvm : Use macro names instead of hardcoded constants as return values
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 02/10] hw/ppc: Add VMSTATE information for LPC model Harsh Prateek Bora
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Gautam Menghani, Chinmay Rath
From: Gautam Menghani <gautam@linux.ibm.com>
In the parse_* functions used to parse the return values of
KVM_PPC_GET_CPU_CHAR ioctl, the return values are hardcoded as numbers.
Use the macro names for better readability. No functional change
intended.
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251202124654.11481-1-gautam@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
target/ppc/kvm.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 1521787b3f..41bd03ec2a 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2450,26 +2450,26 @@ static int parse_cap_ppc_safe_cache(struct kvm_ppc_cpu_char c)
bool l1d_thread_priv_req = !kvmppc_power8_host();
if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_L1D_FLUSH_PR) {
- return 2;
+ return SPAPR_CAP_FIXED;
} else if ((!l1d_thread_priv_req ||
c.character & c.character_mask & H_CPU_CHAR_L1D_THREAD_PRIV) &&
(c.character & c.character_mask
& (H_CPU_CHAR_L1D_FLUSH_ORI30 | H_CPU_CHAR_L1D_FLUSH_TRIG2))) {
- return 1;
+ return SPAPR_CAP_WORKAROUND;
}
- return 0;
+ return SPAPR_CAP_BROKEN;
}
static int parse_cap_ppc_safe_bounds_check(struct kvm_ppc_cpu_char c)
{
if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR) {
- return 2;
+ return SPAPR_CAP_FIXED;
} else if (c.character & c.character_mask & H_CPU_CHAR_SPEC_BAR_ORI31) {
- return 1;
+ return SPAPR_CAP_WORKAROUND;
}
- return 0;
+ return SPAPR_CAP_BROKEN;
}
static int parse_cap_ppc_safe_indirect_branch(struct kvm_ppc_cpu_char c)
@@ -2486,15 +2486,15 @@ static int parse_cap_ppc_safe_indirect_branch(struct kvm_ppc_cpu_char c)
return SPAPR_CAP_FIXED_IBS;
}
- return 0;
+ return SPAPR_CAP_BROKEN;
}
static int parse_cap_ppc_count_cache_flush_assist(struct kvm_ppc_cpu_char c)
{
if (c.character & c.character_mask & H_CPU_CHAR_BCCTR_FLUSH_ASSIST) {
- return 1;
+ return SPAPR_CAP_WORKAROUND;
}
- return 0;
+ return SPAPR_CAP_BROKEN;
}
bool kvmppc_has_cap_xive(void)
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 02/10] hw/ppc: Add VMSTATE information for LPC model
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 01/10] target/ppc/kvm : Use macro names instead of hardcoded constants as return values Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 03/10] hw/ppc: Add pnv_spi vmstate support Harsh Prateek Bora
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Caleb Schlossin, Michael Kowal, Aditya Gupta, Chalapathi V
From: Caleb Schlossin <calebs@linux.ibm.com>
The PNV LPC model needs snapshot/migration support. Added a VMSTATE
descriptor to save model data and an associated post_load() method.
Snapshot support added for Power8, Power9, and Power10.
Signed-off-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-2-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ppc/pnv_lpc.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
index 3b65c12316..d1357dd359 100644
--- a/hw/ppc/pnv_lpc.c
+++ b/hw/ppc/pnv_lpc.c
@@ -30,6 +30,7 @@
#include "hw/ppc/pnv_lpc.h"
#include "hw/ppc/pnv_xscom.h"
#include "hw/ppc/fdt.h"
+#include "migration/vmstate.h"
#include <libfdt.h>
@@ -696,6 +697,43 @@ static const MemoryRegionOps opb_master_ops = {
},
};
+static int vmstate_pnv_lpc_post_load(void *opaque, int version_id)
+{
+ PnvLpcController *lpc = PNV_LPC(opaque);
+
+ memory_region_set_alias_offset(&lpc->opb_isa_fw,
+ lpc->lpc_hc_fw_seg_idsel * LPC_FW_OPB_SIZE);
+ pnv_lpc_eval_serirq_routes(lpc);
+
+ pnv_lpc_eval_irqs(lpc);
+ return 0;
+}
+
+static const VMStateDescription vmstate_pnv_lpc = {
+ .name = TYPE_PNV_LPC,
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .post_load = vmstate_pnv_lpc_post_load,
+ .fields = (const VMStateField[]) {
+ VMSTATE_UINT64(eccb_stat_reg, PnvLpcController),
+ VMSTATE_UINT32(eccb_data_reg, PnvLpcController),
+ VMSTATE_UINT32(opb_irq_route0, PnvLpcController),
+ VMSTATE_UINT32(opb_irq_route1, PnvLpcController),
+ VMSTATE_UINT32(opb_irq_stat, PnvLpcController),
+ VMSTATE_UINT32(opb_irq_mask, PnvLpcController),
+ VMSTATE_UINT32(opb_irq_pol, PnvLpcController),
+ VMSTATE_UINT32(opb_irq_input, PnvLpcController),
+ VMSTATE_UINT32(lpc_hc_irq_inputs, PnvLpcController),
+ VMSTATE_UINT32(lpc_hc_fw_seg_idsel, PnvLpcController),
+ VMSTATE_UINT32(lpc_hc_irqser_ctrl, PnvLpcController),
+ VMSTATE_UINT32(lpc_hc_irqmask, PnvLpcController),
+ VMSTATE_UINT32(lpc_hc_irqstat, PnvLpcController),
+ VMSTATE_UINT32(lpc_hc_error_addr, PnvLpcController),
+ VMSTATE_UINT32(lpc_hc_fw_rd_acc_size, PnvLpcController),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static void pnv_lpc_power8_realize(DeviceState *dev, Error **errp)
{
PnvLpcController *lpc = PNV_LPC(dev);
@@ -721,6 +759,7 @@ static void pnv_lpc_power8_class_init(ObjectClass *klass, const void *data)
PnvLpcClass *plc = PNV_LPC_CLASS(klass);
dc->desc = "PowerNV LPC Controller POWER8";
+ dc->vmsd = &vmstate_pnv_lpc;
xdc->dt_xscom = pnv_lpc_dt_xscom;
@@ -766,6 +805,7 @@ static void pnv_lpc_power9_class_init(ObjectClass *klass, const void *data)
PnvLpcClass *plc = PNV_LPC_CLASS(klass);
dc->desc = "PowerNV LPC Controller POWER9";
+ dc->vmsd = &vmstate_pnv_lpc;
device_class_set_parent_realize(dc, pnv_lpc_power9_realize,
&plc->parent_realize);
@@ -782,6 +822,7 @@ static void pnv_lpc_power10_class_init(ObjectClass *klass, const void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->desc = "PowerNV LPC Controller POWER10";
+ dc->vmsd = &vmstate_pnv_lpc;
}
static const TypeInfo pnv_lpc_power10_info = {
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 03/10] hw/ppc: Add pnv_spi vmstate support
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 01/10] target/ppc/kvm : Use macro names instead of hardcoded constants as return values Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 02/10] hw/ppc: Add VMSTATE information for LPC model Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 04/10] hw/ppc: Add pnv_i2c " Harsh Prateek Bora
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Caleb Schlossin, Michael Kowal, Aditya Gupta, Chalapathi V
From: Caleb Schlossin <calebs@linux.ibm.com>
- Add support for needed PnvSpi structure variables
Reviewed-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-3-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ssi/pnv_spi.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c
index 1cf3a4416d..76304d26fc 100644
--- a/hw/ssi/pnv_spi.c
+++ b/hw/ssi/pnv_spi.c
@@ -13,6 +13,7 @@
#include "hw/ssi/pnv_spi.h"
#include "hw/ssi/pnv_spi_regs.h"
#include "hw/ssi/ssi.h"
+#include "migration/vmstate.h"
#include <libfdt.h>
#include "hw/core/irq.h"
#include "trace.h"
@@ -1199,6 +1200,31 @@ static int pnv_spi_dt_xscom(PnvXScomInterface *dev, void *fdt,
return 0;
}
+static const VMStateDescription pnv_spi_vmstate = {
+ .name = TYPE_PNV_SPI,
+ .version_id = 1,
+ .fields = (const VMStateField[]) {
+ VMSTATE_UINT8(fail_count, PnvSpi),
+ VMSTATE_UINT8(transfer_len, PnvSpi),
+ VMSTATE_UINT8(responder_select, PnvSpi),
+ VMSTATE_BOOL(shift_n1_done, PnvSpi),
+ VMSTATE_UINT8(loop_counter_1, PnvSpi),
+ VMSTATE_UINT8(loop_counter_2, PnvSpi),
+ VMSTATE_UINT8(N1_bits, PnvSpi),
+ VMSTATE_UINT8(N2_bits, PnvSpi),
+ VMSTATE_UINT8(N1_bytes, PnvSpi),
+ VMSTATE_UINT8(N2_bytes, PnvSpi),
+ VMSTATE_UINT8(N1_tx, PnvSpi),
+ VMSTATE_UINT8(N2_tx, PnvSpi),
+ VMSTATE_UINT8(N1_rx, PnvSpi),
+ VMSTATE_UINT8(N2_rx, PnvSpi),
+ VMSTATE_UINT64_ARRAY(regs, PnvSpi, PNV_SPI_REGS),
+ VMSTATE_UINT8_ARRAY(seq_op, PnvSpi, PNV_SPI_REG_SIZE),
+ VMSTATE_UINT64(status, PnvSpi),
+ VMSTATE_END_OF_LIST(),
+ },
+};
+
static void pnv_spi_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -1209,6 +1235,7 @@ static void pnv_spi_class_init(ObjectClass *klass, const void *data)
dc->desc = "PowerNV SPI";
dc->realize = pnv_spi_realize;
device_class_set_legacy_reset(dc, do_reset);
+ dc->vmsd = &pnv_spi_vmstate;
device_class_set_props(dc, pnv_spi_properties);
}
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 04/10] hw/ppc: Add pnv_i2c vmstate support
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (2 preceding siblings ...)
2026-01-12 10:34 ` [PULL 03/10] hw/ppc: Add pnv_spi vmstate support Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 05/10] hw/ppc: pnv_adu.c added " Harsh Prateek Bora
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel
Cc: Caleb Schlossin, Michael Kowal, Aditya Gupta, Chalapathi V,
Glenn Miles
From: Caleb Schlossin <calebs@linux.ibm.com>
- Add vmstate support for i2c registers
Reviewed-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-4-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ppc/pnv_i2c.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
index c8e90c636f..60f7164a1c 100644
--- a/hw/ppc/pnv_i2c.c
+++ b/hw/ppc/pnv_i2c.c
@@ -19,6 +19,7 @@
#include "hw/ppc/pnv_i2c.h"
#include "hw/ppc/pnv_xscom.h"
#include "hw/ppc/fdt.h"
+#include "migration/vmstate.h"
#include <libfdt.h>
@@ -549,6 +550,15 @@ static const Property pnv_i2c_properties[] = {
DEFINE_PROP_UINT32("num-busses", PnvI2C, num_busses, 1),
};
+static const VMStateDescription pnv_i2c_vmstate = {
+ .name = TYPE_PNV_I2C,
+ .version_id = 1,
+ .fields = (const VMStateField[]) {
+ VMSTATE_UINT64_ARRAY(regs, PnvI2C, PNV_I2C_REGS),
+ VMSTATE_END_OF_LIST(),
+ },
+};
+
static void pnv_i2c_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -561,6 +571,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, const void *data)
dc->desc = "PowerNV I2C";
dc->realize = pnv_i2c_realize;
+ dc->vmsd = &pnv_i2c_vmstate;
device_class_set_props(dc, pnv_i2c_properties);
}
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 05/10] hw/ppc: pnv_adu.c added vmstate support
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (3 preceding siblings ...)
2026-01-12 10:34 ` [PULL 04/10] hw/ppc: Add pnv_i2c " Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 06/10] hw/ppc: pnv_core.c add " Harsh Prateek Bora
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel
Cc: Caleb Schlossin, Angelo Jaramillo, Michael Kowal, Aditya Gupta,
Chalapathi V, Glenn Miles
From: Caleb Schlossin <calebs@linux.ibm.com>
- Added vmstate support for ADU model
Signed-off-by: Angelo Jaramillo <angelo.jaramillo@linux.ibm.com>
Reviewed-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-5-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ppc/pnv_adu.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/ppc/pnv_adu.c b/hw/ppc/pnv_adu.c
index d686bfa62d..f921a7bcbf 100644
--- a/hw/ppc/pnv_adu.c
+++ b/hw/ppc/pnv_adu.c
@@ -23,6 +23,7 @@
#include "hw/ppc/pnv_chip.h"
#include "hw/ppc/pnv_lpc.h"
#include "hw/ppc/pnv_xscom.h"
+#include "migration/vmstate.h"
#include "trace.h"
#define ADU_LPC_BASE_REG 0x40
@@ -189,6 +190,16 @@ static const Property pnv_adu_properties[] = {
DEFINE_PROP_LINK("lpc", PnvADU, lpc, TYPE_PNV_LPC, PnvLpcController *),
};
+static const VMStateDescription pnv_adu_vmstate = {
+ .name = TYPE_PNV_ADU,
+ .version_id = 1,
+ .fields = (const VMStateField[]) {
+ VMSTATE_UINT64(lpc_cmd_reg, PnvADU),
+ VMSTATE_UINT64(lpc_data_reg, PnvADU),
+ VMSTATE_END_OF_LIST(),
+ },
+};
+
static void pnv_adu_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -197,6 +208,7 @@ static void pnv_adu_class_init(ObjectClass *klass, const void *data)
dc->desc = "PowerNV ADU";
device_class_set_props(dc, pnv_adu_properties);
dc->user_creatable = false;
+ dc->vmsd = &pnv_adu_vmstate;
}
static const TypeInfo pnv_adu_type_info = {
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 06/10] hw/ppc: pnv_core.c add vmstate support
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (4 preceding siblings ...)
2026-01-12 10:34 ` [PULL 05/10] hw/ppc: pnv_adu.c added " Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 07/10] hw/ppc: pnv_chiptod.c " Harsh Prateek Bora
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel
Cc: Caleb Schlossin, Angelo Jaramillo, Glenn Miles, Aditya Gupta,
Chalapathi V
From: Caleb Schlossin <calebs@linux.ibm.com>
- Add vmstate support PnvCore and PnvQuad capturing scratch
registers and special wakeup registers
Signed-off-by: Angelo Jaramillo <angelo.jaramillo@linux.ibm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-6-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ppc/pnv_core.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
index 59a9eee597..8939515c2c 100644
--- a/hw/ppc/pnv_core.c
+++ b/hw/ppc/pnv_core.c
@@ -31,6 +31,7 @@
#include "hw/ppc/xics.h"
#include "hw/core/qdev-properties.h"
#include "helper_regs.h"
+#include "migration/vmstate.h"
static const char *pnv_core_cpu_typename(PnvCore *pc)
{
@@ -478,6 +479,15 @@ static void pnv_core_power11_class_init(ObjectClass *oc, const void *data)
pnv_core_power10_class_init(oc, data);
}
+static const VMStateDescription pnv_core_vmstate = {
+ .name = TYPE_PNV_CORE,
+ .version_id = 1,
+ .fields = (const VMStateField[]) {
+ VMSTATE_UINT64_ARRAY(scratch, PnvCore, 8),
+ VMSTATE_END_OF_LIST(),
+ },
+};
+
static void pnv_core_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
@@ -486,6 +496,7 @@ static void pnv_core_class_init(ObjectClass *oc, const void *data)
dc->unrealize = pnv_core_unrealize;
device_class_set_props(dc, pnv_core_properties);
dc->user_creatable = false;
+ dc->vmsd = &pnv_core_vmstate;
}
#define DEFINE_PNV_CORE_TYPE(family, cpu_model) \
@@ -737,12 +748,23 @@ static void pnv_quad_power11_class_init(ObjectClass *oc, const void *data)
pnv_quad_power10_class_init(oc, data);
}
+static const VMStateDescription pnv_quad_vmstate = {
+ .name = TYPE_PNV_QUAD,
+ .version_id = 1,
+ .fields = (const VMStateField[]) {
+ VMSTATE_BOOL(special_wakeup_done, PnvQuad),
+ VMSTATE_BOOL_ARRAY(special_wakeup, PnvQuad, 4),
+ VMSTATE_END_OF_LIST(),
+ },
+};
+
static void pnv_quad_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
device_class_set_props(dc, pnv_quad_properties);
dc->user_creatable = false;
+ dc->vmsd = &pnv_quad_vmstate;
}
static const TypeInfo pnv_quad_infos[] = {
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 07/10] hw/ppc: pnv_chiptod.c add vmstate support
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (5 preceding siblings ...)
2026-01-12 10:34 ` [PULL 06/10] hw/ppc: pnv_core.c add " Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 08/10] hw/ppc: Add VMSTATE information to PnvPsi Harsh Prateek Bora
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel
Cc: Caleb Schlossin, Angelo Jaramillo, Michael Kowal, Aditya Gupta,
Chalapathi V, Glenn Miles
From: Caleb Schlossin <calebs@linux.ibm.com>
- Added pre_save and post_load methods to handle slave_pc_target and tod_state
Signed-off-by: Angelo Jaramillo <angelo.jaramillo@linux.ibm.com>
Reviewed-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-7-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
include/hw/ppc/pnv_chiptod.h | 2 ++
hw/ppc/pnv_chiptod.c | 38 ++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/include/hw/ppc/pnv_chiptod.h b/include/hw/ppc/pnv_chiptod.h
index 466b06560a..3e5e3b02b2 100644
--- a/include/hw/ppc/pnv_chiptod.h
+++ b/include/hw/ppc/pnv_chiptod.h
@@ -41,6 +41,8 @@ struct PnvChipTOD {
uint64_t tod_error;
uint64_t pss_mss_ctrl_reg;
PnvCore *slave_pc_target;
+ uint64_t tx_ttype_ctrl;
+ uint8_t tod_state_val;
};
struct PnvChipTODClass {
diff --git a/hw/ppc/pnv_chiptod.c b/hw/ppc/pnv_chiptod.c
index 09a5a52ac7..bcf9b615a4 100644
--- a/hw/ppc/pnv_chiptod.c
+++ b/hw/ppc/pnv_chiptod.c
@@ -37,6 +37,7 @@
#include "hw/ppc/pnv_core.h"
#include "hw/ppc/pnv_xscom.h"
#include "hw/ppc/pnv_chiptod.h"
+#include "migration/vmstate.h"
#include "trace.h"
#include <libfdt.h>
@@ -341,6 +342,8 @@ static void pnv_chiptod_xscom_write(void *opaque, hwaddr addr,
" TOD_TX_TTYPE_CTRL_REG val 0x%" PRIx64
" invalid slave address\n", val);
}
+ /* Write slave_pc_target to a uint64_t variable for vmstate support. */
+ chiptod->tx_ttype_ctrl = val;
break;
case TOD_ERROR_REG:
chiptod->tod_error &= ~val;
@@ -613,6 +616,40 @@ static void pnv_chiptod_unrealize(DeviceState *dev)
qemu_unregister_reset(pnv_chiptod_reset, chiptod);
}
+static int vmstate_pnv_chiptod_pre_save(void *opaque)
+{
+ PnvChipTOD *chiptod = PNV_CHIPTOD(opaque);
+ chiptod->tod_state_val = (uint8_t)chiptod->tod_state;
+ return 0;
+}
+
+static int vmstate_pnv_chiptod_post_load(void *opaque)
+{
+ PnvChipTOD *chiptod = PNV_CHIPTOD(opaque);
+ if (chiptod->tx_ttype_ctrl != 0) {
+ pnv_chiptod_xscom_write(chiptod, TOD_TX_TTYPE_CTRL_REG << 3,
+ chiptod->tx_ttype_ctrl, 8);
+ }
+ chiptod->tod_state = (enum tod_state)chiptod->tod_state_val;
+ return 0;
+}
+
+static const VMStateDescription pnv_chiptod_vmstate = {
+ .name = TYPE_PNV_CHIPTOD,
+ .version_id = 1,
+ .pre_save = vmstate_pnv_chiptod_pre_save,
+ .pre_load = vmstate_pnv_chiptod_post_load,
+ .fields = (const VMStateField[]) {
+ VMSTATE_BOOL(primary, PnvChipTOD),
+ VMSTATE_BOOL(secondary, PnvChipTOD),
+ VMSTATE_UINT64(tod_error, PnvChipTOD),
+ VMSTATE_UINT64(pss_mss_ctrl_reg, PnvChipTOD),
+ VMSTATE_UINT64(tx_ttype_ctrl, PnvChipTOD),
+ VMSTATE_UINT8(tod_state_val, PnvChipTOD),
+ VMSTATE_END_OF_LIST(),
+ },
+};
+
static void pnv_chiptod_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -621,6 +658,7 @@ static void pnv_chiptod_class_init(ObjectClass *klass, const void *data)
dc->unrealize = pnv_chiptod_unrealize;
dc->desc = "PowerNV ChipTOD Controller";
dc->user_creatable = false;
+ dc->vmsd = &pnv_chiptod_vmstate;
}
static const TypeInfo pnv_chiptod_type_info = {
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 08/10] hw/ppc: Add VMSTATE information to PnvPsi
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (6 preceding siblings ...)
2026-01-12 10:34 ` [PULL 07/10] hw/ppc: pnv_chiptod.c " Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 09/10] target/ppc: Fix env->quiesced migration Harsh Prateek Bora
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel
Cc: Caleb Schlossin, Michael Kowal, Aditya Gupta, Chalapathi V,
Glenn Miles
From: Caleb Schlossin <calebs@linux.ibm.com>
PnvPsi needs to be able to save/load snapshots. Add VMSTATE information
to the device class and a post_load() method to restore dynamic data items and
memory region mappings.
Signed-off-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-8-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ppc/pnv_psi.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 264568cdfb..e8701c6100 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -25,6 +25,7 @@
#include "qemu/module.h"
#include "system/reset.h"
#include "qapi/error.h"
+#include "migration/vmstate.h"
#include "hw/ppc/fdt.h"
@@ -130,12 +131,11 @@ static void pnv_psi_set_bar(PnvPsi *psi, uint64_t bar)
{
PnvPsiClass *ppc = PNV_PSI_GET_CLASS(psi);
MemoryRegion *sysmem = get_system_memory();
- uint64_t old = psi->regs[PSIHB_XSCOM_BAR];
psi->regs[PSIHB_XSCOM_BAR] = bar & (ppc->bar_mask | PSIHB_BAR_EN);
/* Update MR, always remove it first */
- if (old & PSIHB_BAR_EN) {
+ if (memory_region_is_mapped(&psi->regs_mr)) {
memory_region_del_subregion(sysmem, &psi->regs_mr);
}
@@ -919,6 +919,37 @@ static const TypeInfo pnv_psi_power9_info = {
},
};
+static int vmstate_pnv_psi_post_load(void *opaque, int version_id)
+{
+ PnvPsi *psi = PNV_PSI(opaque);
+ Pnv9Psi *psi9 = PNV9_PSI(psi);
+ MemoryRegion *sysmem = get_system_memory();
+ uint64_t esb_bar;
+ hwaddr esb_addr;
+
+ /* Set the ESB MMIO mapping */
+ esb_bar = psi->regs[PSIHB_REG(PSIHB9_ESB_CI_BASE)];
+
+ if (esb_bar & PSIHB9_ESB_CI_VALID) {
+ esb_addr = esb_bar & PSIHB9_ESB_CI_ADDR_MASK;
+ memory_region_add_subregion(sysmem, esb_addr,
+ &psi9->source.esb_mmio);
+ }
+
+ return 0;
+}
+
+static const VMStateDescription vmstate_pnv_psi = {
+ .name = TYPE_PNV_PSI,
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .post_load = vmstate_pnv_psi_post_load,
+ .fields = (const VMStateField[]) {
+ VMSTATE_UINT64_ARRAY(regs, PnvPsi, PSIHB_XSCOM_MAX),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static void pnv_psi_power10_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -926,6 +957,7 @@ static void pnv_psi_power10_class_init(ObjectClass *klass, const void *data)
static const char compat[] = "ibm,power10-psihb-x\0ibm,psihb-x";
dc->desc = "PowerNV PSI Controller POWER10";
+ dc->vmsd = &vmstate_pnv_psi;
ppc->xscom_pcba = PNV10_XSCOM_PSIHB_BASE;
ppc->xscom_size = PNV10_XSCOM_PSIHB_SIZE;
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 09/10] target/ppc: Fix env->quiesced migration
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (7 preceding siblings ...)
2026-01-12 10:34 ` [PULL 08/10] hw/ppc: Add VMSTATE information to PnvPsi Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 10/10] tests/functional: Add a OS level migration test for pseries Harsh Prateek Bora
2026-01-13 0:50 ` [PULL 00/10] ppc-for-11.0 queue Richard Henderson
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Fabiano Rosas, Fabian Vogt, Chinmay Rath
From: Fabiano Rosas <farosas@suse.de>
The commit referenced (from QEMU 10.0) has changed the way the pseries
machine marks a cpu as quiesced. Previously, the cpu->halted value
from QEMU common cpu code was (incorrectly) used. With the fix, the
env->quiesced variable starts being used, which improves on the
original situation, but also causes a side effect after migration:
The env->quiesced is set at reset and never migrated, which causes the
destination QEMU to stop delivering interrupts and hang the machine.
To fix the issue from this point on, start migrating the env->quiesced
value.
For QEMU versions < 10.0, sending the new element on the stream would
cause migration to be aborted, so add the appropriate compatibility
property to omit the new subsection.
Independently of this patch, all migrations from QEMU versions < 10.0
would result in a hang since the older QEMU never migrates
env->quiesced. This is bad because it leaves machines already running
on the old QEMU without a migration path into newer versions.
As a workaround, use a few heuristics to infer the new value of
env->quiesced based on cpu->halted, LPCR and PSSCR bits that are
usually set/cleared along with quiesced.
Note that this was tested with -cpu power9 and -machine ic-mode=xive
due to another bug affecting migration of XICS guests. Tested both
forward and backward migration and savevm/loadvm from 9.2 and 10.0.
Also tested loadvm of a savevm image that contains a mix of cpus both
halted and not halted.
Reported-by: Fabian Vogt <fvogt@suse.de>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3079
Fixes: fb802acdc8b ("ppc/spapr: Fix RTAS stopped state")
Acked-by: Chinmay Rath <rathc@linux.ibm.com>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20260109123519.28703-2-farosas@suse.de
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
target/ppc/cpu.h | 1 +
hw/ppc/spapr.c | 6 +++++
target/ppc/cpu_init.c | 7 +++++
target/ppc/machine.c | 62 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index dbebae89dc..49445eb4ca 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1529,6 +1529,7 @@ struct ArchCPU {
void *machine_data;
int32_t node_id; /* NUMA node this CPU belongs to */
PPCHash64Options *hash64_opts;
+ bool rtas_stopped_state;
/* Those resources are used only during code translation */
/* opcode handlers */
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 72b36b3b69..274f38785f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4788,8 +4788,14 @@ DEFINE_SPAPR_MACHINE(10, 1);
*/
static void spapr_machine_10_0_class_options(MachineClass *mc)
{
+ static GlobalProperty spapr_compat_10_0[] = {
+ { TYPE_POWERPC_CPU, "rtas-stopped-state", "false" },
+ };
+
spapr_machine_10_1_class_options(mc);
compat_props_add(mc->compat_props, hw_compat_10_0, hw_compat_10_0_len);
+ compat_props_add(mc->compat_props, spapr_compat_10_0,
+ G_N_ELEMENTS(spapr_compat_10_0));
}
DEFINE_SPAPR_MACHINE(10, 0);
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 929254827d..58816c51a7 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -55,6 +55,11 @@
/* #define PPC_DEBUG_SPR */
/* #define USE_APPLE_GDB */
+static const Property powerpc_cpu_properties[] = {
+ DEFINE_PROP_BOOL("rtas-stopped-state", PowerPCCPU,
+ rtas_stopped_state, true),
+};
+
static inline void vscr_init(CPUPPCState *env, uint32_t val)
{
/* Altivec always uses round-to-nearest */
@@ -7529,6 +7534,8 @@ static void ppc_cpu_class_init(ObjectClass *oc, const void *data)
&pcc->parent_unrealize);
pcc->pvr_match = ppc_pvr_match_default;
+ device_class_set_props(dc, powerpc_cpu_properties);
+
resettable_class_set_parent_phases(rc, NULL, ppc_cpu_reset_hold, NULL,
&pcc->parent_phases);
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index d72e5ecb94..49cfdc6d67 100644
--- a/target/ppc/machine.c
+++ b/target/ppc/machine.c
@@ -257,6 +257,45 @@ static int cpu_post_load(void *opaque, int version_id)
ppc_store_sdr1(env, env->spr[SPR_SDR1]);
}
+ if (!cpu->rtas_stopped_state) {
+ /*
+ * The source QEMU doesn't have fb802acdc8 and still uses halt +
+ * PM bits in LPCR to implement RTAS stopped state. The new (this)
+ * QEMU will have put the secondary vcpus in stopped state,
+ * waiting for the start-cpu RTAS call. That call will never come
+ * if the source cpus were already running. Try to infer the cpus
+ * state and set env->quiesced accordingly.
+ *
+ * env->quiesced = true ==> the cpu is waiting to start
+ * env->quiesced = false ==> the cpu is running (unless halted)
+ */
+
+ /*
+ * Halted _could_ mean quiesced, but it could also be cede,
+ * confer_self, power management, etc.
+ */
+ if (CPU(cpu)->halted) {
+ PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
+ /*
+ * Both the PSSCR_EC bit and LPCR PM bits set at cpu reset
+ * and rtas_stop and cleared at rtas_start, it's a good
+ * heuristic.
+ */
+ if ((env->spr[SPR_PSSCR] & PSSCR_EC) &&
+ (env->spr[SPR_LPCR] & pcc->lpcr_pm)) {
+ env->quiesced = true;
+ } else {
+ env->quiesced = false;
+ }
+ } else {
+ /*
+ * Old QEMU sets halted during rtas_stop_self. Not halted,
+ * therefore definitely not quiesced.
+ */
+ env->quiesced = false;
+ }
+ }
+
post_load_update_msr(env);
if (tcg_enabled()) {
@@ -649,6 +688,28 @@ static const VMStateDescription vmstate_reservation = {
}
};
+static bool rtas_stopped_needed(void *opaque)
+{
+ PowerPCCPU *cpu = opaque;
+
+ return cpu->rtas_stopped_state;
+}
+
+static const VMStateDescription vmstate_rtas_stopped = {
+ .name = "cpu/rtas_stopped",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = rtas_stopped_needed,
+ .fields = (const VMStateField[]) {
+ /*
+ * "RTAS stopped" state, independent of halted state. For QEMU
+ * < 10.0, this is taken from cpu->halted at cpu_post_load()
+ */
+ VMSTATE_BOOL(env.quiesced, PowerPCCPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
#ifdef TARGET_PPC64
static bool bhrb_needed(void *opaque)
{
@@ -715,6 +776,7 @@ const VMStateDescription vmstate_ppc_cpu = {
&vmstate_tlbmas,
&vmstate_compat,
&vmstate_reservation,
+ &vmstate_rtas_stopped,
NULL
}
};
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 10/10] tests/functional: Add a OS level migration test for pseries
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (8 preceding siblings ...)
2026-01-12 10:34 ` [PULL 09/10] target/ppc: Fix env->quiesced migration Harsh Prateek Bora
@ 2026-01-12 10:34 ` Harsh Prateek Bora
2026-01-13 0:50 ` [PULL 00/10] ppc-for-11.0 queue Richard Henderson
10 siblings, 0 replies; 12+ messages in thread
From: Harsh Prateek Bora @ 2026-01-12 10:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Fabiano Rosas, Thomas Huth
From: Fabiano Rosas <farosas@suse.de>
There's currently no OS level test for ppc64le. Add one such test by
reusing the boot level tests that are already present.
The test boots the source machine, waits for it to reach a mid-boot
message, migrates and checks that the destination has reached the
final boot message (VFS error due to no disk).
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20260109123519.28703-3-farosas@suse.de
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
tests/functional/ppc64/test_migration.py | 12 ++++++++
tests/functional/ppc64/test_pseries.py | 35 ++++++++++++++++++++++++
2 files changed, 47 insertions(+)
diff --git a/tests/functional/ppc64/test_migration.py b/tests/functional/ppc64/test_migration.py
index 5dfdaaf709..a3b819680b 100755
--- a/tests/functional/ppc64/test_migration.py
+++ b/tests/functional/ppc64/test_migration.py
@@ -4,6 +4,7 @@
#
# ppc migration test
+from qemu_test.ports import Ports
from migration import MigrationTest
@@ -21,6 +22,17 @@ def test_migration_with_exec(self):
self.set_machine('mac99')
self.migration_with_exec()
+ def do_migrate_ppc64_linux(self, source_vm, dest_vm):
+ with Ports() as ports:
+ port = ports.find_free_port()
+ if port is None:
+ self.skipTest('Failed to find a free port')
+ uri = 'tcp:localhost:%u' % port
+
+ dest_vm.qmp('migrate-incoming', uri=uri)
+ source_vm.qmp('migrate', uri=uri)
+ self.assert_migration(source_vm, dest_vm)
+
if __name__ == '__main__':
MigrationTest.main()
diff --git a/tests/functional/ppc64/test_pseries.py b/tests/functional/ppc64/test_pseries.py
index 7840c4e3ff..b45763c305 100755
--- a/tests/functional/ppc64/test_pseries.py
+++ b/tests/functional/ppc64/test_pseries.py
@@ -9,6 +9,7 @@
from qemu_test import QemuSystemTest, Asset
from qemu_test import wait_for_console_pattern
+from test_migration import PpcMigrationTest
class PseriesMachine(QemuSystemTest):
@@ -87,5 +88,39 @@ def test_ppc64_linux_big_boot(self):
wait_for_console_pattern(self, console_pattern, self.panic_message)
wait_for_console_pattern(self, self.good_message, self.panic_message)
+ def test_ppc64_linux_migration(self):
+ self.set_machine('pseries')
+
+ kernel_path = self.ASSET_KERNEL.fetch()
+ kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
+
+ dest_vm = self.get_vm(name="dest-qemu")
+ dest_vm.add_args('-incoming', 'defer')
+ dest_vm.add_args('-smp', '4')
+ dest_vm.add_args('-nodefaults')
+ dest_vm.add_args('-kernel', kernel_path,
+ '-append', kernel_command_line)
+ dest_vm.set_console()
+ dest_vm.launch()
+
+ source_vm = self.get_vm(name="source-qemu")
+ source_vm.add_args('-smp', '4')
+ source_vm.add_args('-nodefaults')
+ source_vm.add_args('-kernel', kernel_path,
+ '-append', kernel_command_line)
+ source_vm.set_console()
+ source_vm.launch()
+
+ # ensure the boot has reached Linux
+ console_pattern = 'smp: Brought up 1 node, 4 CPUs'
+ wait_for_console_pattern(self, console_pattern, self.panic_message,
+ vm=source_vm)
+
+ PpcMigrationTest().do_migrate_ppc64_linux(source_vm, dest_vm);
+
+ # ensure the boot proceeds after migration
+ wait_for_console_pattern(self, self.good_message, self.panic_message,
+ vm=dest_vm)
+
if __name__ == '__main__':
QemuSystemTest.main()
--
2.52.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PULL 00/10] ppc-for-11.0 queue
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
` (9 preceding siblings ...)
2026-01-12 10:34 ` [PULL 10/10] tests/functional: Add a OS level migration test for pseries Harsh Prateek Bora
@ 2026-01-13 0:50 ` Richard Henderson
10 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2026-01-13 0:50 UTC (permalink / raw)
To: Harsh Prateek Bora, qemu-devel
On 1/12/26 21:34, Harsh Prateek Bora wrote:
> The following changes since commit b254e486242466dad881fc2bbfa215f1b67cd30f:
>
> Merge tag 'pull-riscv-to-apply-20260109' ofhttps://github.com/alistair23/qemu into staging (2026-01-10 10:31:57 +1100)
>
> are available in the Git repository at:
>
> https://gitlab.com/harshpb/qemu.git tags/pull-ppc-for-11.0-20260112
>
> for you to fetch changes up to f4e34d0fd56c25dd0c90722ed80a83a175160a6c:
>
> tests/functional: Add a OS level migration test for pseries (2026-01-12 15:34:04 +0530)
>
> ----------------------------------------------------------------
> First PPC PR for 11.0
>
> - Snapshot support for several ppc devices
> - Migration fix and OS level migration test for pseries
> - Minor code cleanups
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/11.0 as appropriate.
r~
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-01-13 0:51 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12 10:34 [PULL 00/10] ppc-for-11.0 queue Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 01/10] target/ppc/kvm : Use macro names instead of hardcoded constants as return values Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 02/10] hw/ppc: Add VMSTATE information for LPC model Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 03/10] hw/ppc: Add pnv_spi vmstate support Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 04/10] hw/ppc: Add pnv_i2c " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 05/10] hw/ppc: pnv_adu.c added " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 06/10] hw/ppc: pnv_core.c add " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 07/10] hw/ppc: pnv_chiptod.c " Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 08/10] hw/ppc: Add VMSTATE information to PnvPsi Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 09/10] target/ppc: Fix env->quiesced migration Harsh Prateek Bora
2026-01-12 10:34 ` [PULL 10/10] tests/functional: Add a OS level migration test for pseries Harsh Prateek Bora
2026-01-13 0:50 ` [PULL 00/10] ppc-for-11.0 queue Richard Henderson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.