iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
To: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Cc: Joerg Roedel <joro@8bytes.org>,
	schwidefsky@de.ibm.com, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org, iommu@lists.linux-foundation.org,
	sebott@linux.vnet.ibm.com
Subject: Re: [PATCH linux-next] iommu: add iommu for s390 platform
Date: Mon, 27 Oct 2014 15:32:01 +0100	[thread overview]
Message-ID: <20141027153201.517f4ff4@thinkpad> (raw)
In-Reply-To: <20141023140437.GA31009@tuxmaker.boeblingen.de.ibm.com>

On Thu, 23 Oct 2014 16:04:37 +0200
Frank Blaschka <blaschka@linux.vnet.ibm.com> wrote:

> On Thu, Oct 23, 2014 at 02:41:15PM +0200, Joerg Roedel wrote:
> > On Wed, Oct 22, 2014 at 05:43:20PM +0200, Frank Blaschka wrote:
> > > Basically there are no limitations. Depending on the s390 maschine
> > > generation a device starts its IOVA at a specific address
> > > (announced by the HW). But as I already told each device starts
> > > at the same address. I think this prevents having multiple
> > > devices on the same IOMMU domain.
> > 
> > Why, each device has its own IOVA address space, so IOVA A could
> > map to physical address X for one device and to Y for another, no?
> > And if you point multiple devices to the same dma_table they share
> > the mappings (and thus the address space). Or am I getting
> > something wrong?
> > 
> > > yes, you are absolutely right. There is a per-device dma_table.
> > > There is no general IOMMU device but each pci device has its own
> > > IOMMU translation capability.
> > 
> > I see, in this way it is similar to ARM where there is often also
> > one IOMMU per master device.
> > 
> > > Is there a possibility the IOMMU domain can support e.g.
> > > something like
> > > 
> > > VIOA 0x10000 -> pci device 1
> > > VIOA 0x10000 -> pci device 2
> > 
> > A domain is basically an abstraction for a DMA page table (or a
> > dma_table, as you call it on s390). So you can easily create similar
> > mappings for more than one device with it.
> >
> ok, maybe I was too close to the existing s390 dma implementation or
> simply wrong, maybe Sebastian or Gerald can give more background

Not sure if I understood the concept of IOMMU domains right. But if this
is about having multiple devices in the same domain, so that iommu_ops->map
will establish the _same_ DMA mapping on _all_ registered devices, then
this should be possible.

We cannot have shared DMA tables because each device gets its own DMA table
allocated during device initialization. But we could just keep all devices
from one domain in a list and then call dma_update_trans() for all devices
during iommu_ops->map/unmap.

Gerald

  parent reply	other threads:[~2014-10-27 14:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 11:57 [PATCH linux-next] iommu: add iommu for s390 platform Frank Blaschka
     [not found] ` <1413892645-37657-1-git-send-email-blaschka-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-10-22 14:17   ` Joerg Roedel
2014-10-22 15:43     ` Frank Blaschka
     [not found]       ` <20141022154320.GA42442-++28Fms/gMmXI4yAdoq52KN5r0PSdgG1zG2AekJRRhI@public.gmane.org>
2014-10-23 12:41         ` Joerg Roedel
     [not found]           ` <20141023124115.GB10053-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2014-10-23 14:04             ` Frank Blaschka
     [not found]               ` <20141023140437.GA31009-++28Fms/gMmXI4yAdoq52KN5r0PSdgG1zG2AekJRRhI@public.gmane.org>
2014-10-24 23:33                 ` Joerg Roedel
2014-10-27 14:32               ` Gerald Schaefer [this message]
2014-10-27 16:25                 ` Joerg Roedel
     [not found]                   ` <20141027162502.GB6202-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2014-10-27 17:02                     ` Gerald Schaefer
2014-10-27 17:58                       ` Joerg Roedel
     [not found]                         ` <20141027175835.GC6202-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2014-10-27 18:18                           ` Gerald Schaefer

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=20141027153201.517f4ff4@thinkpad \
    --to=gerald.schaefer@de.ibm.com \
    --cc=blaschka@linux.vnet.ibm.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    /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).