[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v02 1/7] arm: introduce remoteprocessor iommu module

Hi Ian,

Sorry for late reply,

On Wed, Jul 16, 2014 at 6:19 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> On Fri, 2014-07-04 at 14:59 +0100, Stefano Stabellini wrote:
>> On Thu, 26 Jun 2014, Andrii Tseglytskyi wrote:
>> > This is a fisrst patch from patch series which was
>> > developed to handle remote (external) processors
>> > memory management units. Remote processors are
>> > typically used for graphic rendering (GPUs) and
>> > high quality video decoding (IPUs). They are typically
>> > installed on such multimedia SoCs as OMAP4 / OMAP5.
>> >
>> > As soon as remoteprocessor MMU typically works with
>> > pagetables filled by physical addresses, which are
>> > allocated by domU kernel, it is almost impossible to
>> > use them under Xen, intermediate physical addresses
>> > allocated by kernel, need to be translated to machine
>> > addresses.
>> >
>> > This patch introduces a simple framework to perform
>> > pfn -> mfn translation for external MMUs.
>> > It introduces basic data structures and algorithms
>> > needed for translation.
>> >
>> > Typically, when MMU is configured, some it registers
>> > are updated by new values. Introduced frameworks
>> > uses traps as starting point of remoteproc MMUs
>> > pagetables translation.
>> >
>> > Change-Id: Ia4d311a40289df46a003f5ae8706c150bee1885d
>> > Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@xxxxxxxxxxxxxxx>
>> There is one problem with this patch: you need to find a way to "pin"
>> the p2m entries for the pfns and mfns found in the pagetables translated
>> by remoteproc_iommu.c.  Otherwise Xen might decide to change the pfn to
>> mfn mappings for the domain, breaking the pagetables already translated
>> by remoteproc_iommu.c.  pfn to mfn mappings are not guaranteed to be
>> stable. At the moment Xen on ARM wouldn't change pfn to mfn mappings
>> under the guest feet, but features like memory sharing or swapping,
>> supported on x86, could cause it to happen.
> I've not fully grokked this patch but wouldn't it be easier and better
> to have a hook to cause the remoteproc to throw away and rebuild its
> mappings when this happens? It could be called from e.g. the TLB flush
> associated with the p2m changing, I think.

Yes., you are right. And this series contains a hypercall definition,
which is designed to do this.

But let me explained a bit:
Pagetables are translated in 2 cases:

- specific register access
- direct hypercall

Specific register access trap was designed to hide pagetables
translation completely. Kernel won't know anything that addresses were
changed. And this works fine for 1 of OMAP remoteprocs - IPU. This is
the only reason why hypercall is used together with memory trap
algorithm, which is much more complicated than hypercall.


> Ian.


Andrii Tseglytskyi | Embedded Dev

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.