[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFA6WYPOMwmrA3J84AHzoD2eAtNkpMxr754qHpc-j6XRkgFFvQ@mail.gmail.com>
Date: Wed, 17 May 2023 14:56:13 +0530
From: Sumit Garg <sumit.garg@...aro.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Xiaoming Ding <xiaoming.ding@...iatek.com>,
Jens Wiklander <jens.wiklander@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
op-tee@...ts.trustedfirmware.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, fei.xu@...iatek.com,
srv_heupstream@...iatek.com, linux-mm@...ck.org
Subject: Re: [PATCH] tee: add FOLL_LONGTERM for CMA case when alloc shm
On Wed, 17 May 2023 at 13:38, Christoph Hellwig <hch@...radead.org> wrote:
>
> On Wed, May 17, 2023 at 01:22:51PM +0530, Sumit Garg wrote:
> > > > +#if IS_ENABLED(CONFIG_CMA)
> > > > + page_flag |= FOLL_LONGTERM;
> > > > +#endif
> > > > if (flags & TEE_SHM_USER_MAPPED)
> > >
> > > If this mapping is long live it should always use FOLL_LONGTERM.
> >
> > It depends on the userspace application needs. However, I think it
> > should be safe to use FOLL_LONGTERM by default to serve cases like
> > secure media playback.
>
> long term is defined as won't automatically go away during the same
> syscall.
Do you mean a pinned user-space page can be paged out automatically?
The documentation [1] isn't very helpful here either since it talks
about "short term" vs "long term" in abstract terms.
Just FYI, the underlying use-case for TEE registered shared memory is
that the references to pinned pages are provided to TEE implementation
to operate upon. This can happen over multiple syscalls and we want
the pinned pages to be always in RAM as otherwise the physical
addresses may change if they are paged out in between. If this is only
supported reliably with a long term flag then this patch should be
tagged as a fix and requires stable backports.
[1] Documentation/core-api/pin_user_pages.rst
-Sumit
Powered by blists - more mailing lists