All of lore.kernel.org
 help / color / mirror / Atom feed
From: Caleb Schlossin <calebs@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, npiggin@gmail.com, adityag@linux.ibm.com,
	milesg@linux.ibm.com, alistair@alistair23.me,
	chalapathi.v@linux.ibm.com, kowal@linux.ibm.com,
	angeloj@linux.ibm.com, harshpb@linux.ibm.com,
	calebs@linux.ibm.com
Subject: [PATCH v4 5/7] hw/ppc: pnv_core.c add vmstate support
Date: Mon,  5 Jan 2026 10:01:36 -0600	[thread overview]
Message-ID: <20260105160138.3242709-6-calebs@linux.ibm.com> (raw)
In-Reply-To: <20260105160138.3242709-1-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>
Signed-off-by: Caleb Schlossin <calebs@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.47.3



  parent reply	other threads:[~2026-01-05 16:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 16:01 [PATCH v4 0/7] hw/ppc: Snapshot support for several ppc devices Caleb Schlossin
2026-01-05 16:01 ` [PATCH v4 1/7] hw/ppc: Add VMSTATE information for LPC model Caleb Schlossin
2026-01-05 16:01 ` [PATCH v4 2/7] hw/ppc: Add pnv_spi vmstate support Caleb Schlossin
2026-01-05 16:01 ` [PATCH v4 3/7] hw/ppc: Add pnv_i2c " Caleb Schlossin
2026-01-05 16:01 ` [PATCH v4 4/7] hw/ppc: pnv_adu.c added " Caleb Schlossin
2026-01-05 16:01 ` Caleb Schlossin [this message]
2026-01-05 16:01 ` [PATCH v4 6/7] hw/ppc: pnv_chiptod.c add " Caleb Schlossin
2026-01-05 16:01 ` [PATCH v4 7/7] hw/ppc: Add VMSTATE information to PnvPsi Caleb Schlossin
2026-01-12 10:02 ` [PATCH v4 0/7] hw/ppc: Snapshot support for several ppc devices Harsh Prateek Bora
2026-01-12 13:34   ` Konstantin Ryabitsev
2026-01-12 13:58     ` Harsh Prateek Bora

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20260105160138.3242709-6-calebs@linux.ibm.com \
    --to=calebs@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=alistair@alistair23.me \
    --cc=angeloj@linux.ibm.com \
    --cc=chalapathi.v@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=kowal@linux.ibm.com \
    --cc=milesg@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is 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.