From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [GIT PULL] iommu: Kill off pgsize_bitmap field from struct iommu_ops
Date: Wed, 1 Apr 2015 17:36:18 +0100 [thread overview]
Message-ID: <20150401163618.GN1552@arm.com> (raw)
In-Reply-To: <1427899570.22236.14.camel@infradead.org>
On Wed, Apr 01, 2015 at 03:46:10PM +0100, David Woodhouse wrote:
> On Wed, 2015-04-01 at 15:39 +0100, Will Deacon wrote:
> > However, once we have that, we run into the same problem that we've got
> > with the current pgsize_bitmap. Namely, that it needs to be a per-domain
> > property to avoid it changing dynamically following an initial map request
> > or a probe of a new IOMMU device.
>
> That's not so much of a problem, surely? When adding devices to a new
> domain without any mappings, the minimum page size of the domain is the
> largest of all the IOMMUs participating in that domain.
The issue (speaking in terms of the ARM SMMU, since that's what I'm familiar
with) is that we don't know the page sizes until we've chosen our
translation regime.
For example, we may have an SMMU that supports the following page sizes
1: 4k | 2M | 1G
2: 16k | 32M
3: 64k | 512M
so a domain on the SMMU can use one of those three regimes. Other domains
*on the same SMMU* may use a different regime. That means we've actually
got three minimum page sizes for the SMMU.
Therefore, the page size we end up using for a domain depends on both:
(a) Whether or not we've probed another SMMU (using the same driver) that
goes and further restricts iommu_ops->min_pgsize (or whatever it ends
up being called)
(b) Which one of the available regimes is chosen by the page-table code.
Currently (b) tries to get something close to the CPU page size, but you
could imagine adding an interface to bias the selection towards some other
size. We could pick the largest minimum page size of the supported regimes
(I can't word this better... it would be 64k in the example above), but I
worry that this will end up being too big in practice and we'll over-map
for most small mappings.
If we put the min_pgsize in the domain, we can just describe it using the
regime that domain is using.
> And if you try to add new devices after you've already started making
> mappings, we refuse the addition if it would raise the minimum page size
> higher than the page sizes you're already using.
Ok, so I think that solves (a) above, but means we have to keep track of
the min_pgsize in the domain anyway so that we can check against it, in
which case it may just as well be removed from iommu_ops.
Will
next prev parent reply other threads:[~2015-04-01 16:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 17:19 [GIT PULL] iommu: Kill off pgsize_bitmap field from struct iommu_ops Will Deacon
2015-03-31 14:24 ` Joerg Roedel
2015-03-31 14:49 ` Will Deacon
2015-03-31 15:50 ` Alex Williamson
2015-04-01 11:53 ` Will Deacon
2015-04-01 15:53 ` Joerg Roedel
2015-04-01 16:45 ` Alex Williamson
2015-04-01 15:38 ` Joerg Roedel
2015-04-01 17:03 ` Will Deacon
2015-04-01 21:24 ` Joerg Roedel
2015-03-31 16:07 ` Robin Murphy
2015-04-01 13:14 ` David Woodhouse
2015-04-01 13:39 ` Will Deacon
2015-04-01 13:52 ` David Woodhouse
2015-04-01 14:05 ` Will Deacon
2015-04-01 14:28 ` David Woodhouse
2015-04-01 14:39 ` Will Deacon
2015-04-01 14:46 ` David Woodhouse
2015-04-01 16:36 ` Will Deacon [this message]
2015-04-01 21:28 ` joro at 8bytes.org
2015-04-02 8:58 ` Will Deacon
2015-04-01 16:51 ` Alex Williamson
2015-04-01 17:50 ` Will Deacon
2015-04-01 18:18 ` 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=20150401163618.GN1552@arm.com \
--to=will.deacon@arm.com \
--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).