qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Stefan Berger <stefanb@linux.ibm.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH v2 3/3] savevm: check RAM is pagesize aligned
Date: Fri, 3 Jan 2020 08:43:37 +0100	[thread overview]
Message-ID: <5cb78b1c-94eb-c0fe-3360-9e2098e82f55@redhat.com> (raw)
In-Reply-To: <20200103074000.1006389-4-marcandre.lureau@redhat.com>

On 1/3/20 8:40 AM, Marc-André Lureau wrote:
> Check the host pointer is correctly aligned, otherwise we may fail
> during migration in ram_block_discard_range().
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   migration/savevm.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index a71b930b91..bbb7e89682 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -2910,6 +2910,11 @@ err_drain:
>   
>   void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
>   {
> +    RAMBlock *rb = mr->ram_block;
> +
> +    assert(QEMU_PTR_IS_ALIGNED(qemu_ram_get_host_addr(rb),
> +                               qemu_ram_pagesize(rb)));
> +
>       qemu_ram_set_idstr(mr->ram_block,
>                          memory_region_name(mr), dev);
>       qemu_ram_set_migratable(mr->ram_block);
> 



  reply	other threads:[~2020-01-03  7:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03  7:39 [PATCH v2 0/3] tpm: fix PPI RAM migration Marc-André Lureau
2020-01-03  7:39 ` [PATCH v2 1/3] misc: use QEMU_IS_ALIGNED Marc-André Lureau
2020-01-03  7:43   ` Philippe Mathieu-Daudé
2020-01-03  7:59     ` Marc-André Lureau
2020-01-03 10:21       ` Philippe Mathieu-Daudé
2020-01-03 16:36     ` Stefan Berger
2020-01-08 17:06     ` Paolo Bonzini
2020-01-08 18:55   ` Juan Quintela
2020-01-03  7:39 ` [PATCH v2 2/3] tpm-ppi: page-align PPI RAM Marc-André Lureau
2020-01-03 10:02   ` Dr. David Alan Gilbert
2020-01-03 16:38     ` Stefan Berger
2020-01-08 11:29     ` Dr. David Alan Gilbert
2020-01-08 12:49       ` Marc-André Lureau
2020-01-03  7:40 ` [PATCH v2 3/3] savevm: check RAM is pagesize aligned Marc-André Lureau
2020-01-03  7:43   ` Philippe Mathieu-Daudé [this message]
2020-01-08 12:47   ` Juan Quintela
2020-02-17 11:33     ` Marc-André Lureau
2020-02-27 18:41       ` Juan Quintela
2020-02-27 21:00         ` Aleksandar Markovic
2020-02-28  7:55           ` Juan Quintela
2020-02-28  9:09           ` Juan Quintela
2020-02-28 10:30             ` Aleksandar Markovic

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=5cb78b1c-94eb-c0fe-3360-9e2098e82f55@redhat.com \
    --to=philmd@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=stefanb@linux.ibm.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).