qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3] vhost: fix log base address


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3] vhost: fix log base address
Date: Fri, 17 Apr 2015 16:04:38 +0100

On 17 April 2015 at 15:56, Michael S. Tsirkin <address@hidden> wrote:
> VHOST_SET_LOG_BASE got an incorrect address, causing
> migration errors and potentially even memory corruption.
>
> Reported-by: Wen Congyang <address@hidden>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> ---
>
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]