[PATCH v7 0/9] virtio DMA API, yet again

2016-02-02 Thread Andy Lutomirski
to hit. - Fix a DMA ordering issue (swiotlb=force works now). - Minor cleanups. Andy Lutomirski (6): vring: Introduce vring_use_dma_api() virtio_ring: Support DMA APIs virtio: Add improved queue allocation API virtio_mmio: Use the DMA API if enabled virtio_pci: Use the DMA API if enabled

[PATCH v7 2/9] alpha/dma: use common noop dma ops

2016-02-02 Thread Andy Lutomirski
From: Christian Borntraeger <borntrae...@de.ibm.com> Some of the alpha pci noop dma ops are identical to the common ones. Use them. Signed-off-by: Christian Borntraeger <borntrae...@de.ibm.com> Reviewed-by: Joerg Roedel <jroe...@suse.de> Signed-off-by: Andy Lutomirski <l...@

[PATCH v7 3/9] s390/dma: Allow per device dma ops

2016-02-02 Thread Andy Lutomirski
a Huck <cornelia.h...@de.ibm.com> Acked-by: Sebastian Ott <seb...@linux.vnet.ibm.com> Signed-off-by: Andy Lutomirski <l...@kernel.org> --- arch/s390/Kconfig | 5 + arch/s390/include/asm/device.h | 6 +- arch/s390/include/asm/dma-mappi

[PATCH v7 6/9] virtio: Add improved queue allocation API

2016-02-02 Thread Andy Lutomirski
on which it's worthwhile.) __vring_new_virtqueue: Creates a virtqueue with a manually-specified layout. This should allow mic_virtio to work much more cleanly. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c

[PATCH v7 5/9] virtio_ring: Support DMA APIs

2016-02-02 Thread Andy Lutomirski
"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 Lut

[PATCH v7 1/9] dma: Provide simple noop dma ops

2016-02-02 Thread Andy Lutomirski
;borntrae...@de.ibm.com> Reviewed-by: Joerg Roedel <jroe...@suse.de> Signed-off-by: Andy Lutomirski <l...@kernel.org> --- include/linux/dma-mapping.h | 2 ++ lib/Makefile| 1 + lib/dma-noop.c | 75 + 3 files changed,

[PATCH v7 4/9] vring: Introduce vring_use_dma_api()

2016-02-02 Thread Andy Lutomirski
This is a kludge, but no one has come up with a a better idea yet. We'll introduce DMA API support guarded by vring_use_dma_api(). Eventually we may be able to return true on more and more systems, and hopefully we can get rid of vring_use_dma_api() entirely some day. Signed-off-by: Andy

[PATCH v7 7/9] virtio_mmio: Use the DMA API if enabled

2016-02-02 Thread Andy Lutomirski
This switches to vring_create_virtqueue, simplifying the driver and adding DMA API support. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_mmio.c | 67 ++-- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git a/d

[PATCH v7 8/9] virtio_pci: Use the DMA API if enabled

2016-02-02 Thread Andy Lutomirski
as virtio-pci running under Xen. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_pci_common.h | 6 drivers/virtio/virtio_pci_legacy.c | 42 +++--- drivers/virtio/virtio_pci_modern.c | 61 ++ 3 files chang

[PATCH v7 9/9] vring: Use the DMA API on Xen

2016-02-02 Thread Andy Lutomirski
Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index e46d08107a50..5c802d47892c 100644 --- a/drivers/virtio/virtio_ring.c +++ b/d

Re: [PATCH v5 04/10] vring: Introduce vring_use_dma_api()

2016-02-01 Thread Andy Lutomirski
On Mon, Feb 1, 2016 at 5:23 AM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Mon, Feb 01, 2016 at 11:22:03AM +, David Woodhouse wrote: >> On Thu, 2016-01-28 at 18:31 -0800, Andy Lutomirski wrote: >> > This is a kludge, but no one has come up with a a better idea y

[PATCH v6 2/9] alpha/dma: use common noop dma ops

2016-02-01 Thread Andy Lutomirski
From: Christian Borntraeger Some of the alpha pci noop dma ops are identical to the common ones. Use them. Signed-off-by: Christian Borntraeger Reviewed-by: Joerg Roedel --- arch/alpha/kernel/pci-noop.c | 46

[PATCH v6 5/9] virtio_ring: Support DMA APIs

2016-02-01 Thread Andy Lutomirski
"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 Lut

[PATCH v6 1/9] dma: Provide simple noop dma ops

2016-02-01 Thread Andy Lutomirski
From: Christian Borntraeger We are going to require dma_ops for several common drivers, even for systems that do have an identity mapping. Lets provide some minimal no-op dma_ops that can be used for that purpose. Signed-off-by: Christian Borntraeger

[PATCH v6 3/9] s390/dma: Allow per device dma ops

2016-02-01 Thread Andy Lutomirski
From: Christian Borntraeger As virtio-ccw will have dma ops, we can no longer default to the zPCI ones. Make use of dev_archdata to keep the dma_ops per device. The pci devices now use that to override the default, and the default is changed to use the noop ops for

[PATCH v6 4/9] vring: Introduce vring_use_dma_api()

2016-02-01 Thread Andy Lutomirski
This is a kludge, but no one has come up with a a better idea yet. We'll introduce DMA API support guarded by vring_use_dma_api(). Eventually we may be able to return true on more and more systems, and hopefully we can get rid of vring_use_dma_api() entirely some day. Signed-off-by: Andy

[PATCH v6 8/9] virtio_pci: Use the DMA API if enabled

2016-02-01 Thread Andy Lutomirski
as virtio-pci running under Xen. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_pci_common.h | 6 drivers/virtio/virtio_pci_legacy.c | 42 +++--- drivers/virtio/virtio_pci_modern.c | 61 ++ 3 files chang

[PATCH v6 7/9] virtio_mmio: Use the DMA API if enabled

2016-02-01 Thread Andy Lutomirski
This switches to vring_create_virtqueue, simplifying the driver and adding DMA API support. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_mmio.c | 67 ++-- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git a/d

[PATCH v6 0/9] virtio DMA API, yet again

2016-02-01 Thread Andy Lutomirski
causing a BUG to hit. - Fix a DMA ordering issue (swiotlb=force works now). - Minor cleanups. Andy Lutomirski (6): vring: Introduce vring_use_dma_api() virtio_ring: Support DMA APIs virtio: Add improved queue allocation API virtio_mmio: Use the DMA API if enabled virtio_pci: Use

[PATCH v6 9/9] vring: Use the DMA API on Xen

2016-02-01 Thread Andy Lutomirski
Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index cf2840c7e500..2a921e5b1809 100644 --- a/drivers/virtio/virtio_ring.c +++ b/d

[PATCH v6 6/9] virtio: Add improved queue allocation API

2016-02-01 Thread Andy Lutomirski
on which it's worthwhile.) __vring_new_virtqueue: Creates a virtqueue with a manually-specified layout. This should allow mic_virtio to work much more cleanly. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c

Re: [Xen-devel] [PATCH v5 00/10] virtio DMA API, yet again

2016-02-01 Thread Andy Lutomirski
On Mon, Feb 1, 2016 at 3:00 AM, Wei Liu <wei.l...@citrix.com> wrote: > Nice work, Andy. > > On Thu, Jan 28, 2016 at 06:31:13PM -0800, Andy Lutomirski wrote: >> This switches virtio to use the DMA API on Xen and if requested by >> module option. >> >> This f

Re: [Xen-devel] [PATCH v5 09/10] vring: Use the DMA API on Xen

2016-01-31 Thread Andy Lutomirski
On Sun, Jan 31, 2016 at 12:18 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Sun, Jan 31, 2016 at 12:13:58PM -0800, Andy Lutomirski wrote: >> On Sun, Jan 31, 2016 at 12:09 PM, Michael S. Tsirkin <m...@redhat.com> wrote: >> > On Fri, Jan 29, 2016 at 10:34:

Re: [Xen-devel] [PATCH v5 09/10] vring: Use the DMA API on Xen

2016-01-31 Thread Andy Lutomirski
On Sun, Jan 31, 2016 at 12:09 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Fri, Jan 29, 2016 at 10:34:59AM +, David Vrabel wrote: >> On 29/01/16 02:31, Andy Lutomirski wrote: >> > Signed-off-by: Andy Lutomirski <l...@kernel.org> >> > ---

Re: [PATCH v5 00/10] virtio DMA API, yet again

2016-01-31 Thread Andy Lutomirski
On Sun, Jan 31, 2016 at 12:12 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Thu, Jan 28, 2016 at 06:31:13PM -0800, Andy Lutomirski wrote: >> This switches virtio to use the DMA API on Xen and if requested by >> module option. >> >> This fixes virtio on

[PATCH v5 05/10] virtio_ring: Support DMA APIs

2016-01-28 Thread Andy Lutomirski
"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 Lut

[PATCH v5 07/10] virtio_mmio: Use the DMA API if enabled

2016-01-28 Thread Andy Lutomirski
This switches to vring_create_virtqueue, simplifying the driver and adding DMA API support. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_mmio.c | 67 ++-- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git a/d

[PATCH v5 06/10] virtio: Add improved queue allocation API

2016-01-28 Thread Andy Lutomirski
on which it's worthwhile.) __vring_new_virtqueue: Creates a virtqueue with a manually-specified layout. This should allow mic_virtio to work much more cleanly. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c

[PATCH v5 01/10] dma: Provide simple noop dma ops

2016-01-28 Thread Andy Lutomirski
From: Christian Borntraeger We are going to require dma_ops for several common drivers, even for systems that do have an identity mapping. Lets provide some minimal no-op dma_ops that can be used for that purpose. Signed-off-by: Christian Borntraeger

[PATCH v5 02/10] alpha/dma: use common noop dma ops

2016-01-28 Thread Andy Lutomirski
From: Christian Borntraeger Some of the alpha pci noop dma ops are identical to the common ones. Use them. Signed-off-by: Christian Borntraeger Reviewed-by: Joerg Roedel --- arch/alpha/kernel/pci-noop.c | 46

[PATCH v5 00/10] virtio DMA API, yet again

2016-01-28 Thread Andy Lutomirski
vring_mapping_error incorrect argument Changes from v1: - Fix an endian conversion error causing a BUG to hit. - Fix a DMA ordering issue (swiotlb=force works now). - Minor cleanups. Andy Lutomirski (7): vring: Introduce vring_use_dma_api() virtio_ring: Support DMA APIs virtio: Add improved

[PATCH v5 04/10] vring: Introduce vring_use_dma_api()

2016-01-28 Thread Andy Lutomirski
This is a kludge, but no one has come up with a a better idea yet. We'll introduce DMA API support guarded by vring_use_dma_api(). Eventually we may be able to return true on more and more systems, and hopefully we can get rid of vring_use_dma_api() entirely some day. Signed-off-by: Andy

[PATCH v5 08/10] virtio_pci: Use the DMA API if enabled

2016-01-28 Thread Andy Lutomirski
as virtio-pci running under Xen. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_pci_common.h | 6 drivers/virtio/virtio_pci_legacy.c | 42 +++--- drivers/virtio/virtio_pci_modern.c | 61 ++ 3 files chang

[PATCH v5 03/10] s390/dma: Allow per device dma ops

2016-01-28 Thread Andy Lutomirski
From: Christian Borntraeger As virtio-ccw will have dma ops, we can no longer default to the zPCI ones. Make use of dev_archdata to keep the dma_ops per device. The pci devices now use that to override the default, and the default is changed to use the noop ops for

[PATCH v5 10/10] vring: Add a module parameter to force-enable the DMA API

2016-01-28 Thread Andy Lutomirski
This will be useful for testing. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 305c05cc249a..46fb77d824e9

[PATCH v5 09/10] vring: Use the DMA API on Xen

2016-01-28 Thread Andy Lutomirski
Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c169c6444637..305c05cc249a 100644 --- a/drivers/virtio/virtio_ring.c +++ b/d

Re: [PATCH 3/4] x86,asm: Re-work smp_store_mb()

2016-01-12 Thread Andy Lutomirski
On 01/12/2016 09:20 AM, Linus Torvalds wrote: On Tue, Jan 12, 2016 at 5:57 AM, Michael S. Tsirkin wrote: #ifdef xchgrz /* same as xchg but poking at gcc red zone */ #define barrier() do { int ret; asm volatile ("xchgl %0, -4(%%" SP ");": "=r"(ret) :: "memory", "cc"); } while

Re: [PATCH 3/4] x86,asm: Re-work smp_store_mb()

2016-01-12 Thread Andy Lutomirski
On Tue, Jan 12, 2016 at 12:54 PM, Linus Torvalds <torva...@linux-foundation.org> wrote: > On Tue, Jan 12, 2016 at 12:30 PM, Andy Lutomirski <l...@kernel.org> wrote: >> >> I recall reading somewhere that lock addl $0, 32(%rsp) or so (maybe even 64) >> was better be

Re: [Xen-devel] [PATCH RFC 0/3] Xen on Virtio

2016-01-11 Thread Andy Lutomirski
On Tue, Dec 15, 2015 at 12:40 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Mon, Dec 14, 2015 at 10:27:52AM -0800, Andy Lutomirski wrote: >> On Mon, Dec 14, 2015 at 6:12 AM, Michael S. Tsirkin <m...@redhat.com> wrote: >> > On Mon, Dec 14, 2015 at 02:00:

Re: [Xen-devel] [PATCH RFC 0/3] Xen on Virtio

2015-12-15 Thread Andy Lutomirski
On Tue, Dec 15, 2015 at 4:13 AM, Stefano Stabellini <stefano.stabell...@eu.citrix.com> wrote: > On Mon, 14 Dec 2015, Andy Lutomirski wrote: >> On Mon, Dec 14, 2015 at 6:12 AM, Michael S. Tsirkin <m...@redhat.com> wrote: >> > On Mon, Dec 14, 2015 at 02:00:05PM +, D

Re: [Xen-devel] [PATCH v2 0/3] Fix and cleanup for 32-bit PV sysexit

2015-12-15 Thread Andy Lutomirski
On Tue, Dec 15, 2015 at 12:40 PM, Andrew Cooper <andrew.coop...@citrix.com> wrote: > On 19/11/15 22:07, Andy Lutomirski wrote: >> On Thu, Nov 19, 2015 at 1:55 PM, Boris Ostrovsky >> <boris.ostrov...@oracle.com> wrote: >>> The first patch fixes Xen PV reg

Re: [PATCH v2 1/3] x86/xen: Avoid fast syscall path for Xen PV guests

2015-12-15 Thread Andy Lutomirski
'd think 4.4 only for this fix too? Yes? > > > Oh, I didn't realize this is scheduled for 4.5. It indeed needs to go into > 4.4 because of 5f310f739b4c. Agreed. > > Thanks. > -boris > > > -- Andy Lutomirski AMA Capital Management, LLC

Re: [Xen-devel] [PATCH RFC 0/3] Xen on Virtio

2015-12-14 Thread Andy Lutomirski
e the memory in >> > detach_buf (see patch #3). >> > >> > Instead this series adds few obvious checks to perform address >> > translations in a couple of key places, without changing non-Xen code >> > paths. You are welcome to suggest improvements or a

Re: [PATCH v2 0/3] Fix and cleanup for 32-bit PV sysexit

2015-11-19 Thread Andy Lutomirski
ompat mode) pv ops, as suggested by Andy. > > As result of this patch irq_enable_sysexit and usergs_sysret32 pv ops are not > used anymore by anyone and so can be removed. This whole series is: Acked-by: Andy Lutomirski <l...@kernel.org> Now I just have to sucker someone into getting rid o

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-11-19 Thread Andy Lutomirski
On Nov 19, 2015 5:45 AM, "Michael S. Tsirkin" <m...@redhat.com> wrote: > > On Tue, Oct 27, 2015 at 11:38:57PM -0700, Andy Lutomirski wrote: > > This switches virtio to use the DMA API unconditionally. I'm sure > > it breaks things, but it see

Re: [PATCH 2/3] x86: irq_enable_sysexit pv op is no longer needed

2015-11-18 Thread Andy Lutomirski
On Wed, Nov 18, 2015 at 12:06 PM, Boris Ostrovsky wrote: > Xen PV guests have been the only ones using it and now they don't. Fantastic! --Andy ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH 3/3] x86: usergs_sysret32 pv op is no longer needed

2015-11-18 Thread Andy Lutomirski
On Wed, Nov 18, 2015 at 12:06 PM, Boris Ostrovsky wrote: > Xen PV guests have been the only ones using it and now they don't. Yay! --Andy ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH 1/3] x86/xen: Avoid fast syscall path for Xen PV guests

2015-11-18 Thread Andy Lutomirski
On Wed, Nov 18, 2015 at 12:50 PM, Brian Gerst <brge...@gmail.com> wrote: > On Wed, Nov 18, 2015 at 3:21 PM, Andy Lutomirski <l...@amacapital.net> wrote: >> On Wed, Nov 18, 2015 at 12:06 PM, Boris Ostrovsky >> <boris.ostrov...@oracle.com> wrote: >>> Afte

Re: [PATCH 1/3] x86/xen: Avoid fast syscall path for Xen PV guests

2015-11-18 Thread Andy Lutomirski
On Wed, Nov 18, 2015 at 12:06 PM, Boris Ostrovsky wrote: > After 32-bit syscall rewrite, and specifically after commit 5f310f739b4c > ("x86/entry/32: Re-implement SYSENTER using the new C path"), the stack > frame that is passed to xen_sysexit is no longer a "standard"

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-11-11 Thread Andy Lutomirski
On Wed, Nov 11, 2015 at 2:05 AM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Tue, Nov 10, 2015 at 10:54:21AM -0800, Andy Lutomirski wrote: >> On Nov 10, 2015 7:02 AM, "Michael S. Tsirkin" <m...@redhat.com> wrote: >> > >> > On Sun, Nov

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-11-10 Thread Andy Lutomirski
On Nov 10, 2015 7:02 AM, "Michael S. Tsirkin" wrote: > > On Sun, Nov 08, 2015 at 12:49:46PM +0100, Joerg Roedel wrote: > > On Sun, Nov 08, 2015 at 12:37:47PM +0200, Michael S. Tsirkin wrote: > > > I have no problem with that. For example, can we teach > > > the DMA API on intel

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-11-10 Thread Andy Lutomirski
On Nov 10, 2015 2:38 AM, "Benjamin Herrenschmidt" <b...@kernel.crashing.org> wrote: > > On Mon, 2015-11-09 at 21:35 -0800, Andy Lutomirski wrote: > > > > We could do it the other way around: on powerpc, if a PCI device is in > > that range and doesn't have

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-11-10 Thread Andy Lutomirski
On Tue, Nov 10, 2015 at 2:27 PM, Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote: > On Tue, 2015-11-10 at 10:54 -0800, Andy Lutomirski wrote: >> >> Does that work on powerpc on existing kernels? >> >> Anyway, here's another crazy idea: make the quirk ass

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-11-10 Thread Andy Lutomirski
On Nov 10, 2015 4:44 PM, "Benjamin Herrenschmidt" <b...@kernel.crashing.org> wrote: > > On Tue, 2015-11-10 at 15:44 -0800, Andy Lutomirski wrote: > > > > > What about partition <-> partition virtio such as what we could do on > > >

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-11-09 Thread Andy Lutomirski
On Mon, Nov 9, 2015 at 9:28 PM, Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote: > On Mon, 2015-11-09 at 18:18 -0800, Andy Lutomirski wrote: >> >> /* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. >> */ >> static const struct

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-11-09 Thread Andy Lutomirski
On Mon, Nov 9, 2015 at 9:26 PM, Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote: > On Mon, 2015-11-09 at 18:18 -0800, Andy Lutomirski wrote: >> >> Which leaves the special case of Xen, where even preexisting devices >> don't bypass the IOMMU. Can we ke

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-11-09 Thread Andy Lutomirski
On Mon, Nov 9, 2015 at 6:04 PM, Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote: > On Mon, 2015-11-09 at 16:46 -0800, Andy Lutomirski wrote: >> The problem here is that in some of the problematic cases the virtio >> driver may not even be loaded. If som

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-11-09 Thread Andy Lutomirski
On Mon, Nov 9, 2015 at 2:58 PM, Benjamin Herrenschmidt wrote: > So ... > > I've finally tried to sort that out for powerpc and I can't find a way > to make that work that isn't a complete pile of stinking shit. > > I'm very tempted to go back to my original idea: virtio

Re: [PATCH 3/3] s390/dma: Allow per device dma ops

2015-11-05 Thread Andy Lutomirski
On 11/05/2015 01:33 AM, Christian Borntraeger wrote: Am 03.11.2015 um 13:26 schrieb Cornelia Huck: On Tue, 3 Nov 2015 12:54:39 +0100 Christian Borntraeger wrote: As virtio-ccw now has dma ops, we can no longer default to the PCI ones. Make use of dev_archdata to keep

Re: [GIT PULL v4 0/3] dma and virtio prep patches

2015-11-05 Thread Andy Lutomirski
On Thu, Nov 5, 2015 at 12:08 PM, Christian Borntraeger wrote: > Andy, > > to make it obvious which version is the latest, here is a branch > > The following changes since commit 6a13feb9c82803e2b815eca72fa7a9f5561d7861: > > Linux 4.3 (2015-11-01 16:05:25 -0800) > > are

[PATCH v4 3/6] virtio_pci: Use the DMA API

2015-11-01 Thread Andy Lutomirski
and teach virtqueue_get_avail and virtqueue_get_used to return DMA addresses directly. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_pci_common.h | 3 ++- drivers/virtio/virtio_pci_legacy.c | 19 +++ drivers/virtio/virtio_pci_modern.

[PATCH v4 6/6] virtio_pci: Use the DMA API

2015-11-01 Thread Andy Lutomirski
This switches to vring_create_virtqueue, simplifying the driver and adding DMA API support. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_pci_common.h | 7 - drivers/virtio/virtio_pci_legacy.c | 39 +++- drivers/virtio/virtio_pci_mo

[PATCH v4 5/6] virtio_mmio: Use the DMA API

2015-11-01 Thread Andy Lutomirski
This switches to vring_create_virtqueue, simplifying the driver and adding DMA API support. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_mmio.c | 67 ++-- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git a/d

[PATCH v4 4/6] virtio: Add improved queue allocation API

2015-11-01 Thread Andy Lutomirski
on which it's worthwhile.) __vring_new_virtqueue: Creates a virtqueue with a manually-specified layout. This should allow mic_virtio to work much more cleanly. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_ring.c

[PATCH v3 3/3] virtio_pci: Use the DMA API

2015-11-01 Thread Andy Lutomirski
and teach virtqueue_get_avail and virtqueue_get_used to return DMA addresses directly. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/virtio_pci_common.h | 3 ++- drivers/virtio/virtio_pci_legacy.c | 19 +++ drivers/virtio/virtio_pci_modern.

[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack

2015-11-01 Thread Andy Lutomirski
From: Andy Lutomirski <l...@amacapital.net> Once virtio starts using the DMA API, we won't be able to safely DMA from the stack. virtio-net does a couple of config DMA requests from small stack buffers -- switch to using dynamically-allocated memory. This should have no effect

[PATCH v4 0/6] virtio core DMA API conversion

2015-11-01 Thread Andy Lutomirski
. Andy Lutomirski (5): virtio_ring: Support DMA APIs virtio_pci: Use the DMA API virtio: Add improved queue allocation API virtio_mmio: Use the DMA API virtio_pci: Use the DMA API Michael S. Tsirkin (1): virtio-net: Stop doing DMA from the stack drivers/net/virtio_net.c

[PATCH v3 1/3] virtio_net: Stop doing DMA from the stack

2015-11-01 Thread Andy Lutomirski
From: Andy Lutomirski <l...@amacapital.net> Once virtio starts using the DMA API, we won't be able to safely DMA from the stack. virtio-net does a couple of config DMA requests from small stack buffers -- switch to using dynamically-allocated memory. This should have no effect

[PATCH v3 2/3] virtio_ring: Support DMA APIs

2015-11-01 Thread Andy Lutomirski
ed, virtfs survives kmemleak and CONFIG_DMA_API_DEBUG. Signed-off-by: Andy Lutomirski <l...@kernel.org> --- drivers/virtio/Kconfig | 2 +- drivers/virtio/virtio_ring.c | 187 +++ tools/virtio/linux/dma-mapping.h | 17 3 files changed, 169 i

[PATCH v3 0/3] virtio DMA API core stuff

2015-11-01 Thread Andy Lutomirski
. Changes from v1: - Fix an endian conversion error causing a BUG to hit. - Fix a DMA ordering issue (swiotlb=force works now). - Minor cleanups. Andy Lutomirski (3): virtio_net: Stop doing DMA from the stack virtio_ring: Support DMA APIs virtio_pci: Use the DMA API drivers/net/virtio_net.c

Re: [PATCH v4 1/6] virtio-net: Stop doing DMA from the stack

2015-10-30 Thread Andy Lutomirski
On Fri, Oct 30, 2015 at 6:55 AM, Christian Borntraeger <borntrae...@de.ibm.com> wrote: > Am 30.10.2015 um 02:09 schrieb Andy Lutomirski: >> From: "Michael S. Tsirkin" <m...@redhat.com> >> >> Once virtio starts using the DMA API, we won't be able to saf

Re: [PATCH v2 1/3] virtio_net: Stop doing DMA from the stack

2015-10-29 Thread Andy Lutomirski
On Wed, Oct 28, 2015 at 12:07 AM, Michael S. Tsirkin <m...@redhat.com> wrote: > How about this instead? Less code, more robust. > > Warning: untested. If you do like this approach, Tested-by would be > appreciated. I like it. Tested-by: Andy Lutomirski <l..

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-10-29 Thread Andy Lutomirski
On Thu, Oct 29, 2015 at 6:09 PM, Andy Lutomirski <l...@kernel.org> wrote: > This switches virtio to use the DMA API unconditionally. I'm sure > it breaks things, but it seems to work on x86 using virtio-pci, with > and without Xen, and using both the modern 1.0 variant and the &

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Andy Lutomirski
On Tue, Oct 27, 2015 at 11:53 PM, David Woodhouse <dw...@infradead.org> wrote: > On Tue, 2015-10-27 at 23:38 -0700, Andy Lutomirski wrote: >> >> Changes from v2: >> - Fix really embarrassing bug. This version actually works. > > So embarrassing you didn't want

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Andy Lutomirski
On Wed, Oct 28, 2015 at 9:12 AM, Michael S. Tsirkin wrote: > On Wed, Oct 28, 2015 at 11:32:34PM +0900, David Woodhouse wrote: >> > I don't have a problem with extending DMA API to address >> > more usecases. >> >> No, this isn't an extension. This is fixing a bug, on certain

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 4:21 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Tue, 2015-07-28 at 15:43 -0700, Andy Lutomirski wrote: Let me try to summarize a proposal: Add a feature flag that indicates IOMMU support. New kernels acknowledge that flag on any device

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
Let me try to summarize a proposal: Add a feature flag that indicates IOMMU support. New kernels acknowledge that flag on any device that advertises it. New kernels always respect the IOMMU (except on PowerPC). New kernels optionally refuse to talk to devices that don't have that feature flag

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 5:36 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Tue, 2015-07-28 at 16:33 -0700, Andy Lutomirski wrote: On Tue, Jul 28, 2015 at 4:21 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Tue, 2015-07-28 at 15:43 -0700, Andy Lutomirski wrote

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Jul 28, 2015 6:11 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2015-07-28 15:06, Michael S. Tsirkin wrote: On Tue, Jul 28, 2015 at 02:46:20PM +0200, Paolo Bonzini wrote: On 28/07/2015 12:12, Benjamin Herrenschmidt wrote: That is an experimental feature (it's x-iommu), so it can

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 9:44 AM, Jan Kiszka jan.kis...@siemens.com wrote: The ability to have virtio on systems with IOMMU in place makes testing much more efficient for us. Ideally, we would have it in non-identity mapping scenarios as well, e.g. to start secondary Linux instances in the test

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2015-07-28 19:10, Andy Lutomirski wrote: The trouble is that this is really a property of the bus and not of the device. If you build a virtio device that physically plugs into a PCIe slot, the device has no concept

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 12:06 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2015-07-28 20:22, Andy Lutomirski wrote: On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2015-07-28 19:10, Andy Lutomirski wrote: The trouble is that this is really a property of the bus

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 12:33 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2015-07-28 21:24, Andy Lutomirski wrote: On Tue, Jul 28, 2015 at 12:06 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2015-07-28 20:22, Andy Lutomirski wrote: On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka jan.kis

Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-27 Thread Andy Lutomirski
On Mon, Sep 1, 2014 at 10:39 AM, Andy Lutomirski l...@amacapital.net wrote: This fixes virtio on Xen guests as well as on any other platform that uses virtio_pci on which physical addresses don't match bus addresses. This can be tested with: virtme-run --xen xen --kimg arch/x86/boot

Re: [PATCH v4 10/10] x86: Support compiling out userspace IO (iopl and ioperm)

2014-11-03 Thread Andy Lutomirski
On 11/03/2014 07:27 AM, One Thousand Gnomes wrote: This isn't unreasonable but there are drivers with userspace helpers that use iopl/ioperm type functionality where you should be doing a SELECT of X86_IOPORT. The one that comes to mind is the uvesa driver. From a quick scan it may these days

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-30 Thread Andy Lutomirski
On Thu, Oct 30, 2014 at 5:21 AM, David Vrabel david.vra...@citrix.com wrote: On 29/10/14 05:19, Andy Lutomirski wrote: CPUID leaf 4F02H: miscellaneous features [...] ### CommonHV RNG If CPUID.4F02H.EAX is nonzero, then it contains an MSR

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-29 Thread Andy Lutomirski
On Oct 29, 2014 8:17 AM, Ian Jackson ian.jack...@eu.citrix.com wrote: Andy Lutomirski writes ([Xen-devel] [RFC] Hypervisor RNG and enumeration): Here's a draft CommonHV spec. It's also on github: https://github.com/amluto/CommonHV This a worthwhile direction to investigate

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-29 Thread Andy Lutomirski
-- Andy Lutomirski AMA Capital Management, LLC ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-29 Thread Andy Lutomirski
get most of the benefit. --Andy -- Jake Oshins -- Andy Lutomirski AMA Capital Management, LLC ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[RFC] Hypervisor RNG and enumeration

2014-10-28 Thread Andy Lutomirski
Here's a draft CommonHV spec. It's also on github: https://github.com/amluto/CommonHV So far, this provides a two-way RNG interface, a way to detect it, and a way to detect other hypervisor leaves. The latter is because, after both the enormous public thread and some private discussions, it

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-07 Thread Andy Lutomirski
On 10/07/2014 07:39 AM, Cornelia Huck wrote: This patchset aims to get us some way to implement virtio-1 compliant and transitional devices in qemu. Branch available at git://github.com/cohuck/qemu virtio-1 I've mainly focused on: - endianness handling - extended feature bits -

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-30 Thread Andy Lutomirski
On Tue, Sep 30, 2014 at 8:38 AM, Michael S. Tsirkin m...@redhat.com wrote: I thought hard about this, I think we are better off waiting till the next release: there's a chance QEMU will have IOMMU support for KVM x86 then, and this will make it easier to judge which way does the wind blow.

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-30 Thread Andy Lutomirski
On Tue, Sep 30, 2014 at 8:48 AM, Andy Lutomirski l...@amacapital.net wrote: On Tue, Sep 30, 2014 at 8:38 AM, Michael S. Tsirkin m...@redhat.com wrote: Maybe we should disable the IOMMU in 2.2, this is worth considering. Please do. Also, try booting this 2.2 QEMU candidate with nested

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-30 Thread Andy Lutomirski
On Tue, Sep 30, 2014 at 10:53 AM, Konrad Rzeszutek Wilk konrad.w...@oracle.com wrote: x86 will be worse than PPC, too: the special case needed to support QEMU 2.2 with IOMMU and virtio enabled with a Xen guest will be fairly large and disgusting and will only exist to support something that IMO

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-30 Thread Andy Lutomirski
On Tue, Sep 30, 2014 at 8:38 AM, Michael S. Tsirkin m...@redhat.com wrote: On Mon, Sep 29, 2014 at 01:55:11PM -0700, Andy Lutomirski wrote: On Mon, Sep 29, 2014 at 1:49 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Mon, 2014-09-29 at 11:55 -0700, Andy Lutomirski wrote

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-29 Thread Andy Lutomirski
On Wed, Sep 17, 2014 at 7:16 AM, Michael S. Tsirkin m...@redhat.com wrote: On Wed, Sep 17, 2014 at 08:02:31AM -0400, Benjamin Herrenschmidt wrote: On Tue, 2014-09-16 at 22:22 -0700, Andy Lutomirski wrote: On non-PPC systems, virtio_pci should use the DMA API. This fixes virtio_pci on Xen

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 1:49 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Mon, 2014-09-29 at 11:55 -0700, Andy Lutomirski wrote: Rusty and Michael, what's the status of this? The status is that I still think we need *a* way to actually inform the guest whether the virtio

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-24 Thread Andy Lutomirski
On Sat, Sep 20, 2014 at 10:05 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Sun, 2014-09-21 at 15:03 +1000, Benjamin Herrenschmidt wrote: The exception I mentioned is that I would really like the virtio device to expose via whatever transport we chose to use (though capability

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-24 Thread Andy Lutomirski
On Wed, Sep 24, 2014 at 2:50 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Wed, 2014-09-24 at 14:41 -0700, Andy Lutomirski wrote: On Sat, Sep 20, 2014 at 10:05 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Sun, 2014-09-21 at 15:03 +1000, Benjamin Herrenschmidt

Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible

2014-09-24 Thread Andy Lutomirski
On Wed, Sep 24, 2014 at 3:04 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Wed, 2014-09-24 at 14:59 -0700, Andy Lutomirski wrote: Scratch that idea, then. The best that I can currently come up with is to say that pre-1.0 devices on PPC bypass the IOMMU and that 1.0 devices

<    1   2   3   >