qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/5] memory: Allow RAM up to block->max_length to be discarded
Date: Thu, 22 Jun 2017 12:47:08 +0100	[thread overview]
Message-ID: <20170622114708.GB2624@work-vm> (raw)
In-Reply-To: <20170614203000.19984-3-ehabkost@redhat.com>

* Eduardo Habkost (ehabkost@redhat.com) wrote:
> Currently ram_block_discard_range() is called only by the postcopy code,
> using length=block->used_length.  However, new code will use
> ram_block_discard_range() to discard the contents of the entire
> RAMBlock, so change the limit check to use max_length instead of
> used_length.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  exec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/exec.c b/exec.c
> index a93e209625..585d6ed6d7 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3522,7 +3522,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length)
>          goto err;
>      }
>  
> -    if ((start + length) <= rb->used_length) {
> +    if ((start + length) <= rb->max_length) {
>          uint8_t *host_endaddr = host_startaddr + length;
>          if ((uintptr_t)host_endaddr & (rb->page_size - 1)) {
>              error_report("ram_block_discard_range: Unaligned end address: %p",
> -- 
> 2.11.0.259.g40922b1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2017-06-22 11:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 20:29 [Qemu-devel] [PATCH 0/5] hostmem-file: Add "persistent" option Eduardo Habkost
2017-06-14 20:29 ` [Qemu-devel] [PATCH 1/5] vl: Clean up user-creatable objects when exiting Eduardo Habkost
2017-06-14 20:29 ` [Qemu-devel] [PATCH 2/5] memory: Allow RAM up to block->max_length to be discarded Eduardo Habkost
2017-06-22 11:47   ` Dr. David Alan Gilbert [this message]
2017-06-14 20:29 ` [Qemu-devel] [PATCH 3/5] memory: Add RAM_NONPERSISTENT flag Eduardo Habkost
2017-06-22 12:14   ` Dr. David Alan Gilbert
2017-06-22 17:27     ` Eduardo Habkost
2017-06-22 18:56       ` Dr. David Alan Gilbert
2017-06-14 20:29 ` [Qemu-devel] [PATCH 4/5] memory: Add 'persistent' parameter to memory_region_init_ram_from_file() Eduardo Habkost
2017-06-22 12:26   ` Dr. David Alan Gilbert
2017-06-22 12:41     ` Eduardo Habkost
2017-06-14 20:30 ` [Qemu-devel] [PATCH 5/5] hostmem-file: Add "persistent" option Eduardo Habkost
2017-06-14 21:50 ` [Qemu-devel] [PATCH 0/5] " no-reply
2017-07-06 18:47 ` Eduardo Habkost
2017-08-11 16:33 ` Eduardo Habkost
2017-08-11 16:44   ` Daniel P. Berrange
2017-08-11 18:15     ` Eduardo Habkost
2017-08-14  9:39       ` Daniel P. Berrange
2017-08-14 11:40         ` Eduardo Habkost
2017-08-14 18:33           ` Zack Cornelius

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=20170622114708.GB2624@work-vm \
    --to=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).