All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Kowal <kowal@linux.ibm.com>
To: Caleb Schlossin <calebs@linux.ibm.com>, 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, angeloj@linux.ibm.com
Subject: Re: [PATCH v3 1/7] hw/ppc: Add VMSTATE information for LPC model
Date: Tue, 16 Dec 2025 10:50:57 -0600	[thread overview]
Message-ID: <944eca68-64af-49ad-8274-33938c5dfd5f@linux.ibm.com> (raw)
In-Reply-To: <20251216151359.418708-2-calebs@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 3681 bytes --]

Reviewed-by: Michael Kowal<kowal@linux.ibm.com>

Thanks, MAK


On 12/16/2025 9:13 AM, Caleb Schlossin wrote:
> 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>
> Signed-off-by: Caleb Schlossin<calebs@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 f6beba0917..e52a062181 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 = {

[-- Attachment #2: Type: text/html, Size: 4357 bytes --]

  reply	other threads:[~2025-12-16 16:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 15:13 [PATCH v3 0/7] hw/ppc: Snapshot support for several ppc devices Caleb Schlossin
2025-12-16 15:13 ` [PATCH v3 1/7] hw/ppc: Add VMSTATE information for LPC model Caleb Schlossin
2025-12-16 16:50   ` Mike Kowal [this message]
2025-12-16 15:13 ` [PATCH v3 2/7] hw/ppc: Add pnv_spi vmstate support Caleb Schlossin
2025-12-16 16:51   ` Mike Kowal
2025-12-16 15:13 ` [PATCH v3 3/7] hw/ppc: Add pnv_i2c " Caleb Schlossin
2025-12-16 16:52   ` Mike Kowal
2025-12-16 15:13 ` [PATCH v3 4/7] hw/ppc: pnv_adu.c added " Caleb Schlossin
2025-12-16 16:53   ` Mike Kowal
2025-12-16 15:13 ` [PATCH v3 5/7] hw/ppc: pnv_core.c add " Caleb Schlossin
2025-12-16 16:20   ` Miles Glenn
2025-12-16 17:04   ` Mike Kowal
2025-12-16 15:13 ` [PATCH v3 6/7] hw/ppc: pnv_chiptod.c " Caleb Schlossin
2025-12-16 17:08   ` Mike Kowal
2025-12-16 15:13 ` [PATCH v3 7/7] hw/ppc: Add VMSTATE information to PnvPsi Caleb Schlossin
2025-12-16 16:24   ` Miles Glenn
2025-12-16 16:49     ` Mike Kowal
2025-12-16 17:08 ` [PATCH v3 0/7] hw/ppc: Snapshot support for several ppc devices Aditya Gupta
2025-12-22 11:01 ` Chalapathi V
2026-01-05  9:21   ` Harsh Prateek Bora
2026-01-05 15:54     ` Caleb Schlossin

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=944eca68-64af-49ad-8274-33938c5dfd5f@linux.ibm.com \
    --to=kowal@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=alistair@alistair23.me \
    --cc=angeloj@linux.ibm.com \
    --cc=calebs@linux.ibm.com \
    --cc=chalapathi.v@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.