Re: [PATCH v2 3/9] hw/misc/iotkit-sysctl.c: add SSE-310 support

Peter Maydell <[email protected]>
Newsgroups org.nongnu.qemu-arm,org.nongnu.qemu-devel
Message-ID <CAFEAcA-jYZz1Ak4w5vgWGuzJnP4N=ikthmxRswY5=ZZzXWiRzw@mail.gmail.com>
On Wed, 5 Aug 2026 at 16:30, Simon Xu <[email protected]> wrote:
>
> Add SSE-310 case statements for reads and writes.
> Add new SSE-310 PIDR and CLIDR values.
> Add new SSE-310 PPUINTSTAT register as RAZ with LOG_UMIMP on reads and
> RO on writes.
>
> Reviewed-by: Owen Giles <[email protected]>
> Reviewed-by: Robert Elliott <[email protected]>
> Signed-off-by: Simon Xu <[email protected]>
> ---
> v1 -> v2
>         Add PPUINTSTAT register
>         Make sure comments don't separate case statements

>  static const VMStateDescription iotkit_sysctl_sse300_vmstate = {
> diff --git a/include/hw/misc/iotkit-sysctl.h b/include/hw/misc/iotkit-sysctl.h
> index ce72258a84..8e1cf0012d 100644
> --- a/include/hw/misc/iotkit-sysctl.h
> +++ b/include/hw/misc/iotkit-sysctl.h
> @@ -53,6 +53,7 @@ struct IoTKitSysCtl {
>      uint32_t initsvtor1;
>      uint32_t nmi_enable;
>      uint32_t ewctrl;
> +    uint32_t ppuintstat;
>      uint32_t pwrctrl;
>      uint32_t pdcm_pd_sys_sense;
>      uint32_t pdcm_pd_sram0_sense;

If we add a new field to the state struct here, we need to
add it to the vmstate data structures for migration. That
means a new subsection with an sse310_needed() function
so we migrate the field for SSE310 only.

But since this field is only ever zero because the register
is read-only, I think it's simpler to just have "r = 0;" in the
register-read codepath, and drop the field entirely. If anybody
ever needs to implement the register to have real functionality
they can add whatever fields/migration handling they need for it
then; we don't need to try to guess now what that will be.

thanks
-- PMM
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.