linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: joro@8bytes.org (Joerg Roedel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] iommu/arm-smmu: Add initial driver support for ARM SMMUv3 devices
Date: Tue, 2 Jun 2015 20:43:55 +0200	[thread overview]
Message-ID: <20150602184355.GI20384@8bytes.org> (raw)
In-Reply-To: <20150602094746.GC22569@arm.com>

On Tue, Jun 02, 2015 at 10:47:46AM +0100, Will Deacon wrote:
> On Tue, Jun 02, 2015 at 08:39:56AM +0100, Joerg Roedel wrote:
> > I don't think we need to postpone anything. Domains returned by
> > iommu_domain_alloc() need to work for all groups. If there are multiple
> > IOMMUs in the system with different capabilities/page-table formats the
> > IOMMU core needs to build multiple page-tables for that domain.
> 
> I really don't think that's feasible. We support an awful lot of
> combinations that affect the page table format on ARM: there are 5
> different formats, each supporting different translation regimes (sets
> of page size) and each of those needs configuring for input/output
> address sizes to compute the number of levels. You could easily end up
> with over 20 page tables and their corresponding sets of control
> register values.

We only need to build page-tables for IOMMUs that are actually in the
system. And this also only for domains that are not tied to a particular
group. If some hardware vendor is crazy enough to put 20 IOMMUs in the
system with each having its own page-table format, then be it so. But in
reality I think we will have only a handful of different page-tables.

> Given that we only install one page table in the end, I'm struggling to
> see the issue with postponing its allocation until we've figured out
> the IOMMU instance thanks to a device attach.

It is a question of the use-case for the domain. A device driver (like
for USB or graphics) would allocate the domain with the _for_group
function and end up with only one page-table.

But if VFIO comes around and wants to attach devices to a KVM guest it
would use iommu_domain_alloc() and has then all page-tables it possibly
needs (for devices attached at start and even devices that might later
be hotplugged into the guest).


	Joerg

  reply	other threads:[~2015-06-02 18:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 18:00 [PATCH 0/3] iommu/arm-smmu: Add driver for ARM SMMUv3 devices Will Deacon
2015-05-08 18:00 ` [PATCH 1/3] Documentation: dt-bindings: Add device-tree binding for ARM SMMUv3 IOMMU Will Deacon
2015-05-08 18:00 ` [PATCH 2/3] iommu/arm-smmu: Add initial driver support for ARM SMMUv3 devices Will Deacon
2015-05-12  7:40   ` leizhen
2015-05-12 16:55     ` Will Deacon
2015-05-13  8:33       ` leizhen
2015-05-21 11:25         ` Will Deacon
2015-05-25  2:07           ` leizhen
2015-05-26 16:12             ` Will Deacon
2015-05-27  9:12               ` leizhen
2015-05-19 15:24   ` Joerg Roedel
2015-05-20 17:09     ` Will Deacon
2015-05-29  6:43       ` Joerg Roedel
2015-05-29 11:35         ` Robin Murphy
2015-05-29 14:40           ` Joerg Roedel
2015-06-01  9:40             ` Will Deacon
2015-06-02  7:39               ` Joerg Roedel
2015-06-02  9:47                 ` Will Deacon
2015-06-02 18:43                   ` Joerg Roedel [this message]
2015-05-08 18:00 ` [PATCH 3/3] drivers/vfio: Allow type-1 IOMMU instantiation on top of an ARM SMMUv3 Will Deacon

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=20150602184355.GI20384@8bytes.org \
    --to=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).