All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [RFC] virtio: convert to use DMA api
Date: Tue, 24 Nov 2015 13:42:25 +0800	[thread overview]
Message-ID: <5653F8C1.2010103@redhat.com> (raw)
In-Reply-To: <20151123103645.4c899f97.cornelia.huck@de.ibm.com>



On 11/23/2015 05:36 PM, Cornelia Huck wrote:
> On Mon, 23 Nov 2015 15:41:11 +0800
> Jason Wang <jasowang@redhat.com> wrote:
>
>> Currently, all virtio devices bypass IOMMU completely. This is because
>> address_space_memory is assumed and used during DMA emulation. This
>> patch converts the virtio core API to use DMA API. This idea is
>>
>> - introducing a new transport specific helper to query the dma address
>>   space. (only pci version is implemented).
>> - query and use this address space during virtio device guest memory
>>   accessing
>>
>> With this virtiodevices will not bypass IOMMU anymore. Little tested with
>> intel_iommu=on with virtio guest DMA series posted in
>> https://lkml.org/lkml/2015/10/28/64.
>>
>> TODO:
>> - Feature bit for this
> I'm still not convinced about that feature bit stuff. It just feels
> wrong to use a mechanism that conveys negotiable device features to
> configure what is basically a platform/hypervisor feature. I'd rather
> see this out of the virtio layer and into the pci layer.
>
>> - Implement this for all transports
> Is it OK to just keep a fallback to today's implementation for
> transports for which the iommu concept doesn't make sense and that will
> always have an identity mapping?

Yes it is. This patch keeps this fallback (e.g using
address_space_memory) for the transport without an iommu implementation.

>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>>  hw/block/virtio-blk.c             |  2 +-
>>  hw/char/virtio-serial-bus.c       |  2 +-
>>  hw/scsi/virtio-scsi.c             |  2 +-
>>  hw/virtio/virtio-pci.c            |  9 +++++++++
>>  hw/virtio/virtio.c                | 36 +++++++++++++++++++--------------
>>  include/hw/virtio/virtio-access.h | 42 +++++++++++++++++++++++++++++----------
>>  include/hw/virtio/virtio-bus.h    |  1 +
>>  include/hw/virtio/virtio.h        |  2 +-
>>  8 files changed, 67 insertions(+), 29 deletions(-)
> FWIW, this doesn't seem to break for the s390-ccw-virtio machine (only
> snifftested).
>

Good to know this. Thanks for the testing.

      parent reply	other threads:[~2015-11-24  5:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23  7:41 [Qemu-devel] [RFC] virtio: convert to use DMA api Jason Wang
2015-11-23  8:06 ` Michael S. Tsirkin
2015-11-24  5:38   ` Jason Wang
2015-11-23  9:36 ` Cornelia Huck
2015-11-23  9:52   ` Michael S. Tsirkin
2015-11-23 14:34     ` Cornelia Huck
2015-11-23 14:39       ` Peter Maydell
2015-11-24  5:42   ` Jason Wang [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=5653F8C1.2010103@redhat.com \
    --to=jasowang@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=mst@redhat.com \
    --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 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.