[Qemu-devel] [RFC PATCH 00/13] AMD IOMMU emulation patches, another try

2011-05-31 Thread Eduard - Gabriel Munteanu
hough I think you can give it a spin with the old ones, if you need). I'll also take care of submitting PCI ids to be merged into Linux. In any case, let me know what you think. I hope I didn't forget to Cc someone. Cheers, Eduard Eduard - Gabriel Munteanu (13): Generic DMA m

[Qemu-devel] [RFC PATCH 05/13] rtl8139: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/rtl8139.c | 98 ++--- 1 files changed, 52 insertions(+), 46 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index c7c7a3c

[Qemu-devel] [RFC PATCH 04/13] ide: use the DMA memory access interface for PCI IDE controllers

2011-05-31 Thread Eduard - Gabriel Munteanu
airly good approximation. Note this doesn't handle AHCI emulation yet! Signed-off-by: Eduard - Gabriel Munteanu --- dma-helpers.c | 23 ++- dma.h |4 +++- hw/ide/ahci.c |3 ++- hw/ide/internal.h |1 + hw/ide/macio.c|4 ++-- hw

[Qemu-devel] [RFC PATCH 02/13] pci: add IOMMU support via the generic DMA layer

2011-05-31 Thread Eduard - Gabriel Munteanu
IOMMUs can now be hooked onto the PCI bus. This makes use of the generic DMA layer. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.c |7 +++ hw/pci.h |9 + hw/pci_internals.h |1 + 3 files changed, 17 insertions(+), 0 deletions(-) diff --git a

[Qemu-devel] [RFC PATCH 09/13] e1000: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/e1000.c | 27 +++ 1 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index f160bfc..acfd329 100644 --- a/hw/e1000.c

[Qemu-devel] [RFC PATCH 07/13] ac97: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/ac97.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index d71072d..bad38fb 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -223,7

[Qemu-devel] [RFC PATCH 08/13] es1370: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/es1370.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/es1370.c b/hw/es1370.c index 40cb48c..1645dbd 100644 --- a/hw/es1370.c +++ b/hw/es1370.c

[Qemu-devel] [RFC PATCH 01/13] Generic DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This introduces replacements for memory access functions like cpu_physical_memory_read(). The new interface can handle address translation and access checking through an IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 +- hw/dma_rw.c | 155

[Qemu-devel] [RFC PATCH 11/13] pcnet: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pcnet-pci.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c index 9415a1e..6c2186e 100644 --- a/hw/pcnet-pci.c +++ b/hw

[Qemu-devel] [RFC PATCH 10/13] lsi53c895a: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/lsi53c895a.c | 24 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index be4df58..7bfc604 100644 --- a/hw

[Qemu-devel] [RFC PATCH 03/13] AMD IOMMU emulation

2011-05-31 Thread Eduard - Gabriel Munteanu
This introduces emulation for the AMD IOMMU, described in "AMD I/O Virtualization Technology (IOMMU) Specification". Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 +- hw/amd_iommu.c | 712 +++ hw/pc.c

[Qemu-devel] [RFC PATCH 12/13] usb-uhci: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/usb-uhci.c | 26 ++ 1 files changed, 14 insertions(+), 12 deletions(-) diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index 346db3e..1661e54 100644 --- a/hw/usb

[Qemu-devel] [RFC PATCH 06/13] eepro100: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/eepro100.c | 95 ++-- 1 files changed, 51 insertions(+), 44 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index

[Qemu-devel] [RFC PATCH 13/13] usb-ohci: use the DMA memory access interface

2011-05-31 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/usb-ohci.c | 46 +++--- 1 files changed, 31 insertions(+), 15 deletions(-) diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index d21c820..9d1cf91

Re: [Qemu-devel] [RFC PATCH 01/13] Generic DMA memory access interface

2011-06-01 Thread Eduard - Gabriel Munteanu
On Wed, Jun 01, 2011 at 07:01:42AM -0700, Richard Henderson wrote: > On 05/31/2011 06:38 PM, Eduard - Gabriel Munteanu wrote: > > +static inline void dma_memory_rw(DMADevice *dev, > > + dma_addr_t addr, > > +

Re: [Qemu-devel] [RFC PATCH 01/13] Generic DMA memory access interface

2011-06-01 Thread Eduard - Gabriel Munteanu
On Wed, Jun 01, 2011 at 08:09:29AM -0700, Richard Henderson wrote: > On 06/01/2011 07:52 AM, Eduard - Gabriel Munteanu wrote: > > The main selling point is there are more chances to screw up if every > > bus layer implements these manually. And it's really convenient, > &g

Re: [Qemu-devel] [PATCH 01/14] Generic DMA memory access interface

2011-06-02 Thread Eduard - Gabriel Munteanu
On Thu, Jun 02, 2011 at 09:43:32AM -0700, Richard Henderson wrote: > On 06/02/2011 08:12 AM, David Gibson wrote: > > +err = iommu->translate(dev, addr, &paddr, &plen, is_write); > > +if (err) { > > +return NULL; > > +} > > + > > +/* > > + * If this is true, the virtual r

Re: [Qemu-devel] [PATCH 01/14] Generic DMA memory access interface

2011-06-02 Thread Eduard - Gabriel Munteanu
On Thu, Jun 02, 2011 at 12:28:53PM -0700, Richard Henderson wrote: > On 06/02/2011 10:35 AM, Eduard - Gabriel Munteanu wrote: > > My latest patches seem to have fixed that: > > > > +if (plen < *len) { > > +*len = plen; > > +} > > + > &g

Re: [Qemu-devel] [PATCH 4/8] Add universal DMA helper functions

2012-02-26 Thread Eduard - Gabriel Munteanu
es will given information about any necessary IOMMU translation. > > > > DMA using devices must obtain a DMAContext (or, potentially, contexts) > > from their bus or platform. For now this patch just converts the PCI > > wrappers to be implemented in terms of the universal wrap

Re: [Qemu-devel] [PATCH 4/8] Add universal DMA helper functions

2012-02-26 Thread Eduard - Gabriel Munteanu
converts the PCI > wrappers to be implemented in terms of the universal wrappers, > converting other drivers can take place over time. > > Cc: Michael S. Tsirkin > Cc: Joerg Rodel > Cc: Eduard - Gabriel Munteanu > Cc: Richard Henderson > > Signed-off-by: David Gibson

Re: [Qemu-devel] [PATCH 4/8] Add universal DMA helper functions

2012-02-27 Thread Eduard - Gabriel Munteanu
On Mon, Feb 27, 2012 at 12:33:49PM +0200, Michael S. Tsirkin wrote: > On Mon, Feb 27, 2012 at 11:22:43AM +1100, David Gibson wrote: > > On Sun, Feb 26, 2012 at 12:04:49PM +0200, Michael S. Tsirkin wrote: > > > On Fri, Feb 24, 2012 at 02:27:39PM +1100, David Gibson wrote: [snip] > > > > > > I'm a

Re: [Qemu-devel] [0/10] Preliminary work for IOMMU emulation support; the easy bits

2011-09-01 Thread Eduard - Gabriel Munteanu
On Thu, Sep 01, 2011 at 03:00:53PM +1000, David Gibson wrote: > A while back, Eduard - Gabriel Munteanu send a series of patches > implementing support for emulating the AMD IOMMU in conjunction with > qemu emulated PCI devices. A revised patch series added support for > the Intel

Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models to do PCI DMA

2011-09-02 Thread Eduard - Gabriel Munteanu
On Fri, Sep 02, 2011 at 11:37:25AM +0300, Avi Kivity wrote: > On 09/01/2011 07:05 PM, Anthony Liguori wrote: > > > > The challenge is what you do about something like ne2k where the core > > chipset can either be a PCI device or an ISA device. You would have > > to implement a wrapper around pci

Re: [Qemu-devel] Supporting emulation of IOMMUs

2011-04-21 Thread Eduard - Gabriel Munteanu
On Thu, Apr 21, 2011 at 05:03:47PM +1000, David Gibson wrote: > A few months ago, Eduard - Gabriel Munteanu posted a series of patches > implementing support for emulating the AMD PCI IOMMU > (http://lists.nongnu.org/archive/html/qemu-devel/2011-01/msg03196.html). > > In fa

Re: [Qemu-devel] Supporting emulation of IOMMUs

2011-05-14 Thread Eduard - Gabriel Munteanu
On Tue, May 10, 2011 at 11:44:26AM +1000, David Gibson wrote: > On Thu, Apr 21, 2011 at 09:47:31PM +0300, Eduard - Gabriel Munteanu wrote: > > On Thu, Apr 21, 2011 at 05:03:47PM +1000, David Gibson wrote: > > > A few months ago, Eduard - Gabriel Munteanu posted a

[Qemu-devel] [PATCH 2/7] pci: memory access API and IOMMU support

2010-08-29 Thread Eduard - Gabriel Munteanu
). Clients (devices) must provide callbacks for map invalidation in case these maps are persistent beyond the current I/O context, e.g. AIO DMA transfers. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.c | 191 +++- hw/pci.h

[Qemu-devel] Re: [PATCH 2/7] pci: memory access API and IOMMU support

2010-08-29 Thread Eduard - Gabriel Munteanu
On Mon, Aug 30, 2010 at 01:08:23AM +0300, Eduard - Gabriel Munteanu wrote: > PCI devices should access memory through pci_memory_*() instead of > cpu_physical_memory_*(). This also provides support for translation and > access checking in case an IOMMU is emulated. > > Memory maps

Re: [Qemu-devel] [PATCH 3/7] AMD IOMMU emulation

2010-08-29 Thread Eduard - Gabriel Munteanu
On Mon, Aug 30, 2010 at 12:07:30PM +0900, Isaku Yamahata wrote: > On Sat, Aug 28, 2010 at 05:54:54PM +0300, Eduard - Gabriel Munteanu wrote: > > diff --git a/hw/pc.c b/hw/pc.c > > index a96187f..e2456b0 100644 > > --- a/hw/pc.c > > +++ b/hw/pc.c > > @@ -1068,6 +

[Qemu-devel] Re: [PATCH 1/7] pci: expand tabs to spaces in pci_regs.h

2010-08-31 Thread Eduard - Gabriel Munteanu
On Tue, Aug 31, 2010 at 11:29:53PM +0300, Michael S. Tsirkin wrote: > On Sat, Aug 28, 2010 at 05:54:52PM +0300, Eduard - Gabriel Munteanu wrote: > > The conversion was done using the GNU 'expand' tool (default settings) > > to make it obey the QEMU coding style. >

[Qemu-devel] Re: [PATCH 2/7] pci: memory access API and IOMMU support

2010-09-02 Thread Eduard - Gabriel Munteanu
On Thu, Sep 02, 2010 at 08:28:26AM +0300, Michael S. Tsirkin wrote: > On Sat, Aug 28, 2010 at 05:54:53PM +0300, Eduard - Gabriel Munteanu wrote: > > PCI devices should access memory through pci_memory_*() instead of > > cpu_physical_memory_*(). This also provides support for

Re: [Qemu-devel] [PATCH 2/7] pci: memory access API and IOMMU support

2010-09-02 Thread Eduard - Gabriel Munteanu
On Wed, Sep 01, 2010 at 10:10:30PM +0200, Stefan Weil wrote: > Please see my comments at the end of this mail. > > > Am 30.08.2010 00:08, schrieb Eduard - Gabriel Munteanu: > > PCI devices should access memory through pci_memory_*() instead of > > cpu_physical_memory

Re: [Qemu-devel] [PATCH 2/7] pci: memory access API and IOMMU support

2010-09-02 Thread Eduard - Gabriel Munteanu
On Thu, Sep 02, 2010 at 09:00:46AM +0300, Michael S. Tsirkin wrote: > On Wed, Sep 01, 2010 at 10:10:30PM +0200, Stefan Weil wrote: > > >+static inline void pci_memory_read(PCIDevice *dev, > > >+ pcibus_t addr, > > >+ uint8_t *buf, > > >+ pcibus_t len) > > >+{ > > >+ pci_memory_rw(dev, addr, buf, le

[Qemu-devel] Re: [PATCH 4/7] ide: use the PCI memory access interface

2010-09-02 Thread Eduard - Gabriel Munteanu
On Thu, Sep 02, 2010 at 08:19:11AM +0300, Michael S. Tsirkin wrote: > On Sat, Aug 28, 2010 at 05:54:55PM +0300, Eduard - Gabriel Munteanu wrote: > > Emulated PCI IDE controllers now use the memory access interface. This > > also allows an emulated IOMMU to translate and

[Qemu-devel] Re: [PATCH 4/7] ide: use the PCI memory access interface

2010-09-02 Thread Eduard - Gabriel Munteanu
On Thu, Sep 02, 2010 at 12:58:13PM +0300, Michael S. Tsirkin wrote: > On Thu, Sep 02, 2010 at 12:12:00PM +0300, Eduard - Gabriel Munteanu wrote: > > On Thu, Sep 02, 2010 at 08:19:11AM +0300, Michael S. Tsirkin wrote: > > > On Sat, Aug 28, 2010 at 05:54:55PM +0300, Eduard - Gabr

Re: [Qemu-devel] [PATCH 2/7] pci: memory access API and IOMMU support

2010-09-02 Thread Eduard - Gabriel Munteanu
On Thu, Sep 02, 2010 at 06:05:39PM +0200, Stefan Weil wrote: > Am 02.09.2010 10:51, schrieb Eduard - Gabriel Munteanu: [snip] > >> The functions pci_memory_read and pci_memory_write not only read > >> or write byte data but many different data types which leads to > &

[Qemu-devel] Re: [PATCH RFC] dma_rw.h (was Re: [PATCH 0/7] AMD IOMMU emulation patchset v4)

2010-09-16 Thread Eduard - Gabriel Munteanu
On Mon, Sep 13, 2010 at 10:01:20PM +0200, Michael S. Tsirkin wrote: > So I think the following will give the idea of what an API > might look like that will let us avoid the scary hacks in > e.g. the ide layer and other generic layers that need to do DMA, > without either binding us to pci, adding

Re: [Qemu-devel] [PATCH RFC] dma_rw.h (was Re: [PATCH 0/7] AMD IOMMU emulation patchset v4)

2010-09-16 Thread Eduard - Gabriel Munteanu
On Mon, Sep 13, 2010 at 03:45:34PM -0500, Anthony Liguori wrote: > On 09/13/2010 03:01 PM, Michael S. Tsirkin wrote: > > So I think the following will give the idea of what an API > > might look like that will let us avoid the scary hacks in > > e.g. the ide layer and other generic layers that need

[Qemu-devel] Re: [PATCH RFC] dma_rw.h (was Re: [PATCH 0/7] AMD IOMMU emulation patchset v4)

2010-09-16 Thread Eduard - Gabriel Munteanu
On Thu, Sep 16, 2010 at 11:20:43AM +0200, Michael S. Tsirkin wrote: > On Thu, Sep 16, 2010 at 10:06:16AM +0300, Eduard - Gabriel Munteanu wrote: [snip] > > No, DMADevice is a device that does DMA. > So e.g. a PCI device would embed one. > Remember, traslations are per device, rig

Re: [Qemu-devel] Re: [RFC PATCH] AMD IOMMU emulation

2010-05-25 Thread Eduard - Gabriel Munteanu
On Tue, May 25, 2010 at 10:39:22AM +0200, Joerg Roedel wrote: > On Mon, May 24, 2010 at 08:10:16PM +, Blue Swirl wrote: > > On Mon, May 24, 2010 at 3:40 PM, Joerg Roedel wrote: > > >> + > > >> +#define MMIO_SIZE ? ? ? ? ? ? ? 0x2028 > > > > > > This size should be a power-of-two value. In this

[Qemu-devel] [PATCH 00/13] AMD IOMMU emulation patchset

2011-01-29 Thread Eduard - Gabriel Munteanu
tches soon. Cheers, Eduard Eduard - Gabriel Munteanu (13): Generic DMA memory access interface pci: add IOMMU support via the generic DMA layer AMD IOMMU emulation ide: use the DMA memory access interface for PCI IDE controllers rtl8139: use the DMA memory access interface eepro10

[Qemu-devel] [PATCH 01/13] Generic DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This introduces replacements for memory access functions like cpu_physical_memory_read(). The new interface can handle address translation and access checking through an IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 +- hw/dma_rw.c | 124

[Qemu-devel] [PATCH 02/13] pci: add IOMMU support via the generic DMA layer

2011-01-29 Thread Eduard - Gabriel Munteanu
IOMMUs can now be hooked onto the PCI bus. This makes use of the generic DMA layer. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.c |7 +++ hw/pci.h |7 +++ hw/pci_internals.h |1 + 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 09/13] e1000: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/e1000.c | 26 +++--- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index af101bd..0d71650 100644 --- a/hw/e1000.c

[Qemu-devel] [PATCH 03/13] AMD IOMMU emulation

2011-01-29 Thread Eduard - Gabriel Munteanu
This introduces emulation for the AMD IOMMU, described in "AMD I/O Virtualization Technology (IOMMU) Specification". Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 +- hw/amd_iommu.c | 694 +++ hw/pc.c

[Qemu-devel] [PATCH 07/13] ac97: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/ac97.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index d71072d..383c1b3 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -223,7

[Qemu-devel] [PATCH 08/13] es1370: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/es1370.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/es1370.c b/hw/es1370.c index 40cb48c..8b1a405 100644 --- a/hw/es1370.c +++ b/hw/es1370.c

[Qemu-devel] [PATCH 06/13] eepro100: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/eepro100.c | 97 +--- 1 files changed, 57 insertions(+), 40 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index

[Qemu-devel] [PATCH 12/13] usb-uhci: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/usb-uhci.c | 26 ++ 1 files changed, 14 insertions(+), 12 deletions(-) diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index b9b822f..01b7f8b 100644 --- a/hw/usb

[Qemu-devel] [PATCH 10/13] lsi53c895a: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/lsi53c895a.c | 24 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 0129ae3..76bd631 100644 --- a/hw

[Qemu-devel] [PATCH 13/13] usb-ohci: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/usb-ohci.c | 54 +- 1 files changed, 37 insertions(+), 17 deletions(-) diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index 240e840

[Qemu-devel] [PATCH 05/13] rtl8139: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/rtl8139.c | 100 +- 1 files changed, 57 insertions(+), 43 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index a22530c

[Qemu-devel] [PATCH 11/13] pcnet: use the DMA memory access interface

2011-01-29 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pcnet-pci.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c index 339a401..3f55c42 100644 --- a/hw/pcnet-pci.c +++ b/hw

[Qemu-devel] [PATCH 04/13] ide: use the DMA memory access interface for PCI IDE controllers

2011-01-29 Thread Eduard - Gabriel Munteanu
airly good approximation. Note this doesn't handle AHCI emulation yet! Signed-off-by: Eduard - Gabriel Munteanu --- dma-helpers.c | 23 ++- dma.h |4 +++- hw/ide/ahci.c |3 ++- hw/ide/internal.h |1 + hw/ide/macio.c|4 ++-- hw

[Qemu-devel] [PATCH 1/3] pci: add pci_find_capability() helper

2011-02-03 Thread Eduard - Gabriel Munteanu
pci_find_capability() looks up a given capability and returns its offset. This is needed by AMD IOMMU initialization code. Signed-off-by: Eduard - Gabriel Munteanu --- src/pci.c | 15 +++ src/pci.h |1 + 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/pci.c

[Qemu-devel] [PATCH 2/3] AMD IOMMU support

2011-02-03 Thread Eduard - Gabriel Munteanu
This initializes the AMD IOMMU and creates ACPI tables for it. Signed-off-by: Eduard - Gabriel Munteanu --- src/acpi.c | 84 src/config.h |3 ++ src/pci_ids.h |1 + src/pci_regs.h |1 + src/pciinit.c | 29

[Qemu-devel] [PATCH 3/3] Clarify address space layout.

2011-02-03 Thread Eduard - Gabriel Munteanu
This clarifies the address space layout by commenting on where APIC, IOAPIC and AMD IOMMU building regions end. Signed-off-by: Eduard - Gabriel Munteanu --- src/config.h |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/config.h b/src/config.h index 0ba5723

[Qemu-devel] [PATCH 0/3] SeaBIOS AMD IOMMU initialization patches

2011-02-03 Thread Eduard - Gabriel Munteanu
Hi, Here are the SeaBIOS parts that initialize the AMD IOMMU. I was told an ack from other QEMU/KVM developers would be nice, so please have a look. Thanks, Eduard Eduard - Gabriel Munteanu (3): pci: add pci_find_capability() helper AMD IOMMU support Clarify address space layout

[Qemu-devel] Re: [PATCH 2/3] AMD IOMMU support

2011-02-06 Thread Eduard - Gabriel Munteanu
On Sun, Feb 06, 2011 at 01:47:57PM +0200, Michael S. Tsirkin wrote: > On Fri, Feb 04, 2011 at 01:24:14AM +0200, Eduard - Gabriel Munteanu wrote: Hi, [snip] > > +/* > > + * IVRS (I/O Virtualization Reporting Structure) table. > > + * > > + * Describes the AMD IOMM

[Qemu-devel] [RFC] Getting specific device from qdev structs

2010-06-21 Thread Eduard - Gabriel Munteanu
Hi, I'm working on implementing AMD IOMMU emulation in QEMU/KVM and I'm also creating an API for address translation and access checking. Ideally, this API should work with different kinds of devices and IOMMUs. These operations would typically require specific device information to figure out whi

Re: [Qemu-devel] [RFC] Getting specific device from qdev structs

2010-06-21 Thread Eduard - Gabriel Munteanu
On Mon, Jun 21, 2010 at 03:07:13PM +0100, Paul Brook wrote: > > So I've been looking for a way to obtain things like a PCIDevice from a > > more generic structure (say from hw/qdev.h), > > If you're having to figure out what kind of a device you have then I think > you're already doing something

[Qemu-devel] Status update

2010-06-29 Thread Eduard - Gabriel Munteanu
IDE and RTL8139 working, and Linux boots and works well with the IOMMU enabled. Cheers, Eduard diff --git a/hw/iommu.c b/hw/iommu.c new file mode 100644 index 000..410c88c --- /dev/null +++ b/hw/iommu.c @@ -0,0 +1,83 @@ +/* + * IOMMU layer + * + * Copyright (c) 2010 Eduard - Ga

[Qemu-devel] Re: Status update

2010-07-01 Thread Eduard - Gabriel Munteanu
On Wed, Jun 30, 2010 at 09:37:31AM +0100, Stefan Hajnoczi wrote: > On Tue, Jun 29, 2010 at 6:25 PM, Eduard - Gabriel Munteanu > wrote: > > On the other hand, we could just leave it alone for now. Changing > > mappings during DMA is stupid anyway: I don't think the gu

[Qemu-devel] Re: Status update

2010-07-02 Thread Eduard - Gabriel Munteanu
On Fri, Jul 02, 2010 at 09:03:39AM +0100, Stefan Hajnoczi wrote: > > That's true, but it's fair to be concerned about the guest itself. > > Imagine it runs some possibly malicious apps which program the hardware > > to do DMA. That should be safe when a IOMMU is present. > > > > But suddenly the gu

Re: [Qemu-devel] Re: Status update

2010-07-02 Thread Eduard - Gabriel Munteanu
On Fri, Jul 02, 2010 at 06:41:55PM +0900, Isaku Yamahata wrote: > On Fri, Jul 02, 2010 at 09:03:39AM +0100, Stefan Hajnoczi wrote: > > On Thu, Jul 1, 2010 at 8:30 PM, Eduard - Gabriel Munteanu > > wrote: > > > But suddenly the guest OS changes mappings and expects the IOM

[Qemu-devel] [RFC PATCH 0/7] AMD IOMMU emulation patchset

2010-07-13 Thread Eduard - Gabriel Munteanu
good idea - implementing features not used by Linux (e.g. interrupt remapping) That being said, any feedback is welcome. Thanks, Eduard P.S.: I'd also like to thank Paul Brook for his help on figuring out some aspects of the IOMMU layer. Eduard - Gabriel Munteanu (7): Gen

[Qemu-devel] [RFC PATCH 7/7] ac97: IOMMU support

2010-07-13 Thread Eduard - Gabriel Munteanu
Memory accesses must go through the IOMMU layer. Signed-off-by: Eduard - Gabriel Munteanu --- hw/ac97.c | 20 +--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index 4319bc8..0e30d80 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -15,6 +15,7

[Qemu-devel] [RFC PATCH 4/7] ide: IOMMU support

2010-07-13 Thread Eduard - Gabriel Munteanu
Memory accesses must go through the IOMMU layer. Signed-off-by: Eduard - Gabriel Munteanu --- hw/ide/core.c | 46 +++--- 1 files changed, 31 insertions(+), 15 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 0b3b7c2..7f8f7df 100644 --- a

[Qemu-devel] [RFC PATCH 1/7] Generic IOMMU layer

2010-07-13 Thread Eduard - Gabriel Munteanu
-specific hooks for this layer. Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |1 + hw/iommu.c | 82 + hw/iommu.h | 260 +++ hw/qdev.h |6 ++ 4 files changed, 349 insertions(+), 0 deletions

[Qemu-devel] [RFC PATCH 3/7] pci: call IOMMU hooks

2010-07-13 Thread Eduard - Gabriel Munteanu
Memory accesses must go through the IOMMU layer. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 6871728..9c5d706 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -22,6 +22,7

[Qemu-devel] [RFC PATCH 2/7] AMD IOMMU emulation

2010-07-13 Thread Eduard - Gabriel Munteanu
This introduces emulation for the AMD IOMMU, described in "AMD I/O Virtualization Technology (IOMMU) Specification". Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 + configure | 11 + hw/amd_iommu

[Qemu-devel] [RFC PATCH 6/7] eepro100: IOMMU support

2010-07-13 Thread Eduard - Gabriel Munteanu
Memory accesses must go through the IOMMU layer. Signed-off-by: Eduard - Gabriel Munteanu --- hw/eepro100.c | 141 + 1 files changed, 101 insertions(+), 40 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index 97afa2c..74e1d15

[Qemu-devel] [RFC PATCH 5/7] rtl8139: IOMMU support

2010-07-13 Thread Eduard - Gabriel Munteanu
Memory accesses must go through the IOMMU layer. Signed-off-by: Eduard - Gabriel Munteanu --- hw/rtl8139.c | 98 - 1 files changed, 62 insertions(+), 36 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 72e2242..0f78a69 100644

Re: [Qemu-devel] [RFC PATCH 1/7] Generic IOMMU layer

2010-07-14 Thread Eduard - Gabriel Munteanu
On Wed, Jul 14, 2010 at 10:07:20AM +0400, malc wrote: > On Wed, 14 Jul 2010, Eduard - Gabriel Munteanu wrote: > > > This provides an API for abstracting IOMMU functions. Hardware emulation > > code can use it to request address translation and access checking. In > > th

Re: [Qemu-devel] [RFC PATCH 3/7] pci: call IOMMU hooks

2010-07-14 Thread Eduard - Gabriel Munteanu
On Wed, Jul 14, 2010 at 04:37:39PM +0900, Isaku Yamahata wrote: > On Wed, Jul 14, 2010 at 08:45:03AM +0300, Eduard - Gabriel Munteanu wrote: [snip] > > PCIDevice *pci_register_device(PCIBus *bus, const char *name, > > int instance_

[Qemu-devel] Re: [RFC PATCH 4/7] ide: IOMMU support

2010-07-14 Thread Eduard - Gabriel Munteanu
On Wed, Jul 14, 2010 at 02:53:03PM +0100, Paul Brook wrote: > > Memory accesses must go through the IOMMU layer. > > No. Devices should not know or care whether an IOMMU is present. They don't really care. iommu_get() et al. are convenience functions which can and do return NULL when there's no I

Re: [Qemu-devel] Re: [RFC PATCH 4/7] ide: IOMMU support

2010-07-14 Thread Eduard - Gabriel Munteanu
On Wed, Jul 14, 2010 at 09:13:44PM +0100, Paul Brook wrote: > Well, ok, the function name needs fixing too. However I think the only thing > missing from the current API is that it does not provide a way to determine > which device is performing the access. > > Depending how the we decide to h

Re: [Qemu-devel] Re: [RFC PATCH 4/7] ide: IOMMU support

2010-07-15 Thread Eduard - Gabriel Munteanu
On Thu, Jul 15, 2010 at 07:45:06AM -0500, Anthony Liguori wrote: > > No. PCI devices should never call cpu_physical_memory*. > > PCI devices should call pci_memory*. > > ISA devices should call isa_memory*. > > All device memory accesses should go through their respective buses. > There can

Re: [Qemu-devel] Re: [RFC PATCH 4/7] ide: IOMMU support

2010-07-15 Thread Eduard - Gabriel Munteanu
On Thu, Jul 15, 2010 at 10:17:10AM -0700, Chris Wright wrote: > * Avi Kivity (a...@redhat.com) wrote: > > > > For emulated device, it seems like we can ignore ATS completely, no? > > Not if you want to emulate an ATS capable device ;) > > Eariler upthread I said: > > IOW, if qemu ever had a d

[Qemu-devel] [RFC PATCH 1/4] pci: memory access API and IOMMU support

2010-08-04 Thread Eduard - Gabriel Munteanu
). Clients (devices) must provide callbacks for map invalidation in case these maps are persistent beyond the current I/O context, e.g. AIO DMA transfers. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.c | 145 + hw/pci.h

[Qemu-devel] [RFC PATCH 0/4] AMD IOMMU emulation 2nd version

2010-08-04 Thread Eduard - Gabriel Munteanu
Thanks, Eduard Eduard - Gabriel Munteanu (4): pci: memory access API and IOMMU support AMD IOMMU emulation ide: use the PCI memory access interface rtl8139: use the PCI memory access interface Makefile.target |2 + configure | 10 + dma-helpers.c | 37 +

[Qemu-devel] [RFC PATCH 4/4] rtl8139: use the PCI memory access interface

2010-08-04 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/rtl8139.c | 99 - 1 files changed, 56 insertions(+), 43 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 72e2242

[Qemu-devel] [RFC PATCH 3/4] ide: use the PCI memory access interface

2010-08-04 Thread Eduard - Gabriel Munteanu
airly good approximation. Signed-off-by: Eduard - Gabriel Munteanu --- dma-helpers.c | 37 +++-- dma.h | 21 - hw/ide/core.c | 15 --- hw/ide/internal.h | 39 +++ hw/ide/

[Qemu-devel] [RFC PATCH 2/4] AMD IOMMU emulation

2010-08-04 Thread Eduard - Gabriel Munteanu
This introduces emulation for the AMD IOMMU, described in "AMD I/O Virtualization Technology (IOMMU) Specification". Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 + configure | 10 + hw/amd_iommu

Re: [Qemu-devel] [RFC PATCH 1/4] pci: memory access API and IOMMU support

2010-08-05 Thread Eduard - Gabriel Munteanu
On Thu, Aug 05, 2010 at 09:23:30PM +, Blue Swirl wrote: > On Wed, Aug 4, 2010 at 10:32 PM, Eduard - Gabriel Munteanu [snip] > > @@ -58,6 +58,10 @@ struct PCIBus { > > ?? ?? ?? ??Keep a count of the number of devices with raised IRQs. ??*/ > > ?? ?? int nirq; >

Re: [Qemu-devel] [RFC PATCH 2/4] AMD IOMMU emulation

2010-08-05 Thread Eduard - Gabriel Munteanu
On Thu, Aug 05, 2010 at 09:31:58PM +, Blue Swirl wrote: > On Wed, Aug 4, 2010 at 10:32 PM, Eduard - Gabriel Munteanu > wrote: [snip] > > diff --git a/Makefile.target b/Makefile.target > > index 70a9c1b..86226a0 100644 > > --- a/Makefile.target > > +++ b/Makefi

[Qemu-devel] [PATCH 1/2] Split region allocation code from pci_bios_init_device()

2010-08-15 Thread Eduard - Gabriel Munteanu
pci_bios_alloc() can be used to allocate space in the PCI region for other purposes. This is needed by the AMD IOMMU support code. Signed-off-by: Eduard - Gabriel Munteanu --- src/pciinit.c | 17 + 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/pciinit.c b

[Qemu-devel] [PATCH 2/2] AMD IOMMU support

2010-08-15 Thread Eduard - Gabriel Munteanu
This initializes the AMD IOMMU and creates ACPI tables for it. Signed-off-by: Eduard - Gabriel Munteanu --- Makefile |2 +- src/acpi.c | 79 src/iommu.c| 64 + src/iommu.h

[Qemu-devel] [PATCH 2/7] pci: memory access API and IOMMU support

2010-08-15 Thread Eduard - Gabriel Munteanu
). Clients (devices) must provide callbacks for map invalidation in case these maps are persistent beyond the current I/O context, e.g. AIO DMA transfers. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.c | 197 - hw/pci.h

[Qemu-devel] [PATCH 7/7] ac97: use the PCI memory access interface

2010-08-15 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/ac97.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index 4319bc8..9ee4894 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -223,7

[Qemu-devel] [PATCH 5/7] rtl8139: use the PCI memory access interface

2010-08-15 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/rtl8139.c | 99 - 1 files changed, 56 insertions(+), 43 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 72e2242

[Qemu-devel] [PATCH 1/7] pci: add range_covers_range()

2010-08-15 Thread Eduard - Gabriel Munteanu
This helper function allows map invalidation code to determine which maps must be invalidated. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.h | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/pci.h b/hw/pci.h index 4bd8a1a..5a6cdb5 100644 --- a/hw

[Qemu-devel] [PATCH 6/7] eepro100: use the PCI memory access interface

2010-08-15 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/eepro100.c | 78 ++--- 1 files changed, 41 insertions(+), 37 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index

[Qemu-devel] [PATCH 0/7] AMD IOMMU emulation patches v3

2010-08-15 Thread Eduard - Gabriel Munteanu
lways enabled (no more configure options) - cleaned up code, I now use typedefs as suggested - event logging cleanups BTW, the change to pci_regs.h is properly aligned but the original file contains tabs. Cheers, Eduard Eduard - Gabriel Munteanu (7): pci: add range_covers_

[Qemu-devel] [PATCH 3/7] AMD IOMMU emulation

2010-08-15 Thread Eduard - Gabriel Munteanu
This introduces emulation for the AMD IOMMU, described in "AMD I/O Virtualization Technology (IOMMU) Specification". Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 + hw/amd_iommu.c | 688 +++ hw/pc.c

[Qemu-devel] [PATCH 4/7] ide: use the PCI memory access interface

2010-08-15 Thread Eduard - Gabriel Munteanu
airly good approximation. Signed-off-by: Eduard - Gabriel Munteanu --- dma-helpers.c | 46 +- dma.h | 21 - hw/ide/core.c | 15 --- hw/ide/internal.h | 39 ++

[Qemu-devel] [PATCH 0/7] AMD IOMMU emulation patchset v4

2010-08-28 Thread Eduard - Gabriel Munteanu
t out myself") malc's ACK to the ac97 patch. Nothing changed since his last review. Please have a look and merge if you like it. Thanks, Eduard Eduard - Gabriel Munteanu (7): pci: expand tabs to spaces in pci_regs.h pci: memory access API and IOMMU support AMD IOMMU emul

[Qemu-devel] [PATCH 2/7] pci: memory access API and IOMMU support

2010-08-28 Thread Eduard - Gabriel Munteanu
). Clients (devices) must provide callbacks for map invalidation in case these maps are persistent beyond the current I/O context, e.g. AIO DMA transfers. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pci.c | 185 +++- hw/pci.h

[Qemu-devel] [PATCH 6/7] eepro100: use the PCI memory access interface

2010-08-28 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/eepro100.c | 86 ++-- 1 files changed, 46 insertions(+), 40 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index

[Qemu-devel] [PATCH 7/7] ac97: use the PCI memory access interface

2010-08-28 Thread Eduard - Gabriel Munteanu
This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu Acked-by: malc --- hw/ac97.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index d71072d..bad38fb 100644 --- a/hw/ac97.c +++ b/hw/ac97

[Qemu-devel] [PATCH 3/7] AMD IOMMU emulation

2010-08-28 Thread Eduard - Gabriel Munteanu
This introduces emulation for the AMD IOMMU, described in "AMD I/O Virtualization Technology (IOMMU) Specification". Signed-off-by: Eduard - Gabriel Munteanu --- Makefile.target |2 +- hw/amd_iommu.c | 663 +++ hw/pc.c

  1   2   >