* [PATCH] hw/timer: fix a9gtimer vmstate
@ 2022-02-07 8:44 Pavel Dovgalyuk
2022-02-14 7:34 ` Pavel Dovgalyuk
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Dovgalyuk @ 2022-02-07 8:44 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, pavel.dovgalyuk
A9 gtimer includes global control field and number of per-cpu fields.
But only per-cpu ones are migrated. This patch adds a subsection for
global control field migration.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
---
hw/timer/a9gtimer.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
index 7233068a37..5e959b6d09 100644
--- a/hw/timer/a9gtimer.c
+++ b/hw/timer/a9gtimer.c
@@ -318,6 +318,12 @@ static void a9_gtimer_realize(DeviceState *dev, Error **errp)
}
}
+static bool vmstate_a9_gtimer_control_needed(void *opaque)
+{
+ A9GTimerState *s = opaque;
+ return s->control != 0;
+}
+
static const VMStateDescription vmstate_a9_gtimer_per_cpu = {
.name = "arm.cortex-a9-global-timer.percpu",
.version_id = 1,
@@ -331,6 +337,17 @@ static const VMStateDescription vmstate_a9_gtimer_per_cpu = {
}
};
+static const VMStateDescription vmstate_a9_gtimer_control = {
+ .name = "arm.cortex-a9-global-timer.control",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = vmstate_a9_gtimer_control_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32(control, A9GTimerState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static const VMStateDescription vmstate_a9_gtimer = {
.name = "arm.cortex-a9-global-timer",
.version_id = 1,
@@ -344,6 +361,10 @@ static const VMStateDescription vmstate_a9_gtimer = {
1, vmstate_a9_gtimer_per_cpu,
A9GTimerPerCPU),
VMSTATE_END_OF_LIST()
+ },
+ .subsections = (const VMStateDescription*[]) {
+ &vmstate_a9_gtimer_control,
+ NULL
}
};
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/timer: fix a9gtimer vmstate
2022-02-07 8:44 [PATCH] hw/timer: fix a9gtimer vmstate Pavel Dovgalyuk
@ 2022-02-14 7:34 ` Pavel Dovgalyuk
2022-02-18 13:22 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Dovgalyuk @ 2022-02-14 7:34 UTC (permalink / raw)
To: qemu-devel, qemu-arm; +Cc: peter.maydell
ping
On 07.02.2022 11:44, Pavel Dovgalyuk wrote:
> A9 gtimer includes global control field and number of per-cpu fields.
> But only per-cpu ones are migrated. This patch adds a subsection for
> global control field migration.
>
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
> ---
> hw/timer/a9gtimer.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
> index 7233068a37..5e959b6d09 100644
> --- a/hw/timer/a9gtimer.c
> +++ b/hw/timer/a9gtimer.c
> @@ -318,6 +318,12 @@ static void a9_gtimer_realize(DeviceState *dev, Error **errp)
> }
> }
>
> +static bool vmstate_a9_gtimer_control_needed(void *opaque)
> +{
> + A9GTimerState *s = opaque;
> + return s->control != 0;
> +}
> +
> static const VMStateDescription vmstate_a9_gtimer_per_cpu = {
> .name = "arm.cortex-a9-global-timer.percpu",
> .version_id = 1,
> @@ -331,6 +337,17 @@ static const VMStateDescription vmstate_a9_gtimer_per_cpu = {
> }
> };
>
> +static const VMStateDescription vmstate_a9_gtimer_control = {
> + .name = "arm.cortex-a9-global-timer.control",
> + .version_id = 1,
> + .minimum_version_id = 1,
> + .needed = vmstate_a9_gtimer_control_needed,
> + .fields = (VMStateField[]) {
> + VMSTATE_UINT32(control, A9GTimerState),
> + VMSTATE_END_OF_LIST()
> + }
> +};
> +
> static const VMStateDescription vmstate_a9_gtimer = {
> .name = "arm.cortex-a9-global-timer",
> .version_id = 1,
> @@ -344,6 +361,10 @@ static const VMStateDescription vmstate_a9_gtimer = {
> 1, vmstate_a9_gtimer_per_cpu,
> A9GTimerPerCPU),
> VMSTATE_END_OF_LIST()
> + },
> + .subsections = (const VMStateDescription*[]) {
> + &vmstate_a9_gtimer_control,
> + NULL
> }
> };
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/timer: fix a9gtimer vmstate
2022-02-14 7:34 ` Pavel Dovgalyuk
@ 2022-02-18 13:22 ` Peter Maydell
0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2022-02-18 13:22 UTC (permalink / raw)
To: Pavel Dovgalyuk; +Cc: qemu-arm, qemu-devel
On Mon, 14 Feb 2022 at 07:34, Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru> wrote:
>
> ping
>
> On 07.02.2022 11:44, Pavel Dovgalyuk wrote:
> > A9 gtimer includes global control field and number of per-cpu fields.
> > But only per-cpu ones are migrated. This patch adds a subsection for
> > global control field migration.
> >
> > Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Thanks for the ping, this one fell through the net.
Applied to target-arm.next, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-18 13:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 8:44 [PATCH] hw/timer: fix a9gtimer vmstate Pavel Dovgalyuk
2022-02-14 7:34 ` Pavel Dovgalyuk
2022-02-18 13:22 ` Peter Maydell
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.