All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clock-vmstate: Add missing END_OF_LIST
@ 2022-01-11 10:19 Dr. David Alan Gilbert (git)
  2022-01-11 10:30 ` Peter Maydell
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2022-01-11 10:19 UTC (permalink / raw)
  To: qemu-devel, luc, damien.hedde, peter.maydell; +Cc: alex.bennee

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv

Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 hw/core/clock-vmstate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
index 9d9174ffbd..7eccb6d4ea 100644
--- a/hw/core/clock-vmstate.c
+++ b/hw/core/clock-vmstate.c
@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
     .fields = (VMStateField[]) {
         VMSTATE_UINT32(multiplier, Clock),
         VMSTATE_UINT32(divider, Clock),
+        VMSTATE_END_OF_LIST()
     },
 };
 
-- 
2.34.1



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

* Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
  2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
@ 2022-01-11 10:30 ` Peter Maydell
  2022-01-11 14:01   ` Dr. David Alan Gilbert
  2022-01-11 12:11 ` Peter Maydell
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2022-01-11 10:30 UTC (permalink / raw)
  To: Dr. David Alan Gilbert (git); +Cc: damien.hedde, alex.bennee, luc, qemu-devel

On Tue, 11 Jan 2022 at 10:19, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
>
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
>
> Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  hw/core/clock-vmstate.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
> index 9d9174ffbd..7eccb6d4ea 100644
> --- a/hw/core/clock-vmstate.c
> +++ b/hw/core/clock-vmstate.c
> @@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT32(multiplier, Clock),
>          VMSTATE_UINT32(divider, Clock),
> +        VMSTATE_END_OF_LIST()
>      },
>  };

Oops :-(

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

We could maybe make this kind of bug more likely to be detected by
instead of having the terminator be an "all zeros" VMStateField,
having it check both for name == NULL and for a magic number in the
VMStateFlags field. That way (assuming something in "make check"
causes us to do a scan through every registered vmstate struct)
forgetting the terminator will be likely to cause us to crash or hang
rather than finding some 0 data and thinking that's the
terminator.

thanks
-- PMM


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

* Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
  2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
  2022-01-11 10:30 ` Peter Maydell
@ 2022-01-11 12:11 ` Peter Maydell
  2022-01-11 13:01 ` Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2022-01-11 12:11 UTC (permalink / raw)
  To: Dr. David Alan Gilbert (git); +Cc: damien.hedde, alex.bennee, luc, qemu-devel

On Tue, 11 Jan 2022 at 10:19, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
>
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
>
> Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  hw/core/clock-vmstate.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
> index 9d9174ffbd..7eccb6d4ea 100644
> --- a/hw/core/clock-vmstate.c
> +++ b/hw/core/clock-vmstate.c
> @@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT32(multiplier, Clock),
>          VMSTATE_UINT32(divider, Clock),
> +        VMSTATE_END_OF_LIST()
>      },
>  };

Cc: qemu-stable@nongnu.org
seems appropriate here ?

thanks
-- PMM


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

* Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
  2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
  2022-01-11 10:30 ` Peter Maydell
  2022-01-11 12:11 ` Peter Maydell
@ 2022-01-11 13:01 ` Philippe Mathieu-Daudé
  2022-01-11 13:40 ` Alex Bennée
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-01-11 13:01 UTC (permalink / raw)
  To: Dr. David Alan Gilbert (git),
	qemu-devel, luc, damien.hedde, peter.maydell
  Cc: alex.bennee

On 1/11/22 11:19, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
> 
> Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")

Doh I missed this too :(

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

> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  hw/core/clock-vmstate.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
> index 9d9174ffbd..7eccb6d4ea 100644
> --- a/hw/core/clock-vmstate.c
> +++ b/hw/core/clock-vmstate.c
> @@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT32(multiplier, Clock),
>          VMSTATE_UINT32(divider, Clock),
> +        VMSTATE_END_OF_LIST()
>      },
>  };
>  


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

* Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
  2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
                   ` (2 preceding siblings ...)
  2022-01-11 13:01 ` Philippe Mathieu-Daudé
@ 2022-01-11 13:40 ` Alex Bennée
  2022-01-12  7:48 ` Luc Michel
  2022-03-02 10:49 ` Dr. David Alan Gilbert
  5 siblings, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2022-01-11 13:40 UTC (permalink / raw)
  To: Dr. David Alan Gilbert (git); +Cc: damien.hedde, peter.maydell, luc, qemu-devel


"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> writes:

> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
>
> Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

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

-- 
Alex Bennée


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

* Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
  2022-01-11 10:30 ` Peter Maydell
@ 2022-01-11 14:01   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 8+ messages in thread
From: Dr. David Alan Gilbert @ 2022-01-11 14:01 UTC (permalink / raw)
  To: Peter Maydell; +Cc: damien.hedde, alex.bennee, luc, qemu-devel

* Peter Maydell (peter.maydell@linaro.org) wrote:
> On Tue, 11 Jan 2022 at 10:19, Dr. David Alan Gilbert (git)
> <dgilbert@redhat.com> wrote:
> >
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
> >
> > Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> >  hw/core/clock-vmstate.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
> > index 9d9174ffbd..7eccb6d4ea 100644
> > --- a/hw/core/clock-vmstate.c
> > +++ b/hw/core/clock-vmstate.c
> > @@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
> >      .fields = (VMStateField[]) {
> >          VMSTATE_UINT32(multiplier, Clock),
> >          VMSTATE_UINT32(divider, Clock),
> > +        VMSTATE_END_OF_LIST()
> >      },
> >  };
> 
> Oops :-(
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> We could maybe make this kind of bug more likely to be detected by
> instead of having the terminator be an "all zeros" VMStateField,
> having it check both for name == NULL and for a magic number in the
> VMStateFlags field. That way (assuming something in "make check"
> causes us to do a scan through every registered vmstate struct)
> forgetting the terminator will be likely to cause us to crash or hang
> rather than finding some 0 data and thinking that's the
> terminator.

Yeh, let me see what I can come up with for that.

Dave

> thanks
> -- PMM
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



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

* Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
  2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
                   ` (3 preceding siblings ...)
  2022-01-11 13:40 ` Alex Bennée
@ 2022-01-12  7:48 ` Luc Michel
  2022-03-02 10:49 ` Dr. David Alan Gilbert
  5 siblings, 0 replies; 8+ messages in thread
From: Luc Michel @ 2022-01-12  7:48 UTC (permalink / raw)
  To: Dr. David Alan Gilbert (git)
  Cc: damien.hedde, peter.maydell, alex.bennee, qemu-devel

On 10:19 Tue 11 Jan     , Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
> 
> Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Reviewed-by: Luc Michel <luc@lmichel.fr>

> ---
>  hw/core/clock-vmstate.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
> index 9d9174ffbd..7eccb6d4ea 100644
> --- a/hw/core/clock-vmstate.c
> +++ b/hw/core/clock-vmstate.c
> @@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT32(multiplier, Clock),
>          VMSTATE_UINT32(divider, Clock),
> +        VMSTATE_END_OF_LIST()
>      },
>  };
>  
> -- 
> 2.34.1
> 

-- 


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

* Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
  2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
                   ` (4 preceding siblings ...)
  2022-01-12  7:48 ` Luc Michel
@ 2022-03-02 10:49 ` Dr. David Alan Gilbert
  5 siblings, 0 replies; 8+ messages in thread
From: Dr. David Alan Gilbert @ 2022-03-02 10:49 UTC (permalink / raw)
  To: qemu-devel, luc, damien.hedde, peter.maydell; +Cc: alex.bennee

* Dr. David Alan Gilbert (git) (dgilbert@redhat.com) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv

Queued

> 
> Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  hw/core/clock-vmstate.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
> index 9d9174ffbd..7eccb6d4ea 100644
> --- a/hw/core/clock-vmstate.c
> +++ b/hw/core/clock-vmstate.c
> @@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT32(multiplier, Clock),
>          VMSTATE_UINT32(divider, Clock),
> +        VMSTATE_END_OF_LIST()
>      },
>  };
>  
> -- 
> 2.34.1
> 
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



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

end of thread, other threads:[~2022-03-02 10:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
2022-01-11 10:30 ` Peter Maydell
2022-01-11 14:01   ` Dr. David Alan Gilbert
2022-01-11 12:11 ` Peter Maydell
2022-01-11 13:01 ` Philippe Mathieu-Daudé
2022-01-11 13:40 ` Alex Bennée
2022-01-12  7:48 ` Luc Michel
2022-03-02 10:49 ` Dr. David Alan Gilbert

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.