Re: [RFC PATCH 1/4] tee: Re-enable vmalloc page support for shared memory

From: Christoph Hellwig
Date: Fri May 26 2023 - 08:38:07 EST

On Wed, May 24, 2023 at 04:01:14PM +0200, Arnaud POULIQUEN wrote:
> > As per the discussion back then: don't just blindly do the same dumb
> > thing again and fix the interfae to actually pass in a page array,
> > or iov_iter or an actually useful container that fits.
> >
> I suppose your are speaking about this discussion:


> If I'm not mistaken, I should modify at tee_shm_register_kernel_buf API and
> register_shm_helper inernal function, right?

> What about having equivalent of shm_get_kernel_pages in an external helper (to
> defined where to put it), could it be an alternative of the upadate of the
> tee_shm API?

I think the fundamentally right thing is to pass an iov_iter to
register_shm_helper, and then use the new as of 6.3
iov_iter_extract_pages helper to extract the pages from that. For
the kernel users you can then simply pass down an ITER_BVEC iter
that you can fill with vmalloc pages if you want.