[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdWGdQ9KfwQ+fMyM73BpvhJdqD6SVXA+02tZwYWtaJaZZg@mail.gmail.com>
Date: Thu, 26 Jan 2017 14:28:14 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Robin Murphy <robin.murphy@....com>
Cc: Geert Uytterhoeven <geert+renesas@...der.be>,
Joerg Roedel <joro@...tes.org>,
Magnus Damm <magnus.damm@...il.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Niklas Söderlund <niklas.soderlund@...natech.se>,
iommu@...ts.linux-foundation.org,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH/RFC] iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to
32-bit address space
Hi Robin,
On Thu, Jan 26, 2017 at 12:23 PM, Robin Murphy <robin.murphy@....com> wrote:
> On 26/01/17 09:53, Geert Uytterhoeven wrote:
>> Currently, the IPMMU/VMSA driver supports 32-bit I/O Virtual Addresses
>> only, and thus sets io_pgtable_cfg.ias = 32. However, it doesn't force
>> a 32-bit IOVA space through the IOMMU Domain Geometry.
>>
>> Hence if a device (e.g. SYS-DMAC) rightfully configures a 40-bit DMA
>> mask, it will still be handed out a 40-bit IOVA, outside the 32-bit IOVA
>> space, leading to out-of-bounds accesses of the PGD when mapping the
>> IOVA.
>>
>> Force a 32-bit IOMMU Domain Geometry to fix this.
>
> Reviewed-by: Robin Murphy <robin.murphy@....com>
Thanks!
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
>> ---
>> Should the generic code restrict the geometry based on IAS instead?
>
> Which generic code? IAS is specific to the io-pgtable library (well,
> really it's an ARM-SMMU-ism, but "input address size" is a fairly
> portable concept), but io-pgtable is just factored-out driver helper
> code and doesn't know anything about iommu_domains and the IOMMU API.
> Conversely, the IOMMU API core and kernel code beyond also know nothing
> about io-pgtable internals - in fact the domain geometry *is* how the
> IOMMU driver communicates its configured address space size to the
> outside world.
OK, so the IPMMU/VMSA does have to take care of it itself.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists