From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3] vhost: fix log base address
Date: Fri, 17 Apr 2015 17:13:57 +0200 [thread overview]
Message-ID: <20150417171352-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <CAFEAcA_Xp3=ksc+f=mBxdcfn7MdtWUUNiqmDuuiRrRi3SXmHcA@mail.gmail.com>
On Fri, Apr 17, 2015 at 04:04:38PM +0100, Peter Maydell wrote:
> On 17 April 2015 at 15:56, Michael S. Tsirkin <mst@redhat.com> wrote:
> > VHOST_SET_LOG_BASE got an incorrect address, causing
> > migration errors and potentially even memory corruption.
> >
> > Reported-by: Wen Congyang <wency@cn.fujitsu.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >
> > Built only.
> > Will test and report next week.
> > Wen Congyang, can you pls confirm as well?
> >
> > hw/virtio/vhost.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> > index 8dd2f59..e4cf9d7 100644
> > --- a/hw/virtio/vhost.c
> > +++ b/hw/virtio/vhost.c
> > @@ -1016,10 +1016,13 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
> > }
> >
> > if (hdev->log_enabled) {
> > + uint64_t log_base;
> > +
> > hdev->log_size = vhost_get_log_size(hdev);
> > hdev->log = hdev->log_size ?
> > g_malloc0(hdev->log_size * sizeof *hdev->log) : NULL;
> > - r = hdev->vhost_ops->vhost_call(hdev, VHOST_SET_LOG_BASE, hdev->log);
> > + log_base = (uint64_t)(unsigned long)hdev->log;
>
> Paolo asked you to make this cast just be a single (uintptr_t).
>
> thanks
> -- PMM
done.
prev parent reply other threads:[~2015-04-17 15:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 14:56 [Qemu-devel] [PATCH v3] vhost: fix log base address Michael S. Tsirkin
2015-04-17 15:04 ` Peter Maydell
2015-04-17 15:13 ` Michael S. Tsirkin [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=20150417171352-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--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).