Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2371385rwd; Fri, 26 May 2023 05:54:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/8lpAKH+Px8Er1BQpYca4T3/DrZoS47MfwY56acCKZfSHAgqqjymGYuuH05vEI+gAbWid X-Received: by 2002:a05:6a00:2d84:b0:64d:6c6f:84f2 with SMTP id fb4-20020a056a002d8400b0064d6c6f84f2mr3329014pfb.19.1685105656670; Fri, 26 May 2023 05:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685105656; cv=none; d=google.com; s=arc-20160816; b=vWt1dn28GIEnz/TqgffeeaXPvY9a/8g2YsuZ9jjvPMWMUq9nw7njXf1oE300SXr7jS yTHmyZi1t+pOn8GWjmak4QE3dsnr7Sj8mf/3eRBT0EKWhcFb7NQnwhVD37grPhpCUd+l ZvwLYtpcE9C2uQwKeUPiCPeWb9ArHODB59CO+8+Hixjo+RDGr+KaD0k0YPYlDpADW7q0 tfE/fa5AxnNPfoKhUjMf8cR4Tp7zZJkefVjHLbgILau7Y7bgKSIj1pNBcawyI9L3eOdS grlqKScmSvrAVCKx8u8TVThqtF/W0WgEXTwhcQhzqAiIrOcV7jmDjwGH6qj0+M1/wjIG dPbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lNfxSHS1UMaBMZLwessrox7ClcoojfQo4u1G/gCVpRk=; b=cXRUk9MnqutW1NA+s/NZsBwAEDCoPC2tbVTuzm7gC5JsDvY74it40LFF3zeY3BQ+AU NJAd5jZgH+3X+zcMBHF/49qx2Y7XzFZzDyrq+fubhn5CV6jKa+kikIy7w5pTg2VfKi10 HXt3Si/1RMqj4YKVhb99d87RMB5p0yvy2zza0/hlKmxikZoadruTvsPNE+BVVrOl+++9 zw/5bjTKFdyqNsM2TZUeTbBnIiA/iv5ZFomatPmoJJ7JM0HpYfOHt9c1dob/WduIzxRt 32SyE32Nd3aoUvHHMV9Jbnd0ZFCPk4DBs69r9GbqVlnB/577Yw4umEc+Men4fRq5x5qP 2Z1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=F8i1N0Mh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t25-20020aa79479000000b0063d61f05a8fsi2148851pfq.198.2023.05.26.05.54.02; Fri, 26 May 2023 05:54:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=F8i1N0Mh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237243AbjEZMiF (ORCPT + 99 others); Fri, 26 May 2023 08:38:05 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.