linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Woodhouse <dwmw2@infradead.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Sebastian Ott <sebott@linux.vnet.ibm.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-s390 <linux-s390@vger.kernel.org>,
	David Vrabel <david.vrabel@citrix.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Joerg Roedel <jroedel@suse.de>, KVM <kvm@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Christoph Hellwig <hch@lst.de>,
	Linux Virtualization <virtualization@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	sparclinux@vger.kernel.org
Subject: Re: [PATCH v7 5/9] virtio_ring: Support DMA APIs
Date: Wed, 3 Feb 2016 09:53:39 -0800	[thread overview]
Message-ID: <CALCETrWXPEMTTTD3raO6uOF+WG+msszRXQY5QMhBf+UwF5kArw@mail.gmail.com> (raw)
In-Reply-To: <20160203154633-mutt-send-email-mst@redhat.com>

On Feb 3, 2016 5:52 AM, "Michael S. Tsirkin" <mst@redhat.com> wrote:
>
> On Tue, Feb 02, 2016 at 09:46:36PM -0800, Andy Lutomirski wrote:
> > virtio_ring currently sends the device (usually a hypervisor)
> > physical addresses of its I/O buffers.  This is okay when DMA
> > addresses and physical addresses are the same thing, but this isn't
> > always the case.  For example, this never works on Xen guests, and
> > it is likely to fail if a physical "virtio" device ever ends up
> > behind an IOMMU or swiotlb.
> >
> > The immediate use case for me is to enable virtio on Xen guests.
> > For that to work, we need vring to support DMA address translation
> > as well as a corresponding change to virtio_pci or to another
> > driver.
> >
> > Signed-off-by: Andy Lutomirski <luto@kernel.org>
> > ---
> >  drivers/virtio/Kconfig           |   2 +-
> >  drivers/virtio/virtio_ring.c     | 200 ++++++++++++++++++++++++++++++++-------
> >  tools/virtio/linux/dma-mapping.h |  17 ++++
> >  3 files changed, 183 insertions(+), 36 deletions(-)
> >  create mode 100644 tools/virtio/linux/dma-mapping.h
> >
> > diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
> > index cab9f3f63a38..77590320d44c 100644
> > --- a/drivers/virtio/Kconfig
> > +++ b/drivers/virtio/Kconfig
> > @@ -60,7 +60,7 @@ config VIRTIO_INPUT
> >
> >   config VIRTIO_MMIO
> >       tristate "Platform bus driver for memory mapped virtio devices"
> > -     depends on HAS_IOMEM
> > +     depends on HAS_IOMEM && HAS_DMA
> >       select VIRTIO
> >       ---help---
> >        This drivers provides support for memory mapped virtio
>
> What's this chunk doing here btw? Should be part of the mmio patch?
>

IIRC it was deliberate.  Making virtio depend on HAS_DMA didn't work
right because kconfig doesn't propagate dependencies through select
intelligently.  This patch makes core virtio depend on HAS_DMA, so I
added the dependency here, too.

--Andy

  reply	other threads:[~2016-02-03 17:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03  5:46 [PATCH v7 0/9] virtio DMA API, yet again Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 1/9] dma: Provide simple noop dma ops Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 2/9] alpha/dma: use common " Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 3/9] s390/dma: Allow per device " Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 4/9] vring: Introduce vring_use_dma_api() Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 5/9] virtio_ring: Support DMA APIs Andy Lutomirski
2016-02-03 13:52   ` Michael S. Tsirkin
2016-02-03 17:53     ` Andy Lutomirski [this message]
2016-02-03  5:46 ` [PATCH v7 6/9] virtio: Add improved queue allocation API Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 7/9] virtio_mmio: Use the DMA API if enabled Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 8/9] virtio_pci: " Andy Lutomirski
2016-02-03  5:46 ` [PATCH v7 9/9] vring: Use the DMA API on Xen Andy Lutomirski
2016-02-03  9:49   ` David Vrabel
2016-02-04 17:49     ` Andy Lutomirski
2016-02-03 17:52 ` [PATCH v7 0/9] virtio DMA API, yet again Stefano Stabellini
2016-02-17  5:48 ` Andy Lutomirski
2016-02-17  9:29   ` Michael S. Tsirkin
2016-02-17  9:42     ` David Woodhouse

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=CALCETrWXPEMTTTD3raO6uOF+WG+msszRXQY5QMhBf+UwF5kArw@mail.gmail.com \
    --to=luto@amacapital.net \
    --cc=benh@kernel.crashing.org \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=david.vrabel@citrix.com \
    --cc=dwmw2@infradead.org \
    --cc=hch@lst.de \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xen-devel@lists.xenproject.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).