[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFA6WYO+AvnbuAdWyBAQ8HkLaOno7PXdsPb9SubxrGNvAm4UnQ@mail.gmail.com>
Date: Wed, 17 May 2023 13:22:51 +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:04, Christoph Hellwig <hch@...radead.org> wrote:
>
> > + u32 page_flag = FOLL_WRITE;
> >
> > if (!tee_device_get(teedev))
> > return ERR_PTR(-EINVAL);
> > @@ -255,9 +256,11 @@ register_shm_helper(struct tee_context *ctx, unsigned long addr,
> > ret = ERR_PTR(-ENOMEM);
> > goto err_free_shm;
> > }
> > -
> > +#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.
>
> The ifdef does not make sense.
Agree.
-Sumit
Powered by blists - more mailing lists