mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Varun Sethi <Varun.Sethi@freescale.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: "joro@8bytes.org" <joro@8bytes.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RFC][PATCH] Remove bus dependency for iommu_domain_alloc.
Date: Fri, 17 Jan 2014 20:21:16 +0000	[thread overview]
Message-ID: <546cedebe8cb4a6d818d9a6c3ef941bf@BL2PR03MB468.namprd03.prod.outlook.com> (raw)
In-Reply-To: <1389989354.8705.89.camel@bling.home>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3434 bytes --]



> -----Original Message-----
> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> Sent: Saturday, January 18, 2014 1:39 AM
> To: Sethi Varun-B16395
> Cc: joro@8bytes.org; iommu@lists.linux-foundation.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [RFC][PATCH] Remove bus dependency for iommu_domain_alloc.
> 
> On Sat, 2014-01-18 at 01:00 +0530, Varun Sethi wrote:
> > This patch attempts to remove iommu_domain_alloc function's dependency
> on the bus type.
> > This dependency is quiet restrictive in case of vfio, where it's
> > possible to bind multiple iommu groups (from different bus types) to
> the same iommu domain.
> >
> > This patch is based on the assumption, that there is a single iommu
> > for all bus types on the system.
> >
> > We maintain a list of bus types (for which iommu ops are registered).
> > In the iommu_domain_alloc function we ensure that all bus types
> correspond to the same set of iommu operations.
> 
> Seems like this just kicks the problem down the road a little ways as I
> expect the assumption isn't going to last long.  I think there's another
> way to do this and we can do it entirely from within vfio_iommu_type1.
> We have a problem on x86 that the IOMMU driver can be backed by multiple
> IOMMU hardware devices.  These separate devices are architecturally
> allowed to have different properties.  The property causing us trouble is
> cache coherency.  Some hardware devices allow us to use IOMMU_CACHE as a
> mapping attribute, others do not.  Therefore we cannot use a single IOMMU
> domain to optimally handle all devices in a heterogeneous environment.
> 
> I think the solution to this is to have vfio_iommu_type1 transparently
> support multiple IOMMU domains.  In the implementation of that, it seems
> to make sense to move the iommu_domain_alloc() to the point where we
> attach a group to the domain.  That means we can scan the devices in the
[Sethi Varun-B16395] Multiple iommu groups can also share the same domain (as a part
Of the same VFIO container). I am not sure how can we handle the case of iommu groups from
Different bus types in vfio.

-Varun

> domain to determine the bus.  I suppose there is still an assumption that
> all the devices in a group are on the same bus, but since the group is
> determined by the IOMMU and we already assume only a single IOMMU per
> bus, I think we're ok.  I spent some time working on a patch to do this,
> but it isn't quite finished.  I'll try to bandage the rough edges and
> send it out as an RFC so you can see what I'm talking about.  Thanks,
> 
> Alex
> 
> > Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
> > ---
> >  arch/arm/mm/dma-mapping.c             |    2 +-
> >  drivers/gpu/drm/msm/msm_gpu.c         |    2 +-
> >  drivers/iommu/amd_iommu_v2.c          |    2 +-
> >  drivers/iommu/iommu.c                 |   32
> +++++++++++++++++++++++++++++---
> >  drivers/media/platform/omap3isp/isp.c |    2 +-
> >  drivers/remoteproc/remoteproc_core.c  |    2 +-
> >  drivers/vfio/vfio_iommu_type1.c       |    2 +-
> >  include/linux/device.h                |    2 ++
> >  include/linux/iommu.h                 |    4 ++--
> >  virt/kvm/iommu.c                      |    2 +-
> >  10 files changed, 40 insertions(+), 12 deletions(-)

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2014-01-17 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 19:30 Varun Sethi
2014-01-17 20:09 ` Alex Williamson
2014-01-17 20:21   ` Varun Sethi [this message]
2014-01-17 20:40     ` Alex Williamson

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=546cedebe8cb4a6d818d9a6c3ef941bf@BL2PR03MB468.namprd03.prod.outlook.com \
    --to=varun.sethi@freescale.com \
    --cc=alex.williamson@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®