All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Julien Grall <julien.grall@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v02 1/7] arm: introduce remoteprocessor iommu module
Date: Wed, 23 Jul 2014 13:54:05 +0300	[thread overview]
Message-ID: <CAH_mUMPdWF4GsY1VLJXuo2QVKsG+tV13Uo_y4+haFZWmEPV1tA@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1407231127360.2293@kaball.uk.xensource.com>

Oh, Thank you. Clear enough, I would prefer to "pin" remoteproc
mappings, I would say that this is not possible to rewrite pagetable
at any moment of time. For example - during video playback IPU
allocates and frees buffers. The whole amount of memory, mapped to its
MMU is about 256 Mb. If Xen decides to change p2m mappings at this
moment of time, this will lead to significant playback lags. More than
- playback may crash.

Regards,
Andrii

On Wed, Jul 23, 2014 at 1:32 PM, Stefano Stabellini
<stefano.stabellini@eu.citrix.com> wrote:
> On Tue, 22 Jul 2014, Andrii Tseglytskyi wrote:
>> Hi Stefano,
>>
>> On Tue, Jul 22, 2014 at 3:42 PM, Stefano Stabellini
>> <stefano.stabellini@eu.citrix.com> wrote:
>> > On Wed, 16 Jul 2014, Ian Campbell 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@globallogic.com>
>> >> >
>> >> > 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.
>> >
>> > I guess it depends on how often Xen or the Xen tools are going to change
>> > the p2m for a running domain. For example changing one page mapping a
>> > couple of times a second would be very expensive if we have to rebuild
>> > the remoteproc pagetables every time.
>>
>> Sorry, I didn't get the point here. Looks like you are talking about
>> TLB flush initiated by Xen? Am I right?
>
> p2m stands for physical to machine (mappings) or IPA to PA using ARM
> terminology. Xen is free to change IPA to PA mappings of a VM without
> the VM knowing, while the VM is running. Nothing in Xen on ARM does it
> yet, but a few features do it today on Xen on x86. For example memory
> sharing and swapping.
>
> My first suggestion was to "pin" the p2m mappings of pages used in
> remoteproc pagetables, so that their IPA to PA mappings wouldn't change.
> Ian suggested to rebuild the remoteproc pagetables if one of the IPA to
> PA mappings change.
> My reply here is that the performance could suffer if IPA to PA mappings
> are changed often enough.



-- 

Andrii Tseglytskyi | Embedded Dev
GlobalLogic
www.globallogic.com

  reply	other threads:[~2014-07-23 10:54 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 11:06 [PATCH v02 0/7] arm: introduce remoteprocessor iommu module Andrii Tseglytskyi
2014-06-26 11:07 ` [PATCH v02 1/7] " Andrii Tseglytskyi
2014-06-29 18:00   ` Julien Grall
2014-07-22 15:20     ` Andrii Tseglytskyi
2014-07-22 16:29       ` Julien Grall
2014-07-31 11:59       ` Andrii Tseglytskyi
2014-07-31 12:11         ` Julien Grall
2014-07-31 12:49           ` Andrii Tseglytskyi
2014-07-04 13:59   ` Stefano Stabellini
2014-07-16 15:19     ` Ian Campbell
2014-07-22 12:42       ` Stefano Stabellini
2014-07-22 13:29         ` Julien Grall
2014-07-22 16:31           ` Andrii Tseglytskyi
2014-07-22 17:22         ` Andrii Tseglytskyi
2014-07-23 10:32           ` Stefano Stabellini
2014-07-23 10:54             ` Andrii Tseglytskyi [this message]
2014-07-22 15:40       ` Andrii Tseglytskyi
2014-07-22 15:32     ` Andrii Tseglytskyi
2014-08-01 10:06       ` Andrii Tseglytskyi
2014-08-01 10:32         ` Julien Grall
2014-08-01 10:34           ` Andrii Tseglytskyi
2014-08-01 10:37             ` Julien Grall
2014-08-01 10:43               ` Andrii Tseglytskyi
2014-08-20 19:40     ` Andrii Tseglytskyi
2014-08-21 15:30       ` Andrii Tseglytskyi
2014-08-21 23:41         ` Stefano Stabellini
2014-08-21 23:43       ` Stefano Stabellini
2014-07-16 15:29   ` Ian Campbell
2014-07-16 15:34     ` Ian Campbell
2014-07-22 16:24       ` Andrii Tseglytskyi
2014-07-22 16:14     ` Andrii Tseglytskyi
2014-06-26 11:07 ` [PATCH v02 2/7] arm: omap: introduce iommu translation for IPU remoteproc Andrii Tseglytskyi
2014-07-04 14:01   ` Stefano Stabellini
2014-07-22 16:56     ` Andrii Tseglytskyi
2014-07-04 14:30   ` Julien Grall
2014-07-22 16:58     ` Andrii Tseglytskyi
2014-07-16 15:36   ` Ian Campbell
2014-07-22 17:16     ` Andrii Tseglytskyi
2014-06-26 11:07 ` [PATCH v02 3/7] arm: omap: introduce iommu translation for GPU remoteproc Andrii Tseglytskyi
2014-06-26 11:07 ` [PATCH v02 4/7] arm: omap: introduce print pagetable function for IPU remoteproc Andrii Tseglytskyi
2014-07-16 15:38   ` Ian Campbell
2014-07-22 16:55     ` Andrii Tseglytskyi
2014-06-26 11:07 ` [PATCH v02 5/7] arm: omap: introduce print pagetable function for GPU remoteproc Andrii Tseglytskyi
2014-06-26 11:07 ` [PATCH v02 6/7] arm: introduce do_translate_pagetable hypercall Andrii Tseglytskyi
2014-07-04 14:05   ` Stefano Stabellini
2014-07-16 15:42     ` Ian Campbell
2014-07-22 16:47       ` Andrii Tseglytskyi
2014-07-22 16:37     ` Andrii Tseglytskyi
2014-07-04 14:35   ` Julien Grall
2014-07-16 15:43     ` Ian Campbell
2014-07-22 16:50       ` Andrii Tseglytskyi
2014-07-22 16:39     ` Andrii Tseglytskyi
2014-07-22 16:44       ` Julien Grall
2014-07-22 16:48         ` Andrii Tseglytskyi
2014-06-26 11:07 ` [PATCH v02 7/7] arm: add trap for remoteproc mmio accesses Andrii Tseglytskyi
2014-06-26 16:52   ` Julien Grall
2014-06-27  8:36     ` Andrii Tseglytskyi

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=CAH_mUMPdWF4GsY1VLJXuo2QVKsG+tV13Uo_y4+haFZWmEPV1tA@mail.gmail.com \
    --to=andrii.tseglytskyi@globallogic.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.