QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com,
	Wei Yang <richardw.yang@linux.intel.com>,
	rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH] migration: check length directly to make sure the range is aligned
Date: Fri, 19 Jul 2019 19:06:51 +0100
Message-ID: <20190719180651.GM3000@work-vm> (raw)
In-Reply-To: <0fd200f7-ad92-d753-23ca-8c89a27fd346@redhat.com>

* Paolo Bonzini (pbonzini@redhat.com) wrote:
> On 19/07/19 19:54, Dr. David Alan Gilbert wrote:
> >> -        if ((uintptr_t)host_endaddr & (rb->page_size - 1)) {
> >> -            error_report("ram_block_discard_range: Unaligned end address: %p",
> >> -                         host_endaddr);
> >> +        if (length & (rb->page_size - 1)) {
> >> +            error_report("ram_block_discard_range: Unaligned length: %lx",
> >> +                         length);
> > Yes, I *think* this is safe, we'll need to watch out for any warnings;
> 
> Do you mean compiler or QEMU warning?

No, I mean lots of these error reports being printed out in some common
case.

Dave

  The patch is safe since there's an
> 
>     if ((uintptr_t)host_startaddr & (rb->page_size - 1)) {
>         error_report("ram_block_discard_range: Unaligned start address: %p",
>                      host_startaddr);
>         goto err;
>     }
> 
> just before this context.
> 
> Paolo
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  3:27 Wei Yang
2019-07-19 17:54 ` Dr. David Alan Gilbert
2019-07-19 18:03   ` Paolo Bonzini
2019-07-19 18:06     ` Dr. David Alan Gilbert [this message]
2019-10-01  7:54       ` Wei Yang
2019-08-19  2:26   ` Wei Yang
2019-09-13 23:58   ` Wei Yang

Reply instructions:

You may reply publically 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=20190719180651.GM3000@work-vm \
    --to=dgilbert@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richardw.yang@linux.intel.com \
    --cc=rth@twiddle.net \
    /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

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org qemu-devel@archiver.kernel.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox