All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/armv7m: Fix broken VMStateDescription
@ 2022-01-20 15:16 Peter Maydell
  2022-01-21  5:15 ` Ani Sinha
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2022-01-20 15:16 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: qemu-stable, Dr. David Alan Gilbert

In commit d5093d961585f02 we added a VMStateDescription to
the TYPE_ARMV7M object, to handle migration of its Clocks.
However a cut-and-paste error meant we used the wrong struct
name in the VMSTATE_CLOCK() macro arguments. The result was
that attempting a 'savevm' might result in an assertion
failure.

Cc: qemu-stable@nongnu.org
Buglink: https://gitlab.com/qemu-project/qemu/-/issues/803
Fixes: d5093d961585f02
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
It's a shame there's no way to type-check that the struct
name used in the VMSTATE macros is correct...
---
 hw/arm/armv7m.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 8d08db80be8..ceb76df3cd4 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -520,8 +520,8 @@ static const VMStateDescription vmstate_armv7m = {
     .version_id = 1,
     .minimum_version_id = 1,
     .fields = (VMStateField[]) {
-        VMSTATE_CLOCK(refclk, SysTickState),
-        VMSTATE_CLOCK(cpuclk, SysTickState),
+        VMSTATE_CLOCK(refclk, ARMv7MState),
+        VMSTATE_CLOCK(cpuclk, ARMv7MState),
         VMSTATE_END_OF_LIST()
     }
 };
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/armv7m: Fix broken VMStateDescription
  2022-01-20 15:16 [PATCH] hw/armv7m: Fix broken VMStateDescription Peter Maydell
@ 2022-01-21  5:15 ` Ani Sinha
  2022-01-21 12:19 ` Alex Bennée
  2022-01-21 23:44 ` Philippe Mathieu-Daudé via
  2 siblings, 0 replies; 4+ messages in thread
From: Ani Sinha @ 2022-01-21  5:15 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, qemu-devel, Dr. David Alan Gilbert, qemu-stable



On Thu, 20 Jan 2022, Peter Maydell wrote:

> In commit d5093d961585f02 we added a VMStateDescription to
> the TYPE_ARMV7M object, to handle migration of its Clocks.
> However a cut-and-paste error meant we used the wrong struct
> name in the VMSTATE_CLOCK() macro arguments. The result was
> that attempting a 'savevm' might result in an assertion
> failure.
>
> Cc: qemu-stable@nongnu.org
> Buglink: https://gitlab.com/qemu-project/qemu/-/issues/803
> Fixes: d5093d961585f02
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Ani Sinha <ani@anisinha.ca>

> ---
> It's a shame there's no way to type-check that the struct
> name used in the VMSTATE macros is correct...
> ---
>  hw/arm/armv7m.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
> index 8d08db80be8..ceb76df3cd4 100644
> --- a/hw/arm/armv7m.c
> +++ b/hw/arm/armv7m.c
> @@ -520,8 +520,8 @@ static const VMStateDescription vmstate_armv7m = {
>      .version_id = 1,
>      .minimum_version_id = 1,
>      .fields = (VMStateField[]) {
> -        VMSTATE_CLOCK(refclk, SysTickState),
> -        VMSTATE_CLOCK(cpuclk, SysTickState),
> +        VMSTATE_CLOCK(refclk, ARMv7MState),
> +        VMSTATE_CLOCK(cpuclk, ARMv7MState),
>          VMSTATE_END_OF_LIST()
>      }
>  };
> --
> 2.25.1
>
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/armv7m: Fix broken VMStateDescription
  2022-01-20 15:16 [PATCH] hw/armv7m: Fix broken VMStateDescription Peter Maydell
  2022-01-21  5:15 ` Ani Sinha
@ 2022-01-21 12:19 ` Alex Bennée
  2022-01-21 23:44 ` Philippe Mathieu-Daudé via
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2022-01-21 12:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, qemu-devel, Dr. David Alan Gilbert, qemu-stable


Peter Maydell <peter.maydell@linaro.org> writes:

> In commit d5093d961585f02 we added a VMStateDescription to
> the TYPE_ARMV7M object, to handle migration of its Clocks.
> However a cut-and-paste error meant we used the wrong struct
> name in the VMSTATE_CLOCK() macro arguments. The result was
> that attempting a 'savevm' might result in an assertion
> failure.
>
> Cc: qemu-stable@nongnu.org
> Buglink: https://gitlab.com/qemu-project/qemu/-/issues/803
> Fixes: d5093d961585f02
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/armv7m: Fix broken VMStateDescription
  2022-01-20 15:16 [PATCH] hw/armv7m: Fix broken VMStateDescription Peter Maydell
  2022-01-21  5:15 ` Ani Sinha
  2022-01-21 12:19 ` Alex Bennée
@ 2022-01-21 23:44 ` Philippe Mathieu-Daudé via
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-01-21 23:44 UTC (permalink / raw)
  To: Peter Maydell, qemu-arm, qemu-devel; +Cc: qemu-stable, Dr. David Alan Gilbert

On 20/1/22 16:16, Peter Maydell wrote:
> In commit d5093d961585f02 we added a VMStateDescription to
> the TYPE_ARMV7M object, to handle migration of its Clocks.
> However a cut-and-paste error meant we used the wrong struct
> name in the VMSTATE_CLOCK() macro arguments. The result was
> that attempting a 'savevm' might result in an assertion
> failure.
> 
> Cc: qemu-stable@nongnu.org
> Buglink: https://gitlab.com/qemu-project/qemu/-/issues/803
> Fixes: d5093d961585f02
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> It's a shame there's no way to type-check that the struct
> name used in the VMSTATE macros is correct...
> ---
>   hw/arm/armv7m.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-21 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 15:16 [PATCH] hw/armv7m: Fix broken VMStateDescription Peter Maydell
2022-01-21  5:15 ` Ani Sinha
2022-01-21 12:19 ` Alex Bennée
2022-01-21 23:44 ` Philippe Mathieu-Daudé via

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.