Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1816584rwd; Wed, 17 May 2023 01:35:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ462rEV6ywRIm2dhi+VM2kReEdC5xB+Dc68obyusLI03hrmaSiaIZc4uDb6AU71dvudyQk2 X-Received: by 2002:a17:90a:2dcf:b0:253:4333:22c0 with SMTP id q15-20020a17090a2dcf00b00253433322c0mr1423658pjm.49.1684312529612; Wed, 17 May 2023 01:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684312529; cv=none; d=google.com; s=arc-20160816; b=OGc/UO92EyEEKsCvl/UeiFCm0RAWFw4c2sUFYI4E/Z9RhUlalIEhu+mWUBD/rDsIH0 86mdyud881IvWaUjoH0xoYapkI/eHp2DynZKUWT3BeRjj7t62wcH4IcXzTBxI46pJVz3 KjWmvYE0MctFpgDNpxbEetSCZy1D2gA+FOwnowUGa7YYj41nHk6bj0qwm63LOPOaM5c2 mUceAnSlECdAYs9x324W/4Zk6WPZgCAlHVBD11GMQTadz4DZ7Fn84EpB5zmwTnsBgYCA q5sgbmNdVhQVHtzCQZWnSHTFZpgbKrJCuBms+S0Qr6AqBD/JUxGpHxCPp89j2DqpOcmR u+LQ== 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=mctQMwQ1c+oB4gTe4gyG4JXC6wODbSHM0afcemBmK5E=; b=NUj9JQrUfFqQu4sKosgi4uIK/xe6kNyTA6rpOgbMe4aKoLvgcjicLHlL1bfqvvrE5d E4OsQvg9OJZIf+i3PbIjgyoRHDWc7KnikG8dxigKaRt6x/VYMk4Wo6Iq4MnUZ11d1O5q Z8l+giUJ5TNvwmvB46Q7zEk5+ZXcEZp3L/vEzphtAtTM0ThhtAPVPRg8no2Wo4qIS6Ou mc4lfXHOYxWC5Y6dUSmXBBJPoSGAkx7qsqgcIjherw971aWoLqko25htEwjjKjwQ4djw kUDXXmJ5Z7V47utmDyQYkvZ/cF5o/bNBF/kHKs8UC0+tECQhvbrWp0mjbgxBX3AgH8X4 LgqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=MiwoWHnu; 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 cu21-20020a17090afa9500b002527f171401si1186184pjb.182.2023.05.17.01.35.17; Wed, 17 May 2023 01:35:29 -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=MiwoWHnu; 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 S229983AbjEQIIt (ORCPT + 99 others); Wed, 17 May 2023 04:08:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjEQIIs (ORCPT ); Wed, 17 May 2023 04:08:48 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EBF310D4 for ; Wed, 17 May 2023 01:08:47 -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=mctQMwQ1c+oB4gTe4gyG4JXC6wODbSHM0afcemBmK5E=; b=MiwoWHnukWLEc8HHBAQxr0V8gf heQzrC+fYM732ZPWIGHsBBhOAVy7EANqo+XUQlqKsLq+8XPSvRXU9rfE4M3eaDKYZeA5FgSYRMwZX lTHufQAa+Vf5hPr8800DznETF9mp/aOnIUHBQ6wn/8/A6iFiqxNst1VUYH1rmWDT2E5SMn4yQba6L txoPhqt9J50W/b/Oc4I4oGKU8wMHw6GyEWssUVDIU5H6buv/1n6SwwxzBUG7YVCr/MpQ4qtcoHkaH m4c2OzhwHT8NgX+yYXN4xnEMWtLz2drxB3cS9TEgqbuaY6FwuvO0YruAYlA3b5xrBJWKfJCsiI3gX EWKCzfJA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pzCDC-008nJF-2n; Wed, 17 May 2023 08:08:42 +0000 Date: Wed, 17 May 2023 01:08:42 -0700 From: Christoph Hellwig To: Sumit Garg Cc: Christoph Hellwig , Xiaoming Ding , Jens Wiklander , Matthias Brugger , AngeloGioacchino Del Regno , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, fei.xu@mediatek.com, srv_heupstream@mediatek.com, linux-mm@kvack.org Subject: Re: [PATCH] tee: add FOLL_LONGTERM for CMA case when alloc shm Message-ID: References: <20230517031856.19660-1-xiaoming.ding@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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.