From: Damien Hedde <damien.hedde@greensocs.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-4.1? 2/2] vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros
Date: Fri, 26 Jul 2019 11:12:18 +0200 [thread overview]
Message-ID: <fa5590b1-2d62-a9c4-c54e-957c9bac9ed1@greensocs.com> (raw)
In-Reply-To: <20190725172712.GM2656@work-vm>
On 7/25/19 7:27 PM, Dr. David Alan Gilbert wrote:
> * Peter Maydell (peter.maydell@linaro.org) wrote:
>> The VMSTATE_STRUCT_VARRAY_UINT32 macro is intended to handle
>> migrating a field which is an array of structs, but where instead of
>> migrating the entire array we only migrate a variable number of
>> elements of it.
>>
>> The VMSTATE_STRUCT_VARRAY_POINTER_UINT32 macro is intended to handle
>> migrating a field which is of pointer type, and points to a
>> dynamically allocated array of structs of variable size.
>>
>> We weren't actually checking that the field passed to
>> VMSTATE_STRUCT_VARRAY_UINT32 really is an array, with the result that
>> accidentally using it where the _POINTER_ macro was intended would
>> compile but silently corrupt memory on migration.
>>
>> Add type-checking that enforces that the field passed in is
>> really of the right array type. This applies to all the VMSTATE
>> macros which use flags including VMS_VARRAY_* but not VMS_POINTER.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>
> However, for the rest of it, from migration I'm happy:
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Tested-by: Damien Hedde <damien.hedde@greensocs.com>
Damien
prev parent reply other threads:[~2019-07-26 9:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 16:37 [Qemu-devel] [PATCH for-4.1? 0/2] Typecheck VMSTATE VARRAY macros and fix bug found Peter Maydell
2019-07-25 16:37 ` [Qemu-devel] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field Peter Maydell
2019-07-25 17:02 ` Dr. David Alan Gilbert
2019-07-25 17:40 ` Philippe Mathieu-Daudé
2019-07-26 9:52 ` Peter Maydell
2019-07-26 9:59 ` Dr. David Alan Gilbert
2019-07-26 10:03 ` Peter Maydell
2019-07-25 17:59 ` Peter Maydell
2019-07-25 18:32 ` Dr. David Alan Gilbert
2019-07-26 8:25 ` Damien Hedde
2019-07-26 8:47 ` Peter Maydell
2019-07-25 16:37 ` [Qemu-devel] [PATCH for-4.1? 2/2] vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros Peter Maydell
2019-07-25 17:27 ` Dr. David Alan Gilbert
2019-07-25 17:57 ` Peter Maydell
2019-07-25 18:00 ` Dr. David Alan Gilbert
2019-07-26 9:24 ` Peter Maydell
2019-07-26 9:32 ` Dr. David Alan Gilbert
2019-07-26 9:33 ` Peter Maydell
2019-07-26 9:34 ` Dr. David Alan Gilbert
2019-07-26 9:12 ` Damien Hedde [this message]
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=fa5590b1-2d62-a9c4-c54e-957c9bac9ed1@greensocs.com \
--to=damien.hedde@greensocs.com \
--cc=dgilbert@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).