public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: will.deacon@arm•com (Will Deacon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 2/4] iommu: add ARM LPAE page table allocator
Date: Wed, 3 Dec 2014 11:11:08 +0000	[thread overview]
Message-ID: <20141203111108.GH7915@arm.com> (raw)
In-Reply-To: <vnkw8uipznbj.fsf@mitchelh-linux.qualcomm.com>

On Tue, Dec 02, 2014 at 10:41:52PM +0000, Mitchel Humpherys wrote:
> On Thu, Nov 27 2014 at 03:51:16 AM, Will Deacon <will.deacon@arm•com> wrote:
> > A number of IOMMUs found in ARM SoCs can walk architecture-compatible
> > page tables.
> >
> > This patch adds a generic allocator for Stage-1 and Stage-2 v7/v8
> > long-descriptor page tables. 4k, 16k and 64k pages are supported, with
> > up to 4-levels of walk to cover a 48-bit address space.
> >
> > Signed-off-by: Will Deacon <will.deacon@arm•com>
> > ---
> 
> [...]
> 
> > +static struct io_pgtable *arm_lpae_alloc_pgtable_s1(struct io_pgtable_cfg *cfg,
> > +						    void *cookie)
> > +{
> > +	u64 reg;
> > +	struct arm_lpae_io_pgtable *data = arm_lpae_alloc_pgtable(cfg);
> > +
> > +	if (!data)
> > +		return NULL;
> > +
> > +	/* TCR */
> > +	reg = ARM_LPAE_TCR_EAE |
> > +	     (ARM_LPAE_TCR_SH_IS << ARM_LPAE_TCR_SH0_SHIFT) |
> > +	     (ARM_LPAE_TCR_RGN_WBWA << ARM_LPAE_TCR_IRGN0_SHIFT) |
> > +	     (ARM_LPAE_TCR_RGN_WBWA << ARM_LPAE_TCR_ORGN0_SHIFT);
> 
> TCR has different definitions depending on whether we're using v7l or
> v8l.  For example, bit 31 is TG1[1] (not EAE) when CBA2R.VA64=1.  Are we
> expecting to have an io-pgtable-arm64.c or something?  Seems like that
> would be mostly redundant with this file...  (We have this problem in
> the current arm-smmu driver today).

I guess we can add an ARM_LPAE_V7_S1 format or something for this, although
we don't actually use TTBR1, so the current code shouldn't cause any issues.

Will

  reply	other threads:[~2014-12-03 11:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 11:51 [PATCH 0/4] Generic IOMMU page table framework Will Deacon
2014-11-27 11:51 ` [PATCH 1/4] iommu: introduce generic page table allocation framework Will Deacon
2014-11-30 22:00   ` Laurent Pinchart
2014-12-01 12:13     ` Will Deacon
2014-12-01 13:33       ` Laurent Pinchart
2014-12-01 13:53         ` Will Deacon
2014-12-14 23:46   ` Laurent Pinchart
2014-12-15  9:45     ` Will Deacon
2014-11-27 11:51 ` [PATCH 2/4] iommu: add ARM LPAE page table allocator Will Deacon
2014-11-30 23:29   ` Laurent Pinchart
2014-12-01 17:23     ` Will Deacon
2014-12-01 20:21       ` Laurent Pinchart
2014-12-02  9:41         ` Will Deacon
2014-12-02 11:47           ` Laurent Pinchart
2014-12-05 18:48             ` Will Deacon
2014-12-02 22:41   ` Mitchel Humpherys
2014-12-03 11:11     ` Will Deacon [this message]
2014-12-05 10:55   ` Varun Sethi
2014-12-05 18:48     ` Will Deacon
2014-12-14 17:45       ` Varun Sethi
2014-12-15 13:30         ` Will Deacon
2014-12-15 15:43           ` Will Deacon
2014-12-15 16:35             ` Varun Sethi
2014-12-15 17:25               ` Will Deacon
2014-12-15 16:43           ` Varun Sethi
2014-12-15 17:20             ` Will Deacon
2014-11-27 11:51 ` [PATCH 3/4] iommu: add self-consistency tests to ARM LPAE IO " Will Deacon
2014-11-27 11:51 ` [PATCH 4/4] iommu/arm-smmu: make use of generic LPAE allocator Will Deacon
2014-11-30 22:03 ` [PATCH 0/4] Generic IOMMU page table framework Laurent Pinchart
2014-12-01 12:05   ` Will Deacon
2014-12-02 13:47     ` Laurent Pinchart
2014-12-02 13:53       ` Will Deacon
2014-12-02 22:29         ` Laurent Pinchart
2014-12-14 23:49 ` Laurent Pinchart
2014-12-15 16:10   ` Will Deacon
2014-12-15 17:33     ` Laurent Pinchart
2014-12-15 17:39       ` Will Deacon
2014-12-15 17:46         ` Laurent Pinchart

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=20141203111108.GH7915@arm.com \
    --to=will.deacon@arm$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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