From: Fam Zheng <famz@redhat.com>
To: mst@redhat.com, pbonzini@redhat.com, Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: finalize IOMMU support
Date: Wed, 5 Jul 2017 14:23:59 +0800 [thread overview]
Message-ID: <20170705062359.GC29382@lemon.lan> (raw)
In-Reply-To: <1499170866-9068-1-git-send-email-jasowang@redhat.com>
On Tue, 07/04 20:21, Jason Wang wrote:
> After converting to use DMA api for virtio devices, we should use
> dma_as instead of address_space_memory. Otherwise it won't work if
> IOMMU is enabled.
>
> Fixes: commit 8607f5c3072c ("virtio: convert to use DMA api")
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/scsi/virtio-scsi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
> index f46f06d..d076fe7 100644
> --- a/hw/scsi/virtio-scsi.c
> +++ b/hw/scsi/virtio-scsi.c
> @@ -43,12 +43,13 @@ static inline SCSIDevice *virtio_scsi_device_find(VirtIOSCSI *s, uint8_t *lun)
>
> void virtio_scsi_init_req(VirtIOSCSI *s, VirtQueue *vq, VirtIOSCSIReq *req)
> {
> + VirtIODevice *vdev = VIRTIO_DEVICE(s);
> const size_t zero_skip =
> offsetof(VirtIOSCSIReq, resp_iov) + sizeof(req->resp_iov);
>
> req->vq = vq;
> req->dev = s;
> - qemu_sglist_init(&req->qsgl, DEVICE(s), 8, &address_space_memory);
> + qemu_sglist_init(&req->qsgl, DEVICE(s), 8, vdev->dma_as);
Not related to this patch, but is our vIOMMU iotlb implementation safe for data
plane (both virtio-blk and virtio-scsi)? There we don't have BQL to synchronize
between IOVA lookup and update, which means threads can race when accessing the
iotlb GHashTable.
Did I overlook a synchronization mechanism? Or is it missing? Paolo, MST?
Fam
> qemu_iovec_init(&req->resp_iov, 1);
> memset((uint8_t *)req + zero_skip, 0, sizeof(*req) - zero_skip);
> }
> --
> 2.7.4
>
>
next prev parent reply other threads:[~2017-07-05 6:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 12:21 [Qemu-devel] [PATCH] virtio-scsi: finalize IOMMU support Jason Wang
2017-07-04 23:49 ` Fam Zheng
2017-07-05 2:49 ` Wei Xu
2017-07-05 6:23 ` Fam Zheng [this message]
2017-07-05 6:27 ` Paolo Bonzini
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=20170705062359.GC29382@lemon.lan \
--to=famz@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.