From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>, qemu-devel@nongnu.org
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Richard Henderson <rth@twiddle.net>,
xen-devel@lists.xen.org
Subject: Re: [PATCH] exec: Fix qemu_ram_block_from_host for Xen
Date: Mon, 13 Jun 2016 10:16:30 +0200 [thread overview]
Message-ID: <7faa3e52-4957-90dc-5060-581c3c6a3cc3__37081.8421048627$1465805869$gmane$org@redhat.com> (raw)
In-Reply-To: <20160609155617.6650-1-anthony.perard@citrix.com>
On 09/06/2016 17:56, Anthony PERARD wrote:
> Since f615f39 (exec: remove ram_addr argument from
> qemu_ram_block_from_host), migration under Xen is likely to fail, with a
> SEGV of QEMU. But the commit only reveal a bug with the calculation of
> the offset value in qemu_ram_block_from_host().
>
> This patch calculates the offset from the ram_addr as
> qemu_ram_addr_from_host() will later calculate the ram_addr from the
> offset.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> exec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/exec.c b/exec.c
> index f2c9e37..f13106d 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1935,7 +1935,7 @@ RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset,
> ram_addr = xen_ram_addr_from_mapcache(ptr);
> block = qemu_get_ram_block(ram_addr);
> if (block) {
> - *offset = (host - block->host);
> + *offset = ram_addr - block->offset;
> }
> rcu_read_unlock();
> return block;
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Feel free to send a pull request yourself!
Thanks, and sorry for the breakage. Indeed the broken code comes from
commit 422148d3e56c3c9a07c0cf36c1e0a0b76f09c357.
Paolo
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next parent reply other threads:[~2016-06-13 8:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160609155617.6650-1-anthony.perard@citrix.com>
2016-06-13 8:16 ` Paolo Bonzini [this message]
2016-06-09 15:56 [PATCH] exec: Fix qemu_ram_block_from_host for Xen Anthony PERARD
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='7faa3e52-4957-90dc-5060-581c3c6a3cc3__37081.8421048627$1465805869$gmane$org@redhat.com' \
--to=pbonzini@redhat.com \
--cc=anthony.perard@citrix.com \
--cc=crosthwaite.peter@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xen.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).