From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11458C77B7C for ; Fri, 26 May 2023 12:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbjEZMiE (ORCPT ); Fri, 26 May 2023 08:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbjEZMiE (ORCPT ); Fri, 26 May 2023 08:38:04 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4296D99; Fri, 26 May 2023 05:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lNfxSHS1UMaBMZLwessrox7ClcoojfQo4u1G/gCVpRk=; b=F8i1N0MhDb2OY0IY6jpteaJjel J+wgVsNwzbjVDy7D+oUdf56HV2XHl1ftpFFdeSNi4anvtzKDqtEvTvhUyW0hht2K1BNkcIYn/RCOa pFuadvx3d8q7hjK1Wpnip457c4/5PzOodTRcehh57MNN8Dqtl4iBNPS2I4Wht4ZhXlhkypo21wOWL zLYK5HJBJglOPbpotAWAk12sisYMojHMPav90HJkeECpSTPMIXgtqMfzmL4duyRKQ8WJItqg0iGs3 7Sh5BAZyWmVsPPZgz5Fx2pC7wch4F/7ZxuuxYr1IYLKgnQZMbmoQk5PDUunf4SO4R+IPyoSDN9j7w naClZciw==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2Whg-002VDl-2Y; Fri, 26 May 2023 12:37:56 +0000 Date: Fri, 26 May 2023 05:37:56 -0700 From: Christoph Hellwig To: Arnaud POULIQUEN Cc: Christoph Hellwig , Bjorn Andersson , Mathieu Poirier , Jens Wiklander , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org Subject: Re: [RFC PATCH 1/4] tee: Re-enable vmalloc page support for shared memory Message-ID: References: <20230523091350.292221-1-arnaud.pouliquen@foss.st.com> <20230523091350.292221-2-arnaud.pouliquen@foss.st.com> <18a8528d-7d9d-6ed0-0045-5ee47dd39fb2@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18a8528d-7d9d-6ed0-0045-5ee47dd39fb2@foss.st.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org 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: > https://lore.kernel.org/all/20221002002326.946620-3-ira.weiny@intel.com/ Yes. > > 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.