Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-21 Thread Benjamin Herrenschmidt
On Wed, 2012-06-20 at 16:16 -0500, Anthony Liguori wrote: > > diff --git a/qemu-common.h b/qemu-common.h > > index 8f87e41..80026af 100644 > > --- a/qemu-common.h > > +++ b/qemu-common.h > > @@ -264,6 +264,7 @@ typedef struct EventNotifier EventNotifier; > > typedef struct VirtIODevice VirtIODevi

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread David Gibson
On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: [snip] > >diff --git a/qemu-common.h b/qemu-common.h > >index 8f87e41..80026af 100644 > >--- a/qemu-common.h > >+++ b/qemu-common.h > >@@ -264,6 +264,7 @@ typedef struct EventNotifier EventNotifier; > > typedef struct VirtIODevice Vi

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Anthony Liguori
On 06/20/2012 04:40 PM, Michael S. Tsirkin wrote: On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: diff --git a/qemu-common.h b/qemu-common.h index 8f87e41..80026af 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -264,6 +264,7 @@ typedef struct EventNotifier EventNotifier; ty

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Michael S. Tsirkin
On Wed, Jun 20, 2012 at 04:46:49PM -0500, Anthony Liguori wrote: > On 06/20/2012 04:42 PM, Michael S. Tsirkin wrote: > >On Wed, Jun 20, 2012 at 04:38:30PM -0500, Anthony Liguori wrote: > >>On 06/20/2012 04:32 PM, Michael S. Tsirkin wrote: > >>>On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguo

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Anthony Liguori
On 06/20/2012 04:42 PM, Michael S. Tsirkin wrote: On Wed, Jun 20, 2012 at 04:38:30PM -0500, Anthony Liguori wrote: On 06/20/2012 04:32 PM, Michael S. Tsirkin wrote: On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: diff --git a/hw/pci.h b/hw/pci.h index 7f223c0..ee669d9 100644 -

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Michael S. Tsirkin
On Wed, Jun 20, 2012 at 04:38:30PM -0500, Anthony Liguori wrote: > On 06/20/2012 04:32 PM, Michael S. Tsirkin wrote: > >On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: > >>>diff --git a/hw/pci.h b/hw/pci.h > >>>index 7f223c0..ee669d9 100644 > >>>--- a/hw/pci.h > >>>+++ b/hw/pci.h >

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Michael S. Tsirkin
On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: > >diff --git a/qemu-common.h b/qemu-common.h > >index 8f87e41..80026af 100644 > >--- a/qemu-common.h > >+++ b/qemu-common.h > >@@ -264,6 +264,7 @@ typedef struct EventNotifier EventNotifier; > > typedef struct VirtIODevice VirtIODev

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Anthony Liguori
On 06/20/2012 04:32 PM, Michael S. Tsirkin wrote: On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: diff --git a/hw/pci.h b/hw/pci.h index 7f223c0..ee669d9 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -558,10 +558,16 @@ static inline uint32_t pci_config_size(const PCIDevice *d) }

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Benjamin Herrenschmidt
> > /* DMA access functions */ > > +static inline DMAContext *pci_dma_context(PCIDevice *dev) > > +{ > > +/* Stub for when we have no PCI iommu support */ > > +return NULL; > > +} > > Why is all of this stuff static inline? Why not ? Not doing so is gratuitous bloat & overhead > >

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Michael S. Tsirkin
On Wed, Jun 20, 2012 at 04:16:47PM -0500, Anthony Liguori wrote: > >diff --git a/hw/pci.h b/hw/pci.h > >index 7f223c0..ee669d9 100644 > >--- a/hw/pci.h > >+++ b/hw/pci.h > >@@ -558,10 +558,16 @@ static inline uint32_t pci_config_size(const PCIDevice > >*d) > > } > > > > /* DMA access functions *

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-20 Thread Anthony Liguori
On 06/19/2012 01:39 AM, Benjamin Herrenschmidt wrote: From: David Gibson Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devi

[Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-19 Thread Benjamin Herrenschmidt
From: David Gibson Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devices to go through IOMMU translation. Shortly before qe

[Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-05-09 Thread Benjamin Herrenschmidt
From: David Gibson Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devices to go through IOMMU translation. Shortly before qe